ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 如何快速同步standby DB with rman

如何快速同步standby DB with rman

原创 Linux操作系统 作者:yanggq 时间:2019-04-28 18:36:05 0 删除 编辑

This document covers the steps needed to be apply an incremental RMAN backup to a standby database. This document is intended for oracle 10g databases only.  

1               Standby Roll Forward using RMAN

1.1        Primary  Incremental RMAN backup

Standby Server

  1. Get the current scn from the standby database
    1. select to_char(current_scn) as current_scn from v$database;
    2. record the current_scn you get from the query

 

Primary Server

  1. Update the RMAN command file with the current scn. Results of step 1

run {

                  allocate channel dev_0 device type disk;

                  allocate channel dev_1 device type disk;

                  allocate channel dev_2 device type disk;

                  allocate channel dev_3 device type disk;

                  allocate channel dev_4 device type disk;

                  allocate channel dev_5 device type disk;

                  allocate channel dev_6 device type disk;

                  allocate channel dev_7 device type disk;

                  backup as compressed  backupset incremental from SCN 17666478173 database

                  format='/u01/app/oracle/reorg//%d_standby_scn_%s_%p.dbf'

                  include current controlfile for standby

                  filesperset=5;

   }

  1. After the command file has been updated
    1. Export the Oracle_SID= EMREP
    2. run the rman backup using nohup
    3. nohup rman target / catalog rman/password@HOURC1P cmdfile standby_refresh.cmd log EMREP_scn.log&

       

  1. Sftp the incremental backup over to the standby server we should be using the reorg directory for this.

1.2        Apply RMAN Incremental to  Standby Database

 

Standby Server

  1. Export ORACLE_SID=EMREPS
  2. sqlplus / as sysdba
  3. If the standby is down
    1. startup nomount
    2. Alter database mount standby database;
    3. exit;
  4. Rman target / nocatalog ;
  5. RMAN>Catalog start with ‘/u01/app/oracle/reorg//’;
  6. run {

allocate channel dsk0 type disk;

allocate channel dsk1 type disk;

allocate channel dsk2 type disk;

allocate channel dsk3 type disk;

allocate channel dsk4 type disk;

allocate channel dsk5 type disk;

allocate channel dsk6 type disk;

allocate channel dsk7 type disk;

restore standby controlfile to '/u01/app/oracle/reorg//standby_.ctl’;

recover database noredo;

}

 

7.      Shutdown the standby database

a.      Blackout the standby in EM GridControl

b.      Sqlplus / as sysdba

c.      shutdown immediate;

8.     cp the new standby controlfile standby_.ctl to the standby controlfile locations.

cp standby_EMREPS.ctl /u02/origlog/EMREPS/ctrlEMREP1.ctl

cp standby_EMREPS.ctl /u03/mirrlog/EMREPS/ctrlEMREP2.ctl

cp standby_EMREPS.ctl /u04/app/oracle/flash_recovery/EMREPS/ctrlEMREP3.ctl

 

9.      Start the standby, check the scn, start recovery   

a.      Sqlplus / as sysdba

b.      Startup nomount

c.      Alter database mount standby database;

    1. select to_char(current_scn) as current_scn from v$database;
    2. compare this scn to the one from step 1 the scn should be higher
    3. SCN Before incremental 17666478173  and SCN after incremental 18145671751

d.      Alter database recover managed standby database disconnect from session;

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26706/viewspace-434668/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2002-10-29

  • 博文量
    78
  • 访问量
    52272