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 /


串連到遠端資料庫:
如果要串連的目標資料庫是一個遠端資料庫,那麼必須在建立串連時指定一個有效網路服務名,同時你本地的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 --- 可以直接測試資料庫服務名是否正常,非常好用


相關文章

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.