1. 首先檢視主庫目前保護模式(主庫操作)
sql> select protection_mode,protection_level from v$database;
protection_mode protection_level
-------------------- --------------------
maximum performance maximum performance
2. 修改主庫初始化參數(主庫操作)
sql> alter system set log_archive_dest_2='service=phystandby optional lgwr sync affirm valid_for=(online_logfiles,primary_role) db_unique_name=phystandby' ;
system altered.
具體參數修改,參照如下表格
maximum availability maximum performance maximum protection
affirm
noaffirm
sync
async
db_unique_name
3.重新開機主庫到mount
sql> shutdown immediate
database closed.
database dismounted.
oracle instance shut down.
sql> startup mount;
oracle instance started.
total system global area 422670336 bytes
fixed size 1336960 bytes
variable size 348129664 bytes
database buffers 67108864 bytes
redo buffers 6094848 bytes
database mounted.
sql> alter database set standby database to maximize availability;
database altered.
sql> alter database open;
5. 校驗主庫保護模式
maximum availability maximum availability
6. 檢視備庫保護模式
7. 修改備庫保護模式(為資料庫角色切換做鋪墊)
sql> alter system set log_archive_dest_2='service=phyprimary optional lgwr sync affirm valid_for=(online_logfile,primary_role) db_unique_name=phyprimary';
參考至:http://blog.sina.com.cn/s/blog_6a5aa0300102uzeb.html
如有錯誤,歡迎指正
作者:czmmiao 文章出處:http://czmmiao.iteye.com/blog/2124728