DG使用中遇到的幾個錯誤

space6212發表於2019-06-16

最近,在使用10G的DG中遇到了幾個錯誤(這裡的錯誤主要指後臺報錯)。本文就這幾個錯誤簡單分析原因及解決方法:


1、執行:alter database recover managed standby database disconnect from session;
後臺alert檔案報錯如下:
Errors in file /u01/oracle/admin/primary/bdump/primary_mrp0_2967.trc:
ORA-19527: physical standby redo log must be renamed
ORA-00312: online log 1 thread 1: '/u01/oracle/oradata/primary/redo01.log'

出現這個錯誤是因為oracle為了降低不小心清空主庫聯機日誌的風險而引起的。
oracle不知道你的主備庫分別是分別在一臺機器上還是不同的機器上,如果是在相同的機器上,則有可能不小心把主庫的聯機清空了。

如果是先在主庫switch logfile後,再alter database recover managed standby database disconnect from session;還會有如下報錯:
Errors in file /u01/oracle/admin/primary/bdump/primary_mrp0_2967.trc:
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/oracle/oradata/primary/redo01.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3

這個錯誤會在10g出現,9i是不會出現的。因為做switch over的時候需要清空聯機日誌,在10g中,oracle為了加快swich over的速度,在恢復過程中清空備庫的聯機日誌。

以上兩個問題可以看作是一個問題,解決方法是在備庫設定log_file_name_convert即可,如:
log_file_name_convert='/u01/primary/','/u01/primary/'

注意:即使是在目錄結構完全一樣的主備庫中這個錯誤也會出現。

2、
執行:alter database recover managed standby database cancel;
後臺alert檔案有如下錯誤:
Errors in file /u01/oracle/admin/primary/bdump/primary_mrp0_2967.trc:
ORA-16037: user requested cancel of managed recovery operation
Recovery interrupted!
這個錯誤是正常的,不用在意。

3、
Errors in file /u01/oracle/admin/primary/udump/primary_rfs_3380.trc:
ORA-00313: open failed for members of log group 4 of thread 1
ORA-00312: online log 4 thread 1: '/u01/oracle/oradata/primary/standbyredo04.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Sun Jun 24 15:36:05 2007
Errors in file /u01/oracle/admin/primary/udump/primary_rfs_3380.trc:
ORA-00313: open failed for members of log group 4 of thread 1
ORA-00312: online log 4 thread 1: '/u01/oracle/oradata/primary/standbyredo04.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
.......
......
Sun Jun 24 15:36:05 2007
Errors in file /u01/oracle/admin/primary/udump/primary_rfs_3380.trc:
ORA-00313: open failed for members of log group 7 of thread 1
ORA-00312: online log 7 thread 1: '/u01/oracle/oradata/primary/standbyredo7.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
Sun Jun 24 15:36:05 2007
Errors in file /u01/oracle/admin/primary/udump/primary_rfs_3380.trc:
ORA-00313: open failed for members of log group 7 of thread 1
ORA-00312: online log 7 thread 1: '/u01/oracle/oradata/primary/standbyredo7.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
RFS[1]: Unable to open standby log 7: 313
RFS[1]: No standby redo logfiles created
RFS[1]: Archived Log: '/u01/archivelog/1_12_626106231.dbf'
Sun Jun 24 15:36:07 2007
Redo Shipping Client Connected as PUBLIC

出現這個錯誤主要是因為在備份前主庫建立了standby redo log,備庫是根據主庫的資訊建立的,一開始它是包含了主庫的standby redo log資訊,如果主庫設定的日誌傳送方式是LGWR,當主庫發生日誌切換時,備庫的RFS會嘗試使用standby redo log來儲存主庫傳送過來的日誌,因為此時備庫實際上是不存在standby redo log的,所以備庫會報錯。當備庫嘗試開啟字典資訊的所有standby redo log失敗以後,備庫會自動把日誌傳送方式轉為ARCN,並同時清除資料字典中的standby redo log資訊。

下面是清除standby redo log資訊前的資料字典資訊:
SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------------------------------------ ---
1 ONLINE /u01/oracle/oradata/primary/redo01.log NO
2 ONLINE /u01/oracle/oradata/primary/redo02.log NO
3 ONLINE /u01/oracle/oradata/primary/redo03.log NO
4 STANDBY /u01/oracle/oradata/primary/standbyredo04.log NO
5 STANDBY /u01/oracle/oradata/primary/standbyredo5.log NO
6 STANDBY /u01/oracle/oradata/primary/standbyredo6.log NO
7 STANDBY /u01/oracle/oradata/primary/standbyredo7.log NO

7 rows selected.

下面的資訊是在備庫嘗試開啟standby redo log後的資料字典資訊:

SQL> select * from v$logfile;

GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------------------------------------ ---
1 ONLINE /u01/oracle/oradata/primary/redo01.log NO
2 ONLINE /u01/oracle/oradata/primary/redo02.log NO
3 ONLINE /u01/oracle/oradata/primary/redo03.log NO

注意的是:當你在備庫新增了standby redo log後,oracle在下一次日誌切換時會重新用LGWR傳送日誌。

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

相關文章