搭建参见文章http://www.jb51.cc/article/p-yvzgbjsu-bqm.html,搭好后,做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
altersystemsetdb_file_name_convert='/data','+data'scope=spfile; altersystemsetlog_file_name_convert='/data','+data'scope=spfile;
standby:
fal_server=db
fal_client=standby
standby_file_management=auto
2 切换前rac需关闭至一个实例
3 检查是否有gap
4 切换:
源:
sql>alterdatabasecommittoswitchovertostandbywithsessionshutdown;
这里切换后,源端全自动shutdown abort;
--standby
sql>selectname,open_mode,DATABASE_ROLE,PROTECTION_MODE,switchover_statusfromv$database; NAMEOPEN_MODEDATABASE_ROLEPROTECTION_MODESWITCHOVER_STATUS ------------------------------------------------------------------------------------- DBREADONLYWITHAPPLYPHYSICALSTANDBYMAXIMUMAVAILABILITYTOPRIMARY
sql>altersystemsetlog_archive_dest_2="service=dblgwrsyncaffirmvalid_for=(all_logfiles,all_roles)db_unique_name=db"scope=both; sql>altersystemsetlog_archive_dest_state_2=enable; sql>alterdatabasecommittoswitchovertoprimarywithsessionshutdown;
--源
sql>startupmount sql>altersystemsetlog_archive_dest_state_2=defer; sql>selectname,LOG_MODE,OPEN_MODE,database_role,SWITCHOVER_STATUS,db_unique_namefromv$database NAMELOG_MODEOPEN_MODEDATABASE_ROLESWITCHOVER_STATUSDB_UNIQUE_NAME ----------------------------------------------------------------------------------------------------------- DBARCHIVELOGMOUNTEDPHYSICALSTANDBYRECOVERYNEEDEDdb sql>alterdatabaserecovermanagedstandbydatabasecancel; sql>alterdatabaSEOpen; sql>alterdatabaserecovermanagedstandbydatabaseusingcurrentlogfiledisconnect; sql>selectname,db_unique_namefromv$database; NAMELOG_MODEOPEN_MODEDATABASE_ROLESWITCHOVER_STATUSDB_UNIQUE_NAME ----------------------------------------------------------------------------------------------------------- DBARCHIVELOGREADONLYWITHAPPLYPHYSICALSTANDBYTOPRIMARYdb
--standby
sql>altersystemsetlog_archive_dest_2="service=dblgwrsyncaffirmvalid_for=(all_logfiles,all_roles)db_unique_name=db"scope=both;
sql>altersystemsetlog_archive_dest_state_2=enablescope=both;