分类: Oracle
2008-05-28 08:06:24
来源:赛迪网 作者:Bennett |
10、主库配置到STANDBY的归档,另外注意主库需要设置log_archive_config这个参数,否则归档将不会从主库传至STANDBY端:
Sys@orcl> alter system set log_archive_dest_2='service=standby ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=standby';
Sys@orcl> alter system set log_archive_dest_state_2=enable;
Sys@orcl> alter system set log_archive_config='DG_CONFIG=(orcl,standby)';
这样异构STANDBY就配置成功了。
11、测试STANDBY切换,注意在测试前要在主库端和备库端都准备好主库和备库的两种参数文件:
首先在主库端将主库切换为备库:
SQL> alter database commit to switchover to physical standby with session shutdown ;
SQL> startup mount pfile='d:\init_standby.ora'
SQL> alter database recover managed standby database disconnect from session;
再在备库端将备库切换为主库:
idle> alter database commit to switchover to primary;
idle> shutdown
idle> startup pfile='/home/oracle/opt/admin/standby/pfile/init.ora'
ORACLE instance started.
Total System Global Area 836976640 bytes
Fixed Size 1303132 bytes
Variable Size 595594660 bytes
Database Buffers 234881024 bytes
Redo Buffers 5197824 bytes
Database mounted.
Database opened.
至此,切换顺利完成。 |