ITPub博客

首页 > Linux操作系统 > Linux操作系统 > PDG

PDG

原创 Linux操作系统 作者:mambo_shen 时间:2009-07-29 17:34:41 0 删除 编辑
##################################  on primary db  ######################################
[oracle@hzdevdb1 dbs]$ ll $oracle_home/dbs/orapwcfgdb
-rw-r-----  1 oracle dba 1536 jul 13 06:27 /home/oracle/orabase/orahome1/dbs/orapwcfgdb
sql> archive log list;
sql> alter database force logging;
sql> alter database add standby logfile group  4  size 50 m;
sql> alter database add standby logfile group  5  size 50 m;
sql> alter database add standby logfile group  6  size 50 m;
sql> alter database add standby logfile group  7  size 50 m;
sql> select * from v$standby_log;
rman>backup database include current controlfile for standby plus archivelog;
$ scp -r 2009_07_27 hzdevdb2:/home/oracle/orabase/flash_recovery_area/cfgdb/backupset/
sql> alter system set log_archive_config='dg_config=(cfgdb,mcfgdb)' ;
sql> alter system set log_archive_dest_2='service=dev2cfgdb lgwr async valid_for=(online_logfiles,primary_role)  db_unique_name=mcfgdb';
sql> alter system set fal_server='dev2cfgdb';
sql> alter system set fal_client='devcfgdb';
sql> alter system set standby_file_management=auto;
sql> alter system set log_archive_max_processes=5;
sql> alter system switch logfile;
sql> archive log list;
        oldest online log sequence      107
        next log sequence to archive   109
        current log sequence              109
 
##################################  on backup db  ########################################
$ export oracle_sid=cfgdb
$ rman target /
rman> set dbid 359504372
rman> startup nomount;
rman> restore spfile from '/home/oracle/orabase/flash_recovery_area/cfgdb/backupset/2009_07_27/o1_mf_ncsnf_tag20090727t101906_56tzsbnv_.bkp';
rman> startup force nomount;
$ rman target sys/mambo@devcfgdb auxiliary /
rman> duplicate target database for standby;
sql>startup force mount;
sql> alter system set db_unique_name='mcfgdb' scope=spfile;
sql> alter system set service_names='cfgdb.mambo.com' scope=spfile;
sql> alter system set log_archive_config='dg_config=(cfgdb,mcfgdb)' ;
sql> alter system set log_archive_dest_2='service=devcfgdb lgwr async valid_for=(online_logfiles,primary_role)  db_unique_name=cfgdb';
sql> alter system set fal_server='devcfgdb';
sql> alter system set fal_client='dev2cfgdb';
sql> alter system set standby_file_management=auto;
sql> alter system set log_archive_max_processes=5;
sql> startup force mount;
sql> alter database recover managed standby database disconnect from session;
sql> archive log list;
       oldest online log sequence     109
       next log sequence to archive    0
       current log sequence             109

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

上一篇: RMAN cases
下一篇: DG tips
请登录后发表评论 登录
全部评论

注册时间:2008-10-09

  • 博文量
    86
  • 访问量
    73773