rman如何串連本機資料庫和遠端資料庫

來源:互聯網
上載者:User

rman 串連:

串連到本機資料庫:

1、首先指定ORACLE_SID ; --如果資料庫只有一個執行個體,那麼就不需要進行指定了,rman預設串連到唯一的執行個體上;

>set ORACLE_SID=ORCL

2、然後rman target usr/pwd nocatalog;--這樣預設就是串連的指定的資料庫服務名稱,關於catalog是什麼意思,我還不知道;

>rman target usr/pwd nocatalog;

3、也可以不指定使用者名稱和密碼 rman target /;--這種方式以什麼身份登入,我還沒查;

>rman target /

當然,也可以先啟動rman然後再通過connect串連到目標資料庫;

1、首先指定ORACLE_SID

>set ORACLE_SID=ORCL

2、然後rman

>rman

3、然後connnet target /

>然後connnet target /

串連到遠端資料庫:

本欄目更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

如果要串連的目標資料庫是一個遠端資料庫,那麼必須在建立串連時指定一個有效網路服務名,同時你本地的tnsname.ora檔案中也必須已經建立了該網路服務名的正確配置。樣本如下:

1、>rman target sys/change_on_install@testdb//依賴於tnsname.ora

2、也可以先進入rman,然後再進行串連;執行個體如下:

>rman

>connect target /@orcl2//如此直接到tnsname.ora中檢索服務orcl2的路徑 配置

如果想不依賴tnsname.ora檔案,可以這樣寫:

> connect target /@zhanglei-pc:1521/orcl2

PS:

1、sqlplus的串連遠端資料庫是完全一樣的,也可以直接@服務名,如sqlplus seem/seem@sorcl,其中sorcl是寫在tnsname.ora中的服務名;原來的sqlplus串連我是寫全的,不依賴tnsname.ora檔案如>sqlplus 使用者名稱/密碼@ip地址[:連接埠]/service_name [as sysdba]

2、常用的Oracle系統使用者/密碼:system/ manager, sys/change_on_install, scott/tiger

3、tnsping --- 可以直接測試資料庫服務名是否正常,非常好用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.