SQL> execute dbms_logmnr.add_logfile('/opt/oracle/oradata/archive/1_53_724790729.dbf',dbms_logmnr.removefile);
PL/SQL procedure successfully completed.
SQL> execute dbms_logmnr.add_logfile('/opt/oracle/oradata/archive/1_3966_689958410.dbf',dbms_logmnr.addfile);
BEGIN dbms_logmnr.add_logfile('/opt/oracle/oradata/archive/1_3966_689958410.dbf',dbms_logmnr.addfile); END;
*
ERROR at line 1:ORA-01287: file /opt/oracle/oradata/archive/1_3966_689958410.dbf is from a different database incarnationORA-06512: at "SYS.DBMS_LOGMNR", line 68ORA-06512: at line 1原因:归档文件来自不同的
database incarnation处理:重新设置
database incarnation,然后 分析日志SQL> host oerr ora 1287
01287, 00000, "file %s is from a different database incarnation"
// *Cause: The logfile is produced by a different incarnation of the database.
// *Action: Add a logfile that is produced by the same incarnation.
SQL> host oerr ora 6512
06512, 00000, "at %sline %s"
// *Cause: Backtrace message as the stack is unwound by unhandled
// exceptions.
// *Action: Fix the problem causing the exception or write an exception
// handler for this condition. Or you may need to contact your
// application administrator or DBA.
SQL>
SQL> select dbid from v$database;
DBID
----------
2410391178
is from a different database incarnation
http://youngcow.net/doc/oracle10g/backup.102/b14192/bkup007.htm
4.7.5 Listing Database Incarnations
Each time an OPEN RESETLOGS operation is performed on a database, this operation creates a new incarnation of the database. Database incarnations and their effect upon database recovery with RMAN are explained in more detail in Oracle Database Backup and Recovery Advanced User's Guide.
When performing incremental backups, RMAN can use a backup from a previous incarnation or the current incarnation as a basis for subsequent incremental backups. When performing restore and recovery, RMAN can use backups from a previous incarnation in restore and recovery operations just as it would use backups from the current incarnation, as long as all archived logs are available.
Use the LIST INCARNATION command to see the incarnations of your database.
To list database incarnations:
After connecting to the target database and the recovery catalog if applicable, run LIST INCARNATION:
RMAN> LIST INCARNATION;If you are using a recovery catalog, and if you register multiple target databases in the same catalog, then you can distinguish them by using the OF DATABASE option:
RMAN> LIST INCARNATION OF DATABASE prod3;
Refer to Oracle Database Backup and Recovery Reference for an explanation of the various column headings in the LIST output). Sample output follows:
RMAN> LIST INCARNATION OF DATABASE;List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- ------ ---------- ----------
1 1 RDBMS 774627068 PARENT 1 21-OCT-03
2 2 RDBMS 774627068 CURRENT 173832 21-OCT-03
oracle@standby:~/oradata/archive>
/opt/oracle/product/10.2/db_1/bin/rmanRecovery Manager: Release 10.2.0.4.0 - Production on Wed Jul 21 19:57:07 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
RMAN> connect target /connected to target database: xxxdb (DBID=2410391178)
RMAN>
RMAN> LIST INCARNATION;using target database control file instead of recovery catalog
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 xxxdb 2410391178 PARENT 1 19-JUN-09
2 2 xxxdb 2410391178 CURRENT 98608421 19-JUL-10reset database to incarnation 2
RMAN> reset database to incarnation 2
2> ;
database reset to incarnation 2
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 xxxdb 2410391178 PARENT 1 19-JUN-09
2 2 xxxdb 2410391178 CURRENT 98608421 19-JUL-10
RMAN>
reset database to incarnation 1;RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of reset command on default channel at 07/21/2010 20:00:21
ORA-19910: can not change recovery target incarnation in control fileRMAN> reset database to incarnation 2;
database reset to incarnation 2
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 xxxdb 2410391178 PARENT 1 19-JUN-09
2 2 xxxdb 2410391178 CURRENT 98608421 19-JUL-10
RMAN>
RMAN> startup force mountOracle instance started
database mounted
Total System Global Area 167772160 bytes
Fixed Size 1266392 bytes
Variable Size 138415400 bytes
Database Buffers 25165824 bytes
Redo Buffers 2924544 bytes
RMAN> reset database to incarnation 1;database reset to incarnation 1
RMAN> list incarnation;List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 xxxdb 2410391178 CURRENT 1 19-JUN-092 2 xxxdb 2410391178 ORPHAN 98608421 19-JUL-10
RMAN> alter database open;
database opened
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 xxxdb 2410391178 CURRENT 1 19-JUN-09
2 2 xxxdb 2410391178 ORPHAN 98608421 19-JUL-10
RMAN>
SQL> conn / as sysdba
Connected.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /opt/oracle/oradata/archive/
Oldest online log sequence 53
Next log sequence to archive 55
Current log sequence 55
SQL> alter system switch logfile;System altered.
SQL> execute dbms_logmnr.add_logfile('/opt/oracle/oradata/archive/
1_3966_689958410.dbf',dbms_logmnr.addfile);
PL/SQL procedure successfully completed.
SQL> EXECUTE dbms_logmnr.start_logmnr(dictfilename=> '/opt/oracle/oradata/xxxdb/logminer_dict.dat')
PL/SQL procedure successfully completed.
SQL> Select SCN,timestamp, session# session_num,sql_redo From V$LOGMNR_CONTENTS where username='TESTUSER';no rows selected
execute dbms_logmnr.add_logfile('/opt/oracle/oradata/archive/
1_53_724790729.dbf',dbms_logmnr.addfile);
SQL> execute dbms_logmnr.add_logfile('/opt/oracle/oradata/archive/1_53_724790729.dbf',dbms_logmnr.addfile);
BEGIN dbms_logmnr.add_logfile('/opt/oracle/oradata/archive/1_53_724790729.dbf',dbms_logmnr.addfile); END;
*
ERROR at line 1:
ORA-01287: file /opt/oracle/oradata/archive/1_53_724790729.dbf is from adifferent database incarnationORA-06512: at "SYS.DBMS_LOGMNR", line 68
ORA-06512: at line 1
SQL>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/77164/viewspace-668718/
,如需转载,请注明出处,否则将追究法律责任。