Oracle10g RAC環境下 DataGuard備庫搭建例項-3-eygle

season0891發表於2010-06-13

六、恢復備庫

6.2、在主庫執行,利用auxiliary來恢復備庫

[oracle@rac1 ~]$ $ORACLE_HOME/bin/rman target / auxiliary

RMAN> run

{

allocate channel c1 device type disk format '/soft/backup/%U' connect sys/6212327@rac1;

allocate channel c2 device type disk format '/soft/backup/%U' connect sys/6212327@rac2;

allocate auxiliary channel ac1 device type disk format '/soft/backup/%U';

allocate auxiliary channel ac2 device type disk format '/soft/backup/%U';

duplicate target database for standby;

}

從日誌可以看到,oracle先根據引數檔案把控制檔案恢復到合適位置,然後再根據db_file_name_cover把資料檔案恢復到合適位置。

 

七、後續工作

7.1、把備庫至於恢復狀態:

[oracle@standby admin]$ sqlplus "/as sysdba"

SQL> alter database recover managed standby database disconnect from session;

Database altered

此時觀察備庫的alert檔案,可以發現有很多類似的資訊:

Errors in file /opt/oracle/admin/rac/bdump/rac1_mrp0_10825.trc:

ORA-00313: open failed for members of log group 4 of thread 2

ORA-00312: online log 4 thread 2: '/soft/oradata/rac/raw11'

ORA-27037: unable to obtain file status

Linux Error: 2: No such file or directory

Additional information: 3

Clearing online redo logfile 4 /soft/oradata/rac/raw11

Clearing online log 4 of thread 2 sequence number 50

這是正常的,在第一次置於recover狀態的時候,備庫會生成對應的online redo log。

 

7.2、在備庫新增standby redo log

Standby redo log比archivelog方式有更大的優勢,且在最大保護、最大可用、實時恢復的情況下必須有standby redo log。

Standby redo log的組數一般為(N +1)* thread# (N分別為每個thread#的聯機日誌組數)。在本例,每一個thread的聯機日誌都是2組,所以,需要新增6組standby redo log:

SQL> alter database recover managed standby database cancel;

來源:(http://blog.sina.com.cn/s/blog_5ded2e5b0100f44b.html) - Oracle10g RAC環境下DataGuard備庫搭建例項-3-eygle_伊帆_新浪部落格

SQL> ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 ('/soft/oradata/rac/slog4.ora') SIZE 52428800;

SQL> ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 ('/soft/oradata/rac/slog5.ora') SIZE 52428800;

SQL> ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 ('/soft/oradata/rac/slog6.ora') SIZE 52428800;

SQL> ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 ('/soft/oradata/rac/slog7.ora') SIZE 52428800;

SQL> ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 ('/soft/oradata/rac/slog8.ora') SIZE 52428800;

SQL> ALTER DATABASE ADD STANDBY LOGFILE THREAD 2 ('/soft/oradata/rac/slog9.ora') SIZE 52428800;

注意:standby redo log的大小必須和聯機日誌一樣。

 

八、遇到的問題

8.1、FAL[client, MRP0]: Error 12545 connecting to PRIMARY for fetching gap sequence

Wed Apr 30 20:21:23 2008

Errors in file /opt/oracle/admin/rac/bdump/rac1_mrp0_10965.trc:

ORA-12545: Connect failed because target host or object does not exist

Wed Apr 30 20:22:23 2008

FAL[client]: Failed to request gap sequence

GAP - thread 1 sequence 88-88

DBID 2232067446 branch 644085430

FAL[client]: All defined FAL servers have been attempted.

這個問題和gap有關,備庫嘗試拿gap的時候,發現不能連線主庫。這個問題是RAC的監聽造成的,參考yangtingkun的解決方法,修改兩個引數 即可:

ALTER SYSTEM SET LOCAL_LISTENER = '(ADDRESS = (PROTOCOL = TCP)(HOST = 200.200.200.11)(PORT = 1521))' SID = 'rac1';

ALTER SYSTEM SET LOCAL_LISTENER = '(ADDRESS = (PROTOCOL = TCP)(HOST = 200.200.200.22)(PORT = 1521))' SID = 'rac2';

 

8.2

FAL[client]: Failed to request gap sequence

GAP - thread 1 sequence 88-88

DBID 2232067446 branch 644085430

FAL[client]: All defined FAL servers have been attempted.

-------------------------------------------------------------

Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization

parameter is defined to a value that is sufficiently large

enough to maintain adequate log switch information to resolve

archivelog gaps.

這個問題還是和gap有關。備庫現在需要從主庫上拿sequence 88這個歸檔,但這個歸檔在前面做備份的時候刪除了。解決方法是從備份還原這個歸檔:

RMAN> restore archivelog sequence 88;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/90618/viewspace-665295/,如需轉載,請註明出處,否則將追究法律責任。

相關文章