搭建参见文章http://snowhill.blog.51cto.com/339421/1923591,搭好后,做switch over:
创新互联专注为客户提供全方位的互联网综合服务,包含不限于网站设计、成都网站建设、庆安网络推广、小程序设计、庆安网络营销、庆安企业策划、庆安品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;创新互联为所有大学生创业者提供庆安建站搭建服务,24小时服务热线:13518219792,官方网址:www.cdcxhl.com
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;