本帖最后由 smalltom30 于 2011-12-3 11:51 编辑
我在验证一个问题的时候发现主备机状态如下:
主:
DATABASE_ROLE OPEN_MODE SWITCHOVER_STATUS
---------------- ---------- -------------------
PRIMARY READ WRITE SESSIONS ACTIVE
备:
DATABASE_ROLE OPEN_MODE SWITCHOVER_STATUS
---------------- ---------- ------------------
PHYSICAL STANDBY MOUNTED SWITCHOVER LATENT
在不清楚SWITCHOVER LATENT 的意思的情况下,在备机上执行:
SQL> alter database recover managed standby database disconnect from session;
log:
Sat Dec 03 10:35:29 2011
alter database recover managed standby database using current logfile disconnect from session
Attempt to start background Managed Standby Recovery process (ossdb)
Sat Dec 03 10:35:29 2011
MRP0 started with pid=28, OS id=21296
MRP0: Background Managed Standby Recovery process started (ossdb)
Fast Parallel Media Recovery enabled
Managed Standby Recovery starting Real Time Apply
Warning: Recovery target destination is in a sibling branch
of the controlfile checkpoint. Recovery will only recover
changes to datafiles.
Datafile 1 (ckpscn 936175) is orphaned on incarnation#=2
MRP0: Background Media Recovery terminated with error 19909
Errors in file /opt/oracle/oradb/diag/rdbms/ossdbstb/ossdb/trace/ossdb_mrp0_21296.trc:
ORA-19909: datafile 1 belongs to an orphan incarnation
ORA-01110: data file 1: '/opt/oracle/oradb/oradata/ossdb/system01.dbf'
Managed Standby Recovery not using Real Time Apply
Errors in file /opt/oracle/oradb/diag/rdbms/ossdbstb/ossdb/trace/ossdb_mrp0_21296.trc:
ORA-19909: datafile 1 belongs to an orphan incarnation
ORA-01110: data file 1: '/opt/oracle/oradb/oradata/ossdb/system01.dbf'
MRP0: Background Media Recovery process shutdown (ossdb)
Completed: alter database recover managed standby database using current logfile disconnect from session
###
在网上找到一个关于这个方式的解决方式,在备机上进行操作,(其实这里我应该多思考再操作,不必急着动手):
connected to target database: OSSDB (DBID=4294337785, not open)
RMAN> list incarnation of database;
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 OSSDB 4294337785 PARENT 1 11-SEP-08
2 2 OSSDB 4294337785 PARENT 880332 02-DEC-11
3 3 OSSDB 4294337785 CURRENT 936135 02-DEC-11
RMAN> reset database to incarnation 2;
database reset to incarnation 2
RMAN> list incarnation of database;
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 OSSDB 4294337785 PARENT 1 11-SEP-08
2 2 OSSDB 4294337785 CURRENT 880332 02-DEC-11
3 3 OSSDB 4294337785 ORPHAN 936135 02-DEC-11
主机:
RMAN> list incarnation of database;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 OSSDB 4294337785 PARENT 1 11-SEP-08
2 2 OSSDB 4294337785 PARENT 880332 02-DEC-11
3 3 OSSDB 4294337785 CURRENT 936135 02-DEC-11