Chinaunix首页 | 论坛 | 博客
  • 博客访问: 107071
  • 博文数量: 38
  • 博客积分: 506
  • 博客等级: 下士
  • 技术积分: 405
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-03 10:46
文章分类
文章存档

2014年(6)

2013年(10)

2012年(22)

我的朋友

分类: Oracle

2013-11-28 10:27:55

1、創建TNSNAME
2、copy spfile 密碼文件  注意:更改db_unique_name
3、startup nomount 
4、change pro and sty

生产DB

--alter system set LOG_ARCHIVE_DEST_1='LOCATION=/data1/arch_log' scope=both;
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(tjnonhp,sty_nonhp)' scope=both;
alter system set LOG_ARCHIVE_DEST_2='SERVICE=STY_TJNONHPDB  LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=sty_nonhp' scope=both;
ALTER SYSTEM SET fal_client='pro_tjnonhpdb' SCOPE=BOTH;
ALTER SYSTEM SET fal_server='sty_tjnonhpdb' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_state_2='DEFER' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;

connect target sys/sys_tjnonhpdb@pro_tjnonhpdb
connect auxiliary sys/sys_tjnonhpdb@sty_tjnonhpdb


duplicate target database for standby from active database nofilenamecheck;

备份DB

alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(tjnonhp,sty_nonhp)' scope=both;
alter system set LOG_ARCHIVE_DEST_2='SERVICE=PRO_TJNONHPDB  LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=tjnonhp' scope=both;
ALTER SYSTEM SET fal_client='sty_tjnonhpdb' SCOPE=BOTH;
ALTER SYSTEM SET fal_server='pro_tjnonhpdb' SCOPE=BOTH;
alter system set LOG_ARCHIVE_MAX_PROCESSES=10 scope=both;
alter system set STANDBY_FILE_MANAGEMENT=AUTO scope=both;

备份DB
alter database recover managed standby database disconnect from session;


----------------------------------------------------------------------------

the last is consultation

standby 需要添加的參數
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
LOG_ARCHIVE_MAX_PROCESSES=10
STANDBY_FILE_MANAGEMENT=AUTO
STANDBY_ARCHIVE_DEST='/data/oradata/arch_psfc' ---11g取消該參數
FAL_SERVER=HZPSFC
FAL_CLIENT=sty_HZPSFC
LOG_ARCHIVE_CONFIG='DG_CONFIG=(hzpsfc,sty_psfc)'
LOG_ARCHIVE_DEST_2='SERVICE=sty_tjnvdb LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=sty_tjnv'
db_unique_name=sty_psfc

su - oracle -c 'lsnrctl start listener'
su - oracle -c "/home/oracle/product/11.2.3/db_1/bin/sqlplus /nolog < connect sys/oracle@sty_msd2agile as sysdba;
startup mount;
alter database open read only;
alter database recover managed standby database disconnect from session;
exit
EOF"


阅读(1349) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~