科技行者

行者学院 转型私董会 科技行者专题报道 网红大战科技行者

知识库

知识库 安全导航

至顶网服务器频道虚拟化/云计算通过VMWARE虚拟机搭建Oracle 10g R2 R

通过VMWARE虚拟机搭建Oracle 10g R2 R

  • 扫一扫
    分享文章到微信

  • 扫一扫
    关注官方公众号
    至顶头条

本文讲解了通过VMWARE虚拟机搭建Oracle 10g R2 R的过程。

来源: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领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。

    重磅专题
    往期文章
    最新文章