一、主备切换:
1.将主库切换成物理standby:
alter database commit to switchover to physical standby with session shutdown; startup mount;
2.备库执行切换成primary,完成后数据库是mount,需要open:
recover managed standby database cancel; recover automatic standby database ; RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION; alter database commit to switchover to primary with session shutdown; select status from v$instance; startup;
3.打开新的备库(原主库)的归档应用:
alter database recover managed standby database using current logfile disconnect from session;
检查日志应用状态:
column name format a50; set line 200; SELECT thread#,sequence#,name,applied FROM v$archived_log order by sequence#;
4.验证切换后,归档应用是否正常:
新备库执行:
column name format a50; set line 200; SELECT thread#,sequence#,name,applied FROM v$archived_log order by sequence#;
5.检查切换后的主备库的角色:
新的主备库分别执行:
select switchover_status,database_role from v$database;
注意切换完成以后必须自行添加临时文件,当我们在Primary端添加一个临时表空间,Standby端虽然不能创建出临时文件,但是临时表空间的信息是联动的带入的
评论前必须登录!
注册