Step2:配置Oracle Dataguard

接着step1我用Rman duplicate测试下.

1,2两步请参考step1中的1,2

3.startup nomount (standby),一定要是nomount.

4.rman duplicate(primary)

[oracle@dg1 admin]$ rman target /

Recovery Manager: Release 11.2.0.2.0 �C Production on Tue Jul 30 01:16:45 2013

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

connected to target database: DG (DBID=1735397445)

RMAN> connect auxiliary sys/oracle@dg2;

connected to auxiliary database: DG (not mounted)

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

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

contents of Memory Script:
{
  backup as copy reuse
  targetfile  ‘/u01/app/oracle/11.2.0/dbs/orapwprimary’ auxiliary format
’/u01/app/oracle/11.2.0/dbs/orapwstandby’   ;
}
executing Memory Script

Starting backup at 30-JUL-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=74 device type=DISK
Finished backup at 30-JUL-13

contents of Memory Script:
{
  backup as copy current controlfile for standby auxiliary format  ‘/u01/app/oradata/con.ctl’;
}
executing Memory Script

Starting backup at 30-JUL-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/11.2.0/dbs/snapcf_primary.f tag=TAG20130730T011802 RECID=14 STAMP=822100683
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:04
Finished backup at 30-JUL-13

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/app/oradata/temp01.dbf”;
  switch clone tempfile all;
  set newname for datafile  1 to
”/u01/app/oradata/system.dbf”;
  set newname for datafile  2 to
”/u01/app/oradata/sysaux.dbf”;
  set newname for datafile  3 to
”/u01/app/oradata/undotbs1.dbf”;
  backup as copy reuse
  datafile  1 auxiliary format
”/u01/app/oradata/system.dbf”   datafile
2 auxiliary format
”/u01/app/oradata/sysaux.dbf”   datafile
3 auxiliary format
”/u01/app/oradata/undotbs1.dbf”   ;
  sql ‘alter system archive log current’;
}
executing Memory Script

executing command: SET NEWNAME

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

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 30-JUL-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oradata/system.dbf
output file name=/u01/app/oradata/system.dbf tag=TAG20130730T011813
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:56
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oradata/undotbs1.dbf
output file name=/u01/app/oradata/undotbs1.dbf tag=TAG20130730T011813
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oradata/sysaux.dbf
output file name=/u01/app/oradata/sysaux.dbf tag=TAG20130730T011813
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 30-JUL-13

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=14 STAMP=822100753 file name=/u01/app/oradata/system.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=15 STAMP=822100753 file name=/u01/app/oradata/sysaux.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=16 STAMP=822100753 file name=/u01/app/oradata/undotbs1.dbf
ORACLE error from auxiliary database: ORA-19527: physical standby redo log must be renamed
ORA-00312: online log 1 thread 1: ‘/u01/app/oradata/redo1.log’

RMAN-05535: WARNING: All redo log files were not defined properly.
ORACLE error from auxiliary database: ORA-19527: physical standby redo log must be renamed
ORA-00312: online log 2 thread 1: ‘/u01/app/oradata/redo2.log’

RMAN-05535: WARNING: All redo log files were not defined properly.
ORACLE error from auxiliary database: ORA-19527: physical standby redo log must be renamed
ORA-00312: online log 3 thread 1: ‘/u01/app/oradata/redo3.log’

RMAN-05535: WARNING: All redo log files were not defined properly.
Finished Duplicate Db at 30-JUL-13

4.restart standby database.

5.check dg ok

6.但是发现duplicate 有报错信息,这个是因为备库没有配置log_file_name_convert的原因,同样redolog也没有生成.

7.下面我配置一下这个参数

[oracle@dg1 admin]$ rman target /

Recovery Manager: Release 11.2.0.2.0 �C Production on Tue Jul 30 01:34:22 2013

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

connected to target database: DG (DBID=1735397445)

RMAN> connect auxiliary sys/oracle@dg2;

connected to auxiliary database: DG (not mounted)

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

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

contents of Memory Script:
{
  backup as copy reuse
  targetfile  ‘/u01/app/oracle/11.2.0/dbs/orapwprimary’ auxiliary format
’/u01/app/oracle/11.2.0/dbs/orapwstandby’   ;
}
executing Memory Script

Starting backup at 30-JUL-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=64 device type=DISK
Finished backup at 30-JUL-13

contents of Memory Script:
{
  backup as copy current controlfile for standby auxiliary format  ‘/u01/app/oradata/con.ctl’;
}
executing Memory Script

Starting backup at 30-JUL-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/11.2.0/dbs/snapcf_primary.f tag=TAG20130730T013453 RECID=15 STAMP=822101695
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 30-JUL-13

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/app/oradata/temp01.dbf”;
  switch clone tempfile all;
  set newname for datafile  1 to
”/u01/app/oradata/system.dbf”;
  set newname for datafile  2 to
”/u01/app/oradata/sysaux.dbf”;
  set newname for datafile  3 to
”/u01/app/oradata/undotbs1.dbf”;
  backup as copy reuse
  datafile  1 auxiliary format
”/u01/app/oradata/system.dbf”   datafile
2 auxiliary format
”/u01/app/oradata/sysaux.dbf”   datafile
3 auxiliary format
”/u01/app/oradata/undotbs1.dbf”   ;
  sql ‘alter system archive log current’;
}
executing Memory Script

executing command: SET NEWNAME

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

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 30-JUL-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oradata/system.dbf
output file name=/u01/app/oradata/system.dbf tag=TAG20130730T013503
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:56
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oradata/undotbs1.dbf
output file name=/u01/app/oradata/undotbs1.dbf tag=TAG20130730T013503
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oradata/sysaux.dbf
output file name=/u01/app/oradata/sysaux.dbf tag=TAG20130730T013503
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:16
Finished backup at 30-JUL-13

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=15 STAMP=822101762 file name=/u01/app/oradata/system.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=16 STAMP=822101762 file name=/u01/app/oradata/sysaux.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=17 STAMP=822101762 file name=/u01/app/oradata/undotbs1.dbf
Finished Duplicate Db at 30-JUL-13

RMAN>

可以看到上面没有报错,而且redolog也产生啦

[root@dg2 oradata]# ls
con.ctl  sysaux.dbf  system.dbf  undotbs1.dbf
[root@dg2 oradata]# ls
con.ctl  sysaux.dbf  system.dbf  undotbs1.dbf
[root@dg2 oradata]# ls
con.ctl  redo1.log  redo2.log  redo3.log  sysaux.dbf  system.dbf  undotbs1.dbf
[root@dg2 oradata]# ls
con.ctl  redo1.log  redo2.log  redo3.log  sysaux.dbf  system.dbf  undotbs1.dbf

8.看来还是duplicate简单的很多.接下来我会继续测试先做rman备份然后在去配置init parameter.


你可能感兴趣的:(oracle,dataguard,Step2)