Oracle 10G RAC与10G Physical DG 的测试-2

来源:互联网 发布:淘宝可以买凤楼信息吗 编辑:程序博客网 时间:2024/06/07 09:38

接上...
10G RAC与10G Physical DG 的测试-1

6,备份文件集

在主库上备份数据库至/home/oracle并拷贝至备库的同一目录下.
[oracle@vmrac3 admin]$ rman target /
Recovery Manager: Release 10.2.0.5.0 - Production on Fri Jan 13 13:51:43 2012
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
connected to target database: JTPROD (DBID=526369488)
RMAN> backup device type disk format '/home/oracle/%U' database plus archivelog;
Starting backup at 13-JAN-12
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=125 instance=JTPROD1 devtype=DISK
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=61 recid=131 stamp=772466013
input archive log thread=2 sequence=74 recid=132 stamp=772466010
channel ORA_DISK_1: starting piece 1 at 13-JAN-12
channel ORA_DISK_1: finished piece 1 at 13-JAN-12
piece handle=/home/oracle/16n0lpb0_1_1 tag=TAG20120113T135335 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
Finished backup at 13-JAN-12

Starting backup at 13-JAN-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=+DATA/jtprod/system01.dbf
input datafile fno=00003 name=+DATA/jtprod/sysaux01.dbf
input datafile fno=00002 name=+DATA/jtprod/undotbs01.dbf
input datafile fno=00005 name=+DATA/jtprod/undotbs02.dbf
input datafile fno=00004 name=+DATA/jtprod/users01.dbf
channel ORA_DISK_1: starting piece 1 at 13-JAN-12
channel ORA_DISK_1: finished piece 1 at 13-JAN-12
piece handle=/home/oracle/17n0lpba_1_1 tag=TAG20120113T135345 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:15
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 13-JAN-12
channel ORA_DISK_1: finished piece 1 at 13-JAN-12
piece handle=/home/oracle/18n0lpdm_1_1 tag=TAG20120113T135345 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:06
Finished backup at 13-JAN-12

Starting backup at 13-JAN-12
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=62 recid=134 stamp=772466115
input archive log thread=2 sequence=75 recid=133 stamp=772466111
channel ORA_DISK_1: starting piece 1 at 13-JAN-12
channel ORA_DISK_1: finished piece 1 at 13-JAN-12
piece handle=/home/oracle/19n0lpe5_1_1 tag=TAG20120113T135517 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 13-JAN-12

RMAN> backup device type disk format '/home/oracle/%U' current controlfile for standby;

Starting backup at 13-JAN-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including standby control file in backupset
channel ORA_DISK_1: starting piece 1 at 13-JAN-12
channel ORA_DISK_1: finished piece 1 at 13-JAN-12
piece handle=/home/oracle/1an0lphb_1_1 tag=TAG20120113T135659 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:05
Finished backup at 13-JAN-12

7,恢复
该步骤切换到库存放备份集的目录/home/oracle,恢复.
[oracle@vmrac34dg ~]$ set|grep ORACLE_SID
ORACLE_SID=JTPRODSB
[oracle@vmrac34dg ~]$ /u01/app/oracle/product/10.2.0/db_1/bin/rman target sys/amaxgs@JTPROD auxiliary /
Recovery Manager: Release 10.2.0.5.0 - Production on Fri Jan 13 14:16:55 2012
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
connected to target database: JTPROD (DBID=526369488)
connected to auxiliary database: JTPROD (not mounted)


RMAN>  DUPLICATE TARGET DATABASE FOR STANDBY;

Starting Duplicate Db at 13-JAN-12
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=156 devtype=DISK

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

Starting restore at 13-JAN-12
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /home/oracle/1an0lphb_1_1
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/home/oracle/1an0lphb_1_1 tag=TAG20120113T135659
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
output filename=/u01/oradata/control01.ctl
output filename=/u01/oradata/control02.ctl
output filename=/u01/oradata/control03.ctl
Finished restore at 13-JAN-12

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/oradata/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to
 "/u01/oradata/system01.dbf";
   set newname for datafile  2 to
 "/u01/oradata/undotbs01.dbf";
   set newname for datafile  3 to
 "/u01/oradata/sysaux01.dbf";
   set newname for datafile  4 to
 "/u01/oradata/users01.dbf";
   set newname for datafile  5 to
 "/u01/oradata/undotbs02.dbf";
   restore
   check readonly
   clone database
   ;
}
executing Memory Script

executing command: SET NEWNAME

renamed temporary file 1 to /u01/oradata/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 restore at 13-JAN-12
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/oradata/system01.dbf
restoring datafile 00002 to /u01/oradata/undotbs01.dbf
restoring datafile 00003 to /u01/oradata/sysaux01.dbf
restoring datafile 00004 to /u01/oradata/users01.dbf
restoring datafile 00005 to /u01/oradata/undotbs02.dbf
channel ORA_AUX_DISK_1: reading from backup piece /home/oracle/17n0lpba_1_1
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/home/oracle/17n0lpba_1_1 tag=TAG20120113T135345
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:27
Finished restore at 13-JAN-12

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

datafile 1 switched to datafile copy
input datafile copy recid=8 stamp=772467564 filename=/u01/oradata/system01.dbf
datafile 2 switched to datafile copy
input datafile copy recid=9 stamp=772467564 filename=/u01/oradata/undotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=10 stamp=772467564 filename=/u01/oradata/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=11 stamp=772467564 filename=/u01/oradata/users01.dbf
datafile 5 switched to datafile copy
input datafile copy recid=12 stamp=772467564 filename=/u01/oradata/undotbs02.dbf
Finished Duplicate Db at 13-JAN-12

RMAN>

此时主要的配置算基本完成.

8,备库上MRP开启,重启主库新的参数生效.
库:
启动mount SQL>startup database mount standby database;
启动MRP SQL>recover managed standby database disconnect from session;
库:重启实例,使得参数生效.

9,检查RAC节点的alter和DG的alter日志,进行相关的错误解析.

10,注意ASM中db_file_name_convert中的数据文件路径;注意RAC节点能否与DG进行tnsping通讯;密码文件是否能够进行从主备库进行sqlplus访问.

 

10G RAC与10G Physical DG 的测试-1
10G RAC与10G Physical DG 的测试-2
完结