控制檔案和CATALOG中的記錄不能同步

westzq1984發表於2009-09-05

異常描述:

[oracle@PRIMARY ~]$ rman catalog rman/rman@rmandb10 target rman/rman

Recovery Manager: Release 10.2.0.4.0 - Production on Fri Sep 4 12:15:38 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: PRIMARY (DBID=1535410713)
connected to recovery catalog database

RMAN> list copy;

specification does not match any archive log in the recovery catalog

RMAN> exit


Recovery Manager complete.
[oracle@PRIMARY ~]$ rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Fri Sep 4 12:15:48 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: PRIMARY (DBID=1535410713)

RMAN> list copy
2> ;

using target database control file instead of recovery catalog

List of Archived Log Copies
Key     Thrd Seq     S Low Time  Name
------- ---- ------- - --------- ----
387     1    209     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_209_697928025.dbf
383     1    210     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_210_697928025.dbf
384     1    211     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_211_697928025.dbf
380     1    212     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_212_697928025.dbf
377     1    213     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_213_697928025.dbf
381     1    214     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_214_697928025.dbf
386     1    215     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_215_697928025.dbf
388     1    216     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_216_697928025.dbf
382     1    217     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_217_697928025.dbf
376     1    218     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_218_697928025.dbf
385     1    219     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_219_697928025.dbf
378     1    220     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_220_697928025.dbf
375     1    221     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_221_697928025.dbf
379     1    222     A 04-SEP-09 /u01/app/oracle/arch/tmp/1_222_697928025.dbf
393     1    223     A 04-SEP-09 /u01/app/oracle/arch/1_223_697928025.dbf

****************************************************************************************************

在METALINK也沒找到有相識的問題,GOOGLE下有人遇到一樣的,但也沒解決辦法。嘗試過9i,10g的CATALOG,都是一樣,於是嘗試重建控制檔案

SQL> oradebug setmypid
Statement processed.
SQL> alter database backup controlfile to trace;

Database altered.

SQL> oradebug tracefile_name
/u01/app/oracle/admin/primary/udump/primary_ora_4341.trc

SQL> STARTUP NOMOUNT
ORACLE instance started.

Total System Global Area  205520896 bytes
Fixed Size                  1266608 bytes
Variable Size             146803792 bytes
Database Buffers           54525952 bytes
Redo Buffers                2924544 bytes
SQL> CREATE CONTROLFILE REUSE DATABASE "PRIMARY" NORESETLOGS FORCE LOGGING ARCHIVELOG
  2      MAXLOGFILES 16
  3      MAXLOGMEMBERS 3
  4      MAXDATAFILES 100
  5      MAXINSTANCES 8
  6      MAXLOGHISTORY 292
  7  LOGFILE
  8    GROUP 1 (
  9      '/dev/raw/raw4',
 10      '/dev/raw/raw5'
 11    ) SIZE 25M,
 12    GROUP 2 (
 13      '/dev/raw/raw6',
 14      '/dev/raw/raw7'
 15    ) SIZE 25M
 16  -- STANDBY LOGFILE
 17  --   GROUP 11 (
 18  --     '/dev/raw/raw17',
 19  --     '/dev/raw/raw18'
 20  --   ) SIZE 25M,
 21  --   GROUP 12 (
 22  --     '/dev/raw/raw19',
 23  --     '/dev/raw/raw20'
 24  --   ) SIZE 25M,
 25  --   GROUP 13 (
 26  --     '/dev/raw/raw21',
 27  --     '/dev/raw/raw22'
 28  --   ) SIZE 25M
 29  DATAFILE
 30    '/dev/raw/raw8',
 31    '/dev/raw/raw10',
 32    '/dev/raw/raw15',
 33    '/dev/raw/raw14',
 34    '/dev/raw/raw13'
 35  CHARACTER SET ZHS16GBK
 36  ;

Control file created.

SQL> ALTER SYSTEM ARCHIVE LOG ALL;

System altered.

SQL> ALTER DATABASE OPEN;

Database altered.

SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/dev/raw/raw9'
  2       SIZE 367001600  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 419430400 ;

Tablespace altered.

SQL> ALTER DATABASE ADD STANDBY LOGFILE '/dev/raw/raw17'
  2   SIZE 25M REUSE;
