Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1133927
  • 博文数量: 276
  • 博客积分: 10077
  • 博客等级: 上将
  • 技术积分: 2513
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-24 20:31
文章分类

全部博文(276)

文章存档

2020年(1)

2015年(5)

2012年(2)

2011年(6)

2010年(7)

2009年(224)

2008年(31)

我的朋友

分类: Oracle

2009-01-31 15:29:58

环境:Windows(64bit) + 10.2.0.3 + bundle patch 21
 
Physical Standby创建过程
该环境使用Max performance,故不须要建standby redo log.
1.将库设为强制归档
alter database force logging;
 
2.mount database, create standby control file.
startup mount
alter database create standby controlfile as 'K:\control01.ctl';
shutdown immediate;
 
3.COPY datafiles, password file, spfile 到目的端.
 
4.recover standby database
startup mount;
alter database recover managed standby database disconnect from session;
 
5.open primary database.
 
Switchovers
1.primary
SELECT SWITCHOVER_STATUS FROM V$DATABASE;

--强制关闭所有session,switch to PHYSICAL STANDBY
ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY with session shutdown;
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;

alter database recover managed standby database disconnect from session;
 
2.standby
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
ALTER DATABASE OPEN;
ALTER SYSTEM SWITCH LOGFILE;
 
 
Failover
1.Identify and resolve any gaps in the archived redo log files.
2.Copy any other missing archived redo log files.
SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;
ALTER DATABASE REGISTER PHYSICAL LOGFILE 'filespec1';

3.Initiate a failover on the target physical standby database.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE;
4.Convert the physical standby database to the primary role.
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;

5.Finish the transition of the standby database to the primary database role.
ALTER DATABASE OPEN;
 
 
primary
=====================================================================
*.DB_UNIQUE_NAME='primary'
*.log_archive_config='DG_CONFIG=(primary,standby)'
*.LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc
*.log_archive_dest_1='location=P:\arc\ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=primary' 
*.LOG_ARCHIVE_DEST_2='SERVICE=standby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=standby'
*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.FAL_SERVER=standby      
*.FAL_CLIENT=primary
*.STANDBY_FILE_MANAGEMENT=AUTO
=====================================================================
 
standby
=====================================================================
*.DB_UNIQUE_NAME='standby'
*.log_archive_config='DG_CONFIG=(primary,standby)'
*.LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc                                              
*.log_archive_dest_1='location=P:\arc\ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=standby' 
*.LOG_ARCHIVE_DEST_2='SERVICE=primary LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=primary' 
*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.FAL_SERVER=primary                               
*.FAL_CLIENT=standby                                               
*.STANDBY_FILE_MANAGEMENT=AUTO
=====================================================================
阅读(1485) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~