【RAC,DATAGUARD】Creating a physical standby from ASM (RAC ) primary之四

楊奇龍發表於2011-09-18
oracle@rac1:/home/oracle>rman target sys/yang402@rac auxiliary sys/yang402@yangdb
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Sep 15 15:46:58 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database: RAC (DBID=2349912968)
connected to auxiliary database: RAC (not mounted)
RMAN> run {
2>    allocate channel c1 type disk connect 'sys/yang402@rac';
3>    allocate channel c2 type disk connect 'sys/yang402@rac';
4>    allocate auxiliary channel s1 type disk ;
5>    allocate auxiliary channel s2 type disk ;
6>    sql channel c1 "alter system archive log current";
7>    duplicate target database for standby from active database 
8>          spfile
9>          set db_name='rac' 
10>          set db_unique_name='yangdb'
11>          set cluster_database='FALSE'
12>          set audit_file_dest='/opt/oracle/admin/yangdb/adump'
13>          set DIAGNOSTIC_DEST='/opt/oracle'
14>          set db_create_file_dest='/opt/oracle/oradata/yangdb'
15>          set db_recovery_file_dest='/opt/oracle/flash_recovery_area'
16>          set control_files='/opt/oracle/oradata/yangdb/control01.ctl','/opt/oracle/oradata/yangdb/control02.ctl','/opt/oracle/oradata/yangdb/control03.ctl'
17>          set undo_tablespace='UNDOTBS1'
18>          set service_names='yangdb'
19>          set standby_file_management='AUTO'
20>          set log_archive_config='DG_CONFIG=(rac,yangdb,alifpre)'
21>          set log_archive_dest_1='LOCATION=/opt/oracle/yangdb_arch'
22>          set log_archive_dest_2='service=rac ARCH ASYNC valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=rac'
23>          set log_archive_dest_state_1='enable'
24>          set log_archive_dest_state_2='enable'
25>          set log_archive_format='yangdb_%t_%s_%r.log'
26>          set remote_login_passwordfile='exclusive'
27>          set LOG_FILE_NAME_CONVERT='+DATA1/rac/onlinelog','/opt/oracle/oradata/yangdb','+DATA2/rac/onlinelog','/opt/oracle/oradata/yangdb'
28>          set DB_FILE_NAME_CONVERT='+DATA2/rac/datafile','/opt/oracle/oradata/yangdb','+DATA2','/opt/oracle/oradata/yangdb'
29>          set remote_listener=''
30>          set fal_client='yangdb'
31>          set fal_server='rac' 
32>          NOFILENAMECHECK;
33>     sql channel c1 "alter system archive log current";
34>  }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=48 instance=rac1 device type=DISK
allocated channel: c2
channel c2: SID=52 instance=rac1 device type=DISK
allocated channel: s1
channel s1: SID=19 device type=DISK
allocated channel: s2
channel s2: SID=20 device type=DISK
sql statement: alter system archive log current
Starting Duplicate Db at 15-SEP-11
contents of Memory Script.:
{
   backup as copy reuse
   targetfile  '/opt/rac/oracle/11.2.0/db/dbs/orapwrac2' auxiliary format 
 '/opt/oracle/11.2.0/alifpre/dbs/orapwyangdb'   targetfile 
 '+DATA2/rac/spfilerac.ora' auxiliary format 
 '/opt/oracle/11.2.0/alifpre/dbs/spfileyangdb.ora'   ;
   sql clone "alter system set spfile= ''/opt/oracle/11.2.0/alifpre/dbs/spfileyangdb.ora''";
}
executing Memory Script
Starting backup at 15-SEP-11
Finished backup at 15-SEP-11
sql statement: alter system set spfile= ''/opt/oracle/11.2.0/alifpre/dbs/spfileyangdb.ora''
contents of Memory Script.:
{
   sql clone "alter system set  db_name =  ''rac'' comment='''' scope=spfile";
   sql clone "alter system set  db_unique_name = ''yangdb'' comment='''' scope=spfile";
   sql clone "alter system set  cluster_database = FALSE comment='''' scope=spfile";
   sql clone "alter system set  audit_file_dest = ''/opt/oracle/admin/yangdb/adump'' comment='''' scope=spfile";
   sql clone "alter system set  DIAGNOSTIC_DEST = ''/opt/oracle'' comment= '''' scope=spfile";
   sql clone "alter system set  db_create_file_dest = ''/opt/oracle/oradata/yangdb'' comment='''' scope=spfile";
   sql clone "alter system set  db_recovery_file_dest = ''/opt/oracle/flash_recovery_area'' comment= '''' scope=spfile";
   sql clone "alter system set  control_files =''/opt/oracle/oradata/yangdb/control01.ctl'', ''/opt/oracle/oradata/yangdb/control02.ctl'', ''/opt/oracle/oradata/yangdb/control03.ctl'' comment= '''' scope=spfile";
   sql clone "alter system set  undo_tablespace=''UNDOTBS1'' comment='''' scope=spfile";
   sql clone "alter system set  service_names =''yangdb'' comment='''' scope=spfile";
   sql clone "alter system set  standby_file_management =''AUTO'' comment='''' scope=spfile";
   sql clone "alter system set  log_archive_config =''DG_CONFIG=(rac,yangdb,alifpre)'' comment='''' scope=spfile";
   sql clone "alter system set  log_archive_dest_1 =''LOCATION=/opt/oracle/yangdb_arch'' comment='''' scope=spfile";
   sql clone "alter system set  log_archive_dest_2 =''service=rac ARCH ASYNC valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=rac'' comment='''' scope=spfile";
   sql clone "alter system set  log_archive_dest_state_1 =''enable'' comment='''' scope=spfile";
   sql clone "alter system set  log_archive_dest_state_2 =''enable'' comment='''' scope=spfile";
   sql clone "alter system set  log_archive_format =''yangdb_%t_%s_%r.log'' comment='''' scope=spfile";
   sql clone "alter system set  remote_login_passwordfile = ''exclusive'' comment='''' scope=spfile";
   sql clone "alter system set  LOG_FILE_NAME_CONVERT =''+DATA1/rac/onlinelog'', ''/opt/oracle/oradata/yangdb'', ''+DATA2/rac/onlinelog'', ''/opt/oracle/oradata/yangdb'' comment='''' scope=spfile";
   sql clone "alter system set  db_file_name_convert =''+DATA2/rac/datafile'', ''/opt/oracle/oradata/yangdb'', ''+DATA2'', ''/opt/oracle/oradata/yangdb'' comment='''' scope=spfile";
   sql clone "alter system set  remote_listener = '''' comment='''' scope=spfile";
   sql clone "alter system set  fal_client = ''yangdb'' comment='''' scope=spfile";
   sql clone "alter system set  fal_server = ''rac'' comment='''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script
sql statement: alter system set  db_name =  ''rac'' comment= '''' scope=spfile
sql statement: alter system set  db_unique_name =  ''yangdb'' comment= '''' scope=spfile
sql statement: alter system set  cluster_database =  FALSE comment= '''' scope=spfile
sql statement: alter system set  audit_file_dest =  ''/opt/oracle/admin/yangdb/adump'' comment= '''' scope=spfile
sql statement: alter system set  DIAGNOSTIC_DEST =  ''/opt/oracle'' comment= '''' scope=spfile
sql statement: alter system set  db_create_file_dest =  ''/opt/oracle/oradata/yangdb'' comment= '''' scope=spfile
sql statement: alter system set  db_recovery_file_dest =  ''/opt/oracle/flash_recovery_area'' comment= '''' scope=spfile
sql statement: alter system set  control_files =  ''/opt/oracle/oradata/yangdb/control01.ctl'', ''/opt/oracle/oradata/yangdb/control02.ctl'', ''/opt/oracle/oradata/yangdb/control03.ctl'' comment= '''' scope=spfile
sql statement: alter system set  undo_tablespace =  ''UNDOTBS1'' comment= '''' scope=spfile
sql statement: alter system set  service_names =  ''yangdb'' comment= '''' scope=spfile
sql statement: alter system set  standby_file_management =  ''AUTO'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_config =  ''DG_CONFIG=(rac,yangdb,alifpre)'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_dest_1 =  ''LOCATION=/opt/oracle/yangdb_arch'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_dest_2 =  ''service=rac ARCH ASYNC valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=rac'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_dest_state_1 =  ''enable'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_dest_state_2 =  ''enable'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_format =  ''yangdb_%t_%s_%r.log'' comment= '''' scope=spfile
sql statement: alter system set  remote_login_passwordfile =  ''exclusive'' comment= '''' scope=spfile
sql statement: alter system set  LOG_FILE_NAME_CONVERT =  ''+DATA1/rac/onlinelog'', ''/opt/oracle/oradata/yangdb'', ''+DATA2/rac/onlinelog'', ''/opt/oracle/oradata/yangdb'' comment= '''' scope=spfile
sql statement: alter system set  db_file_name_convert =  ''+DATA2/rac/datafile'', ''/opt/oracle/oradata/yangdb'', ''+DATA2'', ''/opt/oracle/oradata/yangdb'' comment= '''' scope=spfile
sql statement: alter system set  remote_listener =  '''' comment= '''' scope=spfile
sql statement: alter system set  fal_client =  ''yangdb'' comment= '''' scope=spfile
sql statement: alter system set  fal_server =  ''rac'' comment= '''' scope=spfile
Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    1469792256 bytes

Fixed Size                     2213456 bytes
Variable Size                872417712 bytes
Database Buffers             587202560 bytes
Redo Buffers                   7958528 bytes
allocated channel: s1
channel s1: SID=19 device type=DISK
allocated channel: s2
channel s2: SID=20 device type=DISK

contents of Memory Script.:
{
   backup as copy current controlfile for standby auxiliary format  '/opt/oracle/oradata/yangdb/control01.ctl';
   restore clone controlfile to  '/opt/oracle/oradata/yangdb/control02.ctl' from 
 '/opt/oracle/oradata/yangdb/control01.ctl';
   restore clone controlfile to  '/opt/oracle/oradata/yangdb/control03.ctl' from 
 '/opt/oracle/oradata/yangdb/control01.ctl';
}
executing Memory Script
Starting backup at 15-SEP-11
channel c1: starting datafile copy
copying standby control file
output file name=/opt/rac/oracle/11.2.0/db/dbs/snapcf_rac1.f tag=TAG20110915T154731 RECID=1 STAMP=761932052
channel c1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 15-SEP-11
Starting restore at 15-SEP-11
channel s2: skipped, AUTOBACKUP already found
channel s1: copied control file copy
Finished restore at 15-SEP-11
Starting restore at 15-SEP-11
channel s2: skipped, AUTOBACKUP already found
channel s1: copied control file copy
Finished restore at 15-SEP-11

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 "/opt/oracle/oradata/yangdb/rac/tempfile/temp.268.761930967";
   switch clone tempfile all;
   set newname for datafile  1 to "/opt/oracle/oradata/yangdb/system.261.761930837";
   set newname for datafile  2 to "/opt/oracle/oradata/yangdb/sysaux.265.761930837";
   set newname for datafile  3 to "/opt/oracle/oradata/yangdb/undotbs1.264.761930837";
   set newname for datafile  4 to "/opt/oracle/oradata/yangdb/users.263.761930837";
   set newname for datafile  5 to "/opt/oracle/oradata/yangdb/undotbs2.269.761931099";
   backup as copy reuse
   datafile  1 auxiliary format "/opt/oracle/oradata/yangdb/system.261.761930837"   
   datafile  2 auxiliary format "/opt/oracle/oradata/yangdb/sysaux.265.761930837"   
   datafile  3 auxiliary format "/opt/oracle/oradata/yangdb/undotbs1.264.761930837"   
   datafile  4 auxiliary format "/opt/oracle/oradata/yangdb/users.263.761930837"   
   datafile  5 auxiliary format "/opt/oracle/oradata/yangdb/undotbs2.269.761931099";
   sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /opt/oracle/oradata/yangdb/rac/tempfile/temp.268.761930967 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 15-SEP-11
channel c1: starting datafile copy
input datafile file number=00001 name=+DATA2/rac/datafile/system.261.761930837
channel c2: starting datafile copy
input datafile file number=00002 name=+DATA2/rac/datafile/sysaux.265.761930837
output file name=/opt/oracle/oradata/yangdb/sysaux.265.761930837 tag=TAG20110915T154757
channel c2: datafile copy complete, elapsed time: 00:00:25
channel c2: starting datafile copy
input datafile file number=00003 name=+DATA2/rac/datafile/undotbs1.264.761930837
output file name=/opt/oracle/oradata/yangdb/system.261.761930837 tag=TAG20110915T154757
channel c1: datafile copy complete, elapsed time: 00:00:33
channel c1: starting datafile copy
input datafile file number=00005 name=+DATA2/rac/datafile/undotbs2.269.761931099
output file name=/opt/oracle/oradata/yangdb/undotbs1.264.761930837 tag=TAG20110915T154757
channel c2: datafile copy complete, elapsed time: 00:00:07
channel c2: starting datafile copy
input datafile file number=00004 name=+DATA2/rac/datafile/users.263.761930837
output file name=/opt/oracle/oradata/yangdb/undotbs2.269.761931099 tag=TAG20110915T154757
channel c1: datafile copy complete, elapsed time: 00:00:01
output file name=/opt/oracle/oradata/yangdb/users.263.761930837 tag=TAG20110915T154757
channel c2: datafile copy complete, elapsed time: 00:00:01
Finished backup at 15-SEP-11
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=1 STAMP=761932121 file name=/opt/oracle/oradata/yangdb/system.261.761930837
datafile 2 switched to datafile copy
input datafile copy RECID=2 STAMP=761932121 file name=/opt/oracle/oradata/yangdb/sysaux.265.761930837
datafile 3 switched to datafile copy
input datafile copy RECID=3 STAMP=761932121 file name=/opt/oracle/oradata/yangdb/undotbs1.264.761930837
datafile 4 switched to datafile copy
input datafile copy RECID=4 STAMP=761932121 file name=/opt/oracle/oradata/yangdb/users.263.761930837
datafile 5 switched to datafile copy
input datafile copy RECID=5 STAMP=761932121 file name=/opt/oracle/oradata/yangdb/undotbs2.269.761931099
Finished Duplicate Db at 15-SEP-11
sql statement: alter system archive log current
released channel: c1
released channel: c2
released channel: s1
released channel: s2
RMAN> exit


Recovery Manager complete.
oracle@rac1:/home/oracle>

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-707817/,如需轉載,請註明出處,否則將追究法律責任。

相關文章