ALTER DATABASE ADD STANDBY LOGFILE MEMBER '/dev/raw/raw18'
                                       TO '/dev/raw/raw17';
ALTER DATABASE ADD STANDBY LOGFILE '/dev/raw/raw19'
 SIZE 25M REUSE;
ALTER DATABASE ADD STANDBY LOGFILE MEMBER '/dev/raw/raw20'
                                       TO '/dev/raw/raw19';
ALTER DATABASE ADD STANDBY LOGFILE '/dev/raw/raw21'
 SIZE 25M REUSE;
ALTER DATABASE ADD STANDBY LOGFILE MEMBER '/dev/raw/raw22'
                                       TO '/dev/raw/raw21';
Database altered.

SQL>   2 
Database altered.

SQL>   2 
Database altered.

SQL>   2 
Database altered.

SQL>   2 
Database altered.

SQL>   2 

Database altered.

重新驗證

[oracle@PRIMARY ~]$ rman catalog rman/rman@rmandb10 target rman/rman

Recovery Manager: Release 10.2.0.4.0 - Production on Fri Sep 4 12:20:04 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: PRIMARY (DBID=1535410713)
connected to recovery catalog database

RMAN> list copy;

starting full resync of recovery catalog
full resync complete

List of Archived Log Copies
Key     Thrd Seq     S Low Time  Name
------- ---- ------- - --------- ----
303     1    223     A 04-SEP-09 /u01/app/oracle/arch/1_223_697928025.dbf
304     1    224     A 04-SEP-09 /u01/app/oracle/arch/1_224_697928025.dbf

RMAN> exit


Recovery Manager complete.
[oracle@PRIMARY ~]$ rman target /                                  

Recovery Manager: Release 10.2.0.4.0 - Production on Fri Sep 4 12:20:17 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: PRIMARY (DBID=1535410713)

RMAN> list copy;

using target database control file instead of recovery catalog

List of Archived Log Copies
Key     Thrd Seq     S Low Time  Name
------- ---- ------- - --------- ----
1       1    223     A 04-SEP-09 /u01/app/oracle/arch/1_223_697928025.dbf
2       1    224     A 04-SEP-09 /u01/app/oracle/arch/1_224_697928025.dbf


STANDBY庫也有這個問題,於是也嘗試重建看看
STANDBY庫:
SQL> alter database recover managed standby database cancel;

Database altered.

SQL> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.

PRIMARY庫:
SQL> alter database create standby controlfile as '/u01/app/oracle/backup/standbycontrolfile.ctl';

Database altered.

[oracle@PRIMARY backup]$ rcp standbycontrolfile.ctl STANDBY:/u01/app/oracle/backup/standbycontrolfile.ctl

STANDBY庫:
[oracle@STANDBY backup]$ dd if=standbycontrolfile.ctl f=/dev/raw/raw2 bs=1024000
7+1 records in
7+1 records out
[oracle@STANDBY backup]$ dd if=standbycontrolfile.ctl f=/dev/raw/raw3 bs=1024000
7+1 records in
7+1 records out

SQL> startup mount
ORACLE instance started.

Total System Global Area  205520896 bytes
Fixed Size                  1266608 bytes
Variable Size              67112016 bytes
Database Buffers          134217728 bytes
Redo Buffers                2924544 bytes
Database mounted.
SQL> alter database recover managed standby database disconnect;

Database altered.

[oracle@STANDBY backup]$ rman target / catalog rman/rman@rman

Recovery Manager: Release 10.2.0.4.0 - Production on Fri Sep 4 12:23:44 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: PRIMARY (DBID=1535410713, not open)
connected to recovery catalog database

RMAN> list copy;


List of Archived Log Copies
Key     Thrd Seq     S Low Time  Name
------- ---- ------- - --------- ----
1769    1    226     A 04-SEP-09 /u01/app/oracle/arch/1_226_697928025.dbf
1768    1    227     A 04-SEP-09 /u01/app/oracle/arch/1_227_697928025.dbf
1770    1    228     A 04-SEP-09 /u01/app/oracle/arch/1_228_697928025.dbf

沒有找到相關的BUG描述,很倒黴,老是遇到莫名其妙的BUG

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

相關文章