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

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>

时间: 2024-08-11 00:28:01

【RAC,DATAGUARD】Creating a physical standby from ASM (RAC ) primary之四的相关文章

【RAC】Creating a filesystem physical standby from ASM (RAC ) primary之一

环境: 版本  11.2.0.1  1   primary :      name: rac      ip: 10.250.7.226     scan ip:10.250.7.200     使用ASM存储数据  2  standby :     name : yangdb     ip :10.250.7.241    使用filesystem 存储数据 在11gr2 版本中,oracle 提供了duplicate from active database 的功能,也就是可以不用备份源数据

【RAC】Creating a filesystem physical standby from ASM (RAC ) primary之三

Starting backup at 11-SEP-11 RMAN-03009: failure of backup command on c1 channel at 09/11/2011 17:48:09 ORA-19505: failed to identify file "/opt/rac/oracle/11.2.0/db/dbs/orapwrac1" ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: N

【RAC】Creating a filesystem physical standby from ASM (RAC ) primary 之二

oracle@rac3:/opt/oracle/11.2.0/yangdb/dbs>rman target sys/yang402@rac  auxiliary / Starting Duplicate Db at 08-SEP-11 released channel: c1 released channel: s1 released channel: s2 RMAN-00571: =========================================================

【DataGuard】ORA-16014 and ORA-00312 Messages in Alert.log of Physical Standby

安装完成dg后,发现alert 之中的有如下错误 ORA-16014: log 4 sequence# 44 not archived, no available destinations ORA-00312: online log 4 thread 1: '/opt/oracle/oradata/orclpdg/redo04.log' Wed Aug 24 22:55:45 2011 Errors in file /opt/oracle/admin/orcl/bdump/orclpdg_arc

Oracle Dataguard如何配置物理standby

尽管网上有很多Oracle Dataguard的配置教程,但不难发现,很多采用的是rman duplicate这种方法,尽管此种方法较为简便.但在某种程度上,却也误导了初学者,虽说也能配置成功,但只知其然不知其所以然,Dataguard的本质没有吃透,也不利于其维护和调优. 本配置文档基于Oracle官方文档,目的在于加深大家对于Dataguard的了解. 本配置的结果是最大性能模式下的异步传输 ,因此在参数文件中,只涉及基本的主备参数,没有考虑switchover和最大性能模式下的real t

Data Guard Physical Standby Switchover

Data Guard Physical Standby Switchover 一.确保主库相关参数文件,设置正确 如下为主数据库相关参数 DB_NAME=pridb DB_UNIQUE_NAME=pridb LOG_ARCHIVE_CONFIG='DG_CONFIG=(pridb,stdb)' CONTROL_FILES='/arch1/chicago/control1.ctl', '/arch2/chicago/control2.ct' LOG_ARCHIVE_DEST_1= 'LOCATIO

Oracle10G Physical Standby Database笔记

oracle|笔记 试验环境primary server:  windows2000 server + oracle 10.0.1.0.2  ORACLE_SID:dgtest  ORACLE_HOME: D:\oracle\product\10.1.0\db_1standby server: windows XP pro + oracle 10.0.1.0.2ORACLE_SID:dgtestORACLE_HOME: D:\oracle\product\10.1.0\db_1   配置步骤首先

Brief description of Oracle physical standby database configuration and manageme

http://lancexu1212.spaces.live.com/ Brief description of Oracle physical standby database configuration and management Configuration of Oracle physical standby database is quite simple,brief steps are as follows: 1.Install Oracle database software an

Brief description of Oracle physical standby database configuration and management

http://lancexu1212.spaces.live.com/ Brief description of Oracle physical standby database configuration and management Configuration of Oracle physical standby database is quite simple,brief steps are as follows: 1.Install Oracle database software an