dataguard rac到单机之间的switch over
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了dataguard rac到单机之间的switch over相关的知识,希望对你有一定的参考价值。
搭建参见文章http://snowhill.blog.51cto.com/339421/1923591,搭好后,做switch over:
1 检查参数fal_server,fal_client,log_archive_dest_2,log_file_name_convert,data_file_name_convert,
standby_file_management
源:
fal_server=standby
fal_cleint=db
alter system set db_file_name_convert=‘/data‘,‘+data‘ scope=spfile; alter system set log_file_name_convert=‘/data‘,‘+data‘ scope=spfile;
standby:
fal_server=db
fal_client=standby
standby_file_management=auto
2 切换前rac需关闭至一个实例
3 检查是否有gap
4 切换:
源:
SQL> alter database commit to switchover to standby with session shutdown;
这里切换后,源端全自动shutdown abort;
--standby
SQL>select name,open_mode,DATABASE_ROLE,PROTECTION_MODE,switchover_status from v$database; NAME OPEN_MODE DATABASE_ROLE PROTECTION_MODE SWITCHOVER_STATUS --------- -------------------- ---------------- -------------------- -------------------- DB READ ONLY WITH APPLY PHYSICAL STANDBY MAXIMUM AVAILABILITY TO PRIMARY
SQL>alter system set log_archive_dest_2="service=db lgwr sync affirm valid_for=(all_logfiles,all_roles) db_unique_name=db" scope=both; SQL>alter system set log_archive_dest_state_2=enable; SQL>alter database commit to switchover to primary with session shutdown;
--源
SQL>startup mount SQL>alter system set log_archive_dest_state_2=defer; SQL>select name, LOG_MODE, OPEN_MODE, database_role, SWITCHOVER_STATUS, db_unique_name from v$database NAME LOG_MODE OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS DB_UNIQUE_NAME --------- ------------ -------------------- ---------------- -------------------- ------------------------------ DB ARCHIVELOG MOUNTED PHYSICAL STANDBY RECOVERY NEEDED db SQL> alter database recover managed standby database cancel; SQL> alter database open; SQL> alter database recover managed standby database using current logfile disconnect; SQL> select name, LOG_MODE, OPEN_MODE, database_role, SWITCHOVER_STATUS, db_unique_name from v$database; NAME LOG_MODE OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS DB_UNIQUE_NAME --------- ------------ -------------------- ---------------- -------------------- ------------------------------ DB ARCHIVELOG READ ONLY WITH APPLY PHYSICAL STANDBY TO PRIMARY db
--standby
SQL>alter system set log_archive_dest_2="service=db lgwr sync affirm valid_for=(all_logfiles,all_roles) db_unique_name=db" scope=both;
SQL>alter system set log_archive_dest_state_2=enable scope=both;
本文出自 “snowhill” 博客,请务必保留此出处http://snowhill.blog.51cto.com/339421/1951592
以上是关于dataguard rac到单机之间的switch over的主要内容,如果未能解决你的问题,请参考以下文章
Oracle数据库集群容灾实施与维护(RAC+DataGuard+GoldenGate)培训教程
Oracle Dataguard(主库为 Oracle rac 集群)配置教程(03)—— 创建 dataguard 数据库之前的准备工作