Oracle

RAC 數據庫的 RMAN 備份失敗

  • October 30, 2015

如果我沒有與任何實例的任何顯式連接,則備份將通過:

RUN {
ALLOCATE CHANNEL ch1 TYPE DISK FORMAT '\\192.168.2.11\test\DF_CH00_%U';
ALLOCATE CHANNEL ch2 TYPE DISK FORMAT '\\192.168.2.11\test\DF_CH01_%U';
ALLOCATE CHANNEL ch3 TYPE DISK FORMAT '\\192.168.2.11\test\DF_CH02_%U';
ALLOCATE CHANNEL ch4 TYPE DISK FORMAT '\\192.168.2.11\test\DF_CH03_%U';
Backup incremental level 0 database;
RELEASE CHANNEL ch1;
RELEASE CHANNEL ch2;
RELEASE CHANNEL ch3;
RELEASE CHANNEL ch4;
}

但是當我明確指定實例名稱時它會失敗:

RMAN> RUN {
2> ALLOCATE CHANNEL ch00 TYPE DISK connect 'sys/oracle@realdb_1' FORMAT '\\192.168.2.11\test\DF_CH00_%U';
3> ALLOCATE CHANNEL ch01 TYPE DISK connect 'sys/oracle@realdb_2' FORMAT '\\192.168.2.11\test\DF_CH01_%U';
4> ALLOCATE CHANNEL ch02 TYPE DISK connect 'sys/oracle@realdb_3' FORMAT '\\192.168.2.11\test\DF_CH02_%U';
5> ALLOCATE CHANNEL ch03 TYPE DISK connect 'sys/oracle@realdb_4' FORMAT '\\192.168.2.11\test\DF_CH03_%U';
6> Backup incremental level 0 database;
7> RELEASE CHANNEL ch00;
8> RELEASE CHANNEL ch01;
9> RELEASE CHANNEL ch02;
10> RELEASE CHANNEL ch03;
11> }
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-12001: could not open channel ch00
RMAN-10008: could not create channel context
RMAN-10003: unable to connect to target database
ORA-12154: TNS:could not resolve the connect identifier specified

有任何想法嗎 ?

你能單獨 tnsping realdb_1, realdb_2 嗎?

如果您使用 SCAN,但沒有手動將節點特定條目添加到 tnsnames.ora,則在請求連接到特定節點時可能會出現此問題,因為 SCAN 可能被配置為解析為 RAC 的 service_name,而不是“instance_name”。

這是我的 tnsnames.ora:

USAPROJ =
 (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.localdomain)(PORT = 1521))
   (CONNECT_DATA =
     (SERVER = DEDICATED)
     (SERVICE_NAME = usaproj.localdomain)
   )
 )

USAPROJ1 =
 (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.localdomain)(PORT = 1521))
   (CONNECT_DATA =
     (SERVER = DEDICATED)
     (SERVICE_NAME = usaproj.localdomain)
     (INSTANCE_NAME = usaproj1)   <-------
       )
 )

我創建了另一個條目 usaproj1,除了 service_name 參數之外,我還添加了“instance_name”,以指定我想要連接的節點。

希望能幫助到你。

引用自:https://dba.stackexchange.com/questions/119610