日志不得应用情况切换备库为主库
备库运行如下:
alter database recover managed standby database disconnect from session;
alter database commit to switchover to primary
日志反应如下:
Maximum wait for role transition is 15 minutes.
2016-09-07 12:57:20.653000 +08:00
Switchover: Media recovery is still active
Database not available for switchover
End-Of-REDO archived log file has not been recovered
Database not available for switchover
End-Of-REDO archived log file has not been recovered
2016-09-07 12:57:22.681000 +08:00
Database not available for switchover
End-Of-REDO archived log file has not been recovered
Database not available for switchover
End-Of-REDO archived log file has not been recovered
下面将STANDBY数据库切换为PRIMARY数据库:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
或
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE;
SELECT DATABASE_ROLE FROM V$DATABASE;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
这样备库可切换成primary 了
备库运行如下:
alter database recover managed standby database disconnect from session;
alter database commit to switchover to primary
日志反应如下:
Maximum wait for role transition is 15 minutes.
2016-09-07 12:57:20.653000 +08:00
Switchover: Media recovery is still active
Database not available for switchover
End-Of-REDO archived log file has not been recovered
Database not available for switchover
End-Of-REDO archived log file has not been recovered
2016-09-07 12:57:22.681000 +08:00
Database not available for switchover
End-Of-REDO archived log file has not been recovered
Database not available for switchover
End-Of-REDO archived log file has not been recovered
下面将STANDBY数据库切换为PRIMARY数据库:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
或
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE;
SELECT DATABASE_ROLE FROM V$DATABASE;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
这样备库可切换成primary 了