关于oracle的物理dg,oracle 之物理DG 创造

[oracle@dg-one ~]$ rman target sys/root@dg1 auxiliary sys/root@dg2

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Apr 16 04:25:10 2014

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

connected to target database: DG (DBID=1756848898)

connected to auxiliary database: DG (not mounted)

RMAN> run{

2>  allocate channel ch1 type disk;

3>  allocate channel ch2 type disk;

4>  allocate channel ch3 type disk;

5>  allocate channel ch4 type disk;

6>  allocate channel ch5 type disk;

7>  allocate channel ch6 type disk;

8>  allocate channel ch7 type disk;

9>  allocate auxiliary channel ch8 type disk;

10>  duplicate target database for standby from active database nofilenamecheck

11>  spfile

12>    parameter_value_convert 'dg1','dg2'

13>    set db_unique_name='dg2'

14>    set db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'

15>    set DB_RECOVERY_FILE_DEST_SIZE='4G'

16>    set control_files='/u01/app/oracle/oradata/dg/control01.ctl'

17>    set db_create_file_dest='/u01/app/oracle/oradata/dg'

18>    set db_create_online_log_dest_1='/u01/app/oracle/oradata/dg'

19>    set log_archive_max_processes='5'

20>    set fal_client='dg2'

21>    set fal_server='dg1'

22>    set standby_file_management='AUTO'

23>    set log_archive_config='dg_config=(dg1,dg2)'

24>    set log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles)'

25>    set log_archive_dest_2='service=dg1 lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=dg1';

26>     sql channel ch6 "alter system set log_archive_max_processes=5";

27>     sql channel ch7 "alter system set fal_client=dg1";

28>     sql channel ch7 "alter system set fal_server=dg2";

29>     sql channel ch5 "alter system set standby_file_management=AUTO";

30>     sql channel ch6 "alter system set log_archive_config=''dg_config=(dg1,dg2)''";

31>     sql channel ch7 "alter system set log_archive_dest_2=''service=dg2 lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=dg2''";

32>     sql channel ch6 "alter system set log_archive_dest_1=''location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles)''";

33>     sql channel ch1 "alter system archive log current";

34>     sql channel ch8 "alter database recover managed standby database using current logfile disconnect from session";

35>  release channel ch1;

36>  release channel ch2;

37>  release channel ch3;

38>  release channel ch4;

39>  release channel ch5;

40>  release channel ch6;

41>  release channel ch7;

42>  release channel ch8;

43> }

using target database control file instead of recovery catalog

allocated channel: ch1

channel ch1: SID=48 device type=DISK

allocated channel: ch2

channel ch2: SID=44 device type=DISK

allocated channel: ch3

channel ch3: SID=47 device type=DISK

allocated channel: ch4

channel ch4: SID=46 device type=DISK

allocated channel: ch5

channel ch5: SID=45 device type=DISK

allocated channel: ch6

channel ch6: SID=39 device type=DISK

allocated channel: ch7

channel ch7: SID=35 device type=DISK

allocated channel: ch8

channel ch8: SID=20 device type=DISK

Starting Duplicate Db at 16-APR-14

contents of Memory Script:

{

backup as copy reuse

targetfile  '/u01/app/oracle/product/11.2.0/db_1/dbs/orapwdg1' auxiliary format

'/u01/app/oracle/product/11.2.0/db_1/dbs/orapwdg2'   targetfile

'/u01/app/oracle/product/11.2.0/db_1/dbs/spfiledg1.ora' auxiliary format

'/u01/app/oracle/product/11.2.0/db_1/dbs/spfiledg2.ora'   ;

sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/db_1/dbs/spfiledg2.ora''";

}

executing Memory Script

Starting backup at 16-APR-14

Finished backup at 16-APR-14

sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.0/db_1/dbs/spfiledg2.ora''

contents of Memory Script:

{

sql clone "alter system set  core_dump_dest =

''/u01/app/oracle/diag/rdbms/dg/dg2/cdump'' comment=

'''' scope=spfile";

sql clone "alter system set  db_unique_name =

''dg2'' comment=

'''' scope=spfile";

sql clone "alter system set  db_recovery_file_dest =

''/u01/app/oracle/fast_recovery_area'' comment=

'''' scope=spfile";

sql clone "alter system set  DB_RECOVERY_FILE_DEST_SIZE =

4G comment=

'''' scope=spfile";

sql clone "alter system set  control_files =

''/u01/app/oracle/oradata/dg/control01.ctl'' comment=

'''' scope=spfile";

sql clone "alter system set  db_create_file_dest =

''/u01/app/oracle/oradata/dg'' comment=

'''' scope=spfile";

sql clone "alter system set  db_create_online_log_dest_1 =

''/u01/app/oracle/oradata/dg'' comment=

'''' scope=spfile";

sql clone "alter system set  log_archive_max_processes =

5 comment=

'''' scope=spfile";

sql clone "alter system set  fal_client =

''dg2'' comment=

'''' scope=spfile";

sql clone "alter system set  fal_server =

''dg1'' 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=(dg1,dg2)'' comment=

'''' scope=spfile";

sql clone "alter system set  log_archive_dest_1 =

''location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles)'' comment=

