扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
来源:IT认证考试 2010年9月24日
关键字:
在本页阅读全文(共9页)
Edit or add the following parameters:
*.db_name=’pcard’
*.DB_UNIQUE_NAME=’pcard’
*.log_archive_config=’DG_CONFIG=(pcard,pcarddg)’
*.log_archive_dest_1=’LOCATION=+FLASHDG/pcard/arch/ VALID_FOR=(ALL_LOGFILES, ALL_ROLES) DB_UNIQUE_NAME=pcard’
*.log_archive_dest_2=’SERVICE=pcarddg VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=pcarddg’
*.log_archive_dest_state_1=’ENABLE’
*.log_archive_dest_state_2=’ENABLE’
*.remote_login_passwordfile=’exclusive’
# Add the following parameters for switchover
*.FAL_CLIENT=’pcard’
*.FAL_SERVER=’pcarddg’
*.DB_FILE_NAME_CONVERT=’/oracle/oradata/pcard’,‘+DATADG/PCARD’
*.LOG_FILE_NAME_CONVERT=’/oracle/oradata/pcard/onlinelog’,’+DATADG/PCARD/ONLINELOG’
*.STANDBY_ARCHIVE_DEST=’+FLASHDG/pcard/arch/’
*.STANDBY_FILE_MANAGEMENT=’AUTO’
SQL》 shutdown immediate
SQL》 startup pfile=’/oracle/product/10.2.0/db_1/dbs/ initpcard1.ora ‘;
SQL》 create spfile =’ +FLASHDG/pcard/spfilepcard.ora ‘ from pfile;
Standby Side: Edit pfile copied from RAC01, and Create spfile from pfile
Copy the above pfile (initpcard1.ora) to Standby (/oracle/product/10.2.0/db_1/dbs/pfilestandby.ora), edit or add the following parameters:
*.db_name=’pcard’
*.DB_UNIQUE_NAME=pcarddg
*.LOG_ARCHIVE_CONFIG=’DG_CONFIG=(pcard,pcarddg)’
*.LOG_ARCHIVE_DEST_1=’LOCATION=/oracle/oradata/pcard/arch/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=pcarddg’
*.LOG_ARCHIVE_DEST_2=’SERVICE=pcard VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=pcard’
*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
# Add the following parameters for switchover
*.FAL_SERVER=pcard
*.FAL_CLIENT=pcarddg
*.STANDBY_ARCHIVE_DEST=’/oracle/oradata/pcard/arch’
*.STANDBY_FILE_MANAGEMENT=’AUTO’
*.DB_FILE_NAME_CONVERT=’+DATADG/PCARD/’,‘/oracle/oradata/pcard/’
*.LOG_FILE_NAME_CONVERT=’+DATADG/PCARD/ONLINELOG’,’/oracle/oradata/pcard/onlinelog’
export ORACLE_SID=pcarddg
startup nomount pfile=’/oracle/product/10.2.0/db_1/dbs/pfilestandby.ora’
create spfile=’/oracle/product/10.2.0/db_1/dbs/spfilepcarddg.ora’ from pfile=’/oracle/product/10.2.0/db_1/dbs/pfilestandby.ora’;
[oracle@standby admin]$ orapwd file=/oracle/product/10.2.0/db_1/dbs/orapwpcarddg password=nhy67ujm entries=30 force=y
[oracle@standby admin]$ lsnrctl start
[oracle@standby admin]$ rman target sys/nhy67ujm@pcard1 auxiliary sys/nhy67ujm@pcarddg catalog=rmanusr/rman@rmanuat
RMAN》 copy current controlfile for standby to ‘/oracle/oradata/control01.ctl’;
copy control01.ctl from RAC01 to standby /oracle/oradata/pcard
RMAN》 duplicate target database for standby dorecover;
Then the standby DB will be mounted automatically.
SQL》 alter database recover managed standby database disconnect from session;
Then the standby DB will receive the archived log from RAC01.
Please note: standby DB can only startup mount under most of situation, so we startup standby db into mount every time and execute “alter database recover managed standby database disconnect from session” so that standby db can receive the primary archived redo logs.
Check the status of standby DB:
RAC01 Side:
alter system switch logfile;
select max(sequence#) from v$log_history;
MAX(SEQUENCE#)
————–
84
Standby Side:
select max(sequence#) from v$log_history;
MAX(SEQUENCE#)
————–
84
It is same as rac01 side. So the standby db is configured successfully.
Switchover primary to standby
rac01:
SQL》 select database_role,switchover_status from v$database;
DATABASE_ROLE SWITCHOVER_STATUS
—————- ——————–
PHYSICAL STANDBY SESSIONS ACTIVE
或者DGMGRL》 SWITCHOVER TO xx
standby:
SQL》 select database_role,switchover_status from v$database;
DATABASE_ROLE SWITCHOVER_STATUS
—————- ——————–
PHYSICAL STANDBY SESSIONS ACTIVE
rac01:
SQL》 alter database commit to switchover to physical standby with session shutdown;
SQL》 shutdown immediate
standby:
SQL》 select database_role,switchover_status from v$database;
DATABASE_ROLE SWITCHOVER_STATUS
—————- ——————–
PHYSICAL STANDBY TO PRIMARY
SQL》 alter database commit to switchover to physical primary with session shutdown;
SQL》 shutdown immediate
SQL》 startup
SQL》 select database_role,switchover_status from v$database;
DATABASE_ROLE SWITCHOVER_STATUS
—————- ——————–
PRIMARY SESSIONS ACTIVE
rac01:
SQL》 startup mount
SQL》 alter database recover managed standby database disconnect from session;
SQL》 select database_role,switchover_status from v$database;
DATABASE_ROLE SWITCHOVER_STATUS
—————- ——————–
PHYSICAL STANDBY SESSIONS ACTIVE
It is proved that the switchover is executed successfully.
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者