Oracle11g 开始,创建DG更便捷了,有木有?

本文介绍如何使用Oracle 11g RMAN工具在线创建Data Guard备用数据库,并记录了整个过程中的关键步骤,包括无需全库热备、手动打开日志应用等注意事项。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

从11g 开始主库不需要先做一次全库热备,加上from active database参数就可以实现在线创建DG,又强大了一步,有木有? 

稍微注意几点:

1.如果要启用实时应用,务必先在primary端创建好standby redo log,这一步容易忘记。当然所后补上也无大碍。

2.本创建过程结束后,需要手动打开日志应用。

3.无意中没有配置log_archive_dest_2, 发现创建过程没有依赖primary归档路径。

4.完全不依赖primary中针对DG设置的参数,也就是说,即使没有设置DG相关参数,该创建过程也会成功。

5.standby 可以open后 (自动会以readonly打开),然后再启动实时应用。此时open_mode为READ ONLY WITH APPLY。 即11g的 “ACTIVE DATAGUARD”


弱点也比较明显:在主库体积很大,且与备库网络带宽有限时,duplicate的时间可能会非常长。因为传输过程中是不能压缩的。所以针对大规模场景,采用手动rman备份压缩,再传输,最后手动dulipcate的方式效率相对会高一些。


特此记录:

OS: RedHat 5.8 x64

DB:Oracle11.2.0.3 x64


[oracle@redhat ~]$ rman target / auxiliary sys/oracle@test3_b

Recovery Manager: Release 11.2.0.3.0 - Production on Tue Oct 30 10:32:29 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TEST3 (DBID=915537947)
connected to auxiliary database (not started)

RMAN> duplicate target database for standby nofilenamecheck from active database;

Starting Duplicate Db at 30-OCT-12
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwtest3' auxiliary format
 '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwtest3'   ;
}
executing Memory Script

Starting backup at 30-OCT-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 device type=DISK
Finished backup at 30-OCT-12

contents of Memory Script:
{
   backup as copy current controlfile for standby auxiliary format  '/u02/test3/control01.ctl';
   restore clone controlfile to  '/u03/test3/control02.ctl' from
 '/u02/test3/control01.ctl';
}
executing Memory Script

Starting backup at 30-OCT-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_test3.f tag=TAG20121030T103323 RECID=3 STAMP=798028407
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 30-OCT-12

Starting restore at 30-OCT-12
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 30-OCT-12

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/oradata/test3/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to
 "/u01/oradata/test3/system01.dbf";
   set newname for datafile  2 to
 "/u01/oradata/test3/undotbs01.dbf";
   set newname for datafile  3 to
 "/u01/oradata/test3/sysaux01.dbf";
   set newname for datafile  4 to
 "/u01/oradata/test3/users01.dbf";
   set newname for datafile  5 to
 "/u01/oradata/test3/example01.dbf";
   backup as copy reuse
   datafile  1 auxiliary format
 "/u01/oradata/test3/system01.dbf"   datafile
 2 auxiliary format
 "/u01/oradata/test3/undotbs01.dbf"   datafile
 3 auxiliary format
 "/u01/oradata/test3/sysaux01.dbf"   datafile
 4 auxiliary format
 "/u01/oradata/test3/users01.dbf"   datafile
 5 auxiliary format
 "/u01/oradata/test3/example01.dbf"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/oradata/test3/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 30-OCT-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/oradata/test3/system01.dbf
output file name=/u01/oradata/test3/system01.dbf tag=TAG20121030T103340
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/oradata/test3/sysaux01.dbf
output file name=/u01/oradata/test3/sysaux01.dbf tag=TAG20121030T103340
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/oradata/test3/undotbs01.dbf
output file name=/u01/oradata/test3/undotbs01.dbf tag=TAG20121030T103340
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/oradata/test3/example01.dbf
output file name=/u01/oradata/test3/example01.dbf tag=TAG20121030T103340
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/oradata/test3/users01.dbf
output file name=/u01/oradata/test3/users01.dbf tag=TAG20121030T103340
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 30-OCT-12

sql statement: alter system archive log current

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=3 STAMP=798028614 file name=/u01/oradata/test3/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=4 STAMP=798028614 file name=/u01/oradata/test3/undotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=5 STAMP=798028614 file name=/u01/oradata/test3/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=6 STAMP=798028614 file name=/u01/oradata/test3/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=7 STAMP=798028614 file name=/u01/oradata/test3/example01.dbf
Finished Duplicate Db at 30-OCT-12

RMAN> quit
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值