'''' scope=spfile";

sql clone "alter system set  log_archive_dest_2 =

''service=dg1 lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=dg1'' comment=

'''' scope=spfile";

shutdown clone immediate;

startup clone nomount;

}

executing Memory Script

sql statement: alter system set  core_dump_dest =  ''/u01/app/oracle/diag/rdbms/dg/dg2/cdump'' comment= '''' scope=spfile

sql statement: alter system set  db_unique_name =  ''dg2'' comment= '''' scope=spfile

sql statement: alter system set  db_recovery_file_dest =  ''/u01/app/oracle/fast_recovery_area'' comment= '''' scope=spfile

sql statement: alter system set  DB_RECOVERY_FILE_DEST_SIZE =  4G comment= '''' scope=spfile

sql statement: alter system set  control_files =  ''/u01/app/oracle/oradata/dg/control01.ctl'' comment= '''' scope=spfile

sql statement: alter system set  db_create_file_dest =  ''/u01/app/oracle/oradata/dg'' comment= '''' scope=spfile

sql statement: alter system set  db_create_online_log_dest_1 =  ''/u01/app/oracle/oradata/dg'' comment= '''' scope=spfile

sql statement: alter system set  log_archive_max_processes =  5 comment= '''' scope=spfile

sql statement: alter system set  fal_client =  ''dg2'' comment= '''' scope=spfile

sql statement: alter system set  fal_server =  ''dg1'' 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=(dg1,dg2)'' comment= '''' scope=spfile

sql statement: alter system set  log_archive_dest_1 =  ''location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles)'' comment= '''' scope=spfile

sql statement: alter system set  log_archive_dest_2 =  ''service=dg1 lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=dg1'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)

Oracle instance started

Total System Global Area     313159680 bytes

Fixed Size                     2252824 bytes

Variable Size                171970536 bytes

Database Buffers             134217728 bytes

Redo Buffers                   4718592 bytes

allocated channel: ch8

channel ch8: SID=19 device type=DISK

contents of Memory Script:

{

backup as copy current controlfile for standby auxiliary format  '/u01/app/oracle/oradata/dg/control01.ctl';

}

executing Memory Script

Starting backup at 16-APR-14

channel ch1: starting datafile copy

copying standby control file

output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_dg1.f tag=TAG20140416T042545 RECID=19 STAMP=845007946

channel ch1: datafile copy complete, elapsed time: 00:00:03

Finished backup at 16-APR-14

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 clone tempfile  1 to new;

switch clone tempfile all;

set newname for clone datafile  1 to new;

set newname for clone datafile  2 to new;

set newname for clone datafile  3 to new;

set newname for clone datafile  4 to new;

backup as copy reuse

datafile  1 auxiliary format new

datafile  2 auxiliary format new

datafile  3 auxiliary format new

datafile  4 auxiliary format new

;

sql 'alter system archive log current';

}

executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_temp_%u_.tmp in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 16-APR-14

channel ch1: starting datafile copy

input datafile file number=00001 name=/u01/app/oracle/oradata/dg/system01.dbf

channel ch2: starting datafile copy

input datafile file number=00002 name=/u01/app/oracle/oradata/dg/sysaux01.dbf

channel ch3: starting datafile copy

input datafile file number=00003 name=/u01/app/oracle/oradata/dg/undotbs01.dbf

channel ch4: starting datafile copy

input datafile file number=00004 name=/u01/app/oracle/oradata/dg/users01.dbf

output file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_users_2ap5rj2m_.dbf tag=TAG20140416T042557

channel ch4: datafile copy complete, elapsed time: 00:00:07

output file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_undotbs1_29p5rj2m_.dbf tag=TAG20140416T042557

channel ch3: datafile copy complete, elapsed time: 00:00:45

output file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_sysaux_28p5rj2m_.dbf tag=TAG20140416T042557

channel ch2: datafile copy complete, elapsed time: 00:02:36

output file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_system_27p5rj2m_.dbf tag=TAG20140416T042557

channel ch1: datafile copy complete, elapsed time: 00:03:16

Finished backup at 16-APR-14

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=19 STAMP=845008154 file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_system_27p5rj2m_.dbf

datafile 2 switched to datafile copy

input datafile copy RECID=20 STAMP=845008154 file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_sysaux_28p5rj2m_.dbf

datafile 3 switched to datafile copy

input datafile copy RECID=21 STAMP=845008154 file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_undotbs1_29p5rj2m_.dbf

datafile 4 switched to datafile copy

input datafile copy RECID=22 STAMP=845008154 file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_users_2ap5rj2m_.dbf

Finished Duplicate Db at 16-APR-14

sql statement: alter system set log_archive_max_processes=5

sql statement: alter system set fal_client=dg1

sql statement: alter system set fal_server=dg2

sql statement: alter system set standby_file_management=AUTO

sql statement: alter system set log_archive_config=''dg_config=(dg1,dg2)''

sql statement: alter system set log_archive_dest_2=''service=dg2 lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=dg2''

sql statement: alter system set log_archive_dest_1=''location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles)''

sql statement: alter system archive log current

sql statement: alter database recover managed standby database using current logfile disconnect from session

released channel: ch1

released channel: ch2

released channel: ch3

released channel: ch4

released channel: ch5

released channel: ch6

released channel: ch7

released channel: ch8

RMAN>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值