1、检查主备两边的序号
select max(sequence#) from v$log; ---检查发现一致
2、备库执行,查看是否有数据未应用
select name,SEQUENCE#,APPLIED from v$archived_log order by sequence#;
select SEQUENCE#,FIRST_TIME,NEXT_TIME ,APPLIED from v$archived_log order by 1;
3、检查备库是否开启实时应用
select recovery_mode from v$archive_dest_status where dest_id=2;
4、检查备库状态
select switchover_status from v$database; --发现状态not allowed
3、看看进程MRP是否存在
ps aux|grep mrp --发现进程不存在
4、如果不存在执行以下:
alter database recover managed standby database using current logfile disconnect;
alter database recover managed standby database disconnect from session; --后台执行
alter database recover managed standby database --前台执行,执行这个可以看到报错的情况
如果有报错,查看alert日志和log.xml日志
5、验证是否正常
select process,status from v$managed_standby;
select process,status,sequence# from v$managed_standby;
如果看到mrp0正常
6、以上步骤处理好后,如果数据还不正常,接着处理
关闭备库,接着处理:
把主库上 undotbs01.dbf 文件,物理的重拷到备库机上以前undotbs01.dbf 所在目录下;
$scp /data/oracle/oradata/voip/undotbs01.dbf 192.168.122.204:/data/oracle/oradata/voip
再在主库上重新生成一个standby control file ,拷到备库机上相应目录下,
alter database create standby controlfile as '/data/oracle/oradata/voip/qyqdg01.ctl'
$scp /data/oracle/oradata/voip/qyqdg01.ctl 192.168.122.204:/data/oracle/oradata/voip
$ mv qyqdg01.ctl control01.ctl
$ cp control01.ctl /data/oracle/flash_recovery_area/qyq/
$cd /data/oracle/flash_recovery_area/qyq/
$ mv control01.ctl control02.ctl
接着
STARTUP NOMOUNT;
ALTER DATABASE MOUNT STANDBY DATABASE;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
--------------------------------------
session恢复完成后,重启打开备库;
alter database open read only;
|