天天看點

【dataguard】使用deplicate建立異機的dataguard

版本:11gr2  環境:linux

實施dg的方法有很多種,這裡介紹使用oracle提供的deplicate複制功能建立異機的dg的方法。對于備庫安裝和主庫一樣路徑的軟體和資料存放結構。配置參數檔案,監聽檔案,啟動到nomount狀态後,就可以在主庫上使用rman進行建立dg!

一前期準備工作

---對于主庫:

1 開啟歸檔功能

shutdown normal

shutdown immediate

startup mount

alter database archivelog;

alter database open;

--設定歸檔路徑

alter system set log_archive_format = "archive_%t_%s_%r.log" scope=spfile;

alter system set log_archive_dest_1='location=/home/opt/oracle/archive_log';

alter database force logging;

2 拷貝源庫的密碼檔案到備庫主機和主機的一樣的路徑。

3 修改spfile參數檔案。

db_name=yangql

alter system set db_unique_name=yangql scope=spfile;

alter system set log_archive_config='dg_config=(yangql,yangqldg)' scope=both;

alter system set log_archive_dest_1='location=/home/opt/oracle/archive_log' scope=both;

alter system set log_archive_dest_2='service=yangqldg lgwr asyn valid_for=(all_logfiles,primary_roles) db_unique_name=yangqldg' scope=both;

alter system set log_archive_dest_state_1=enable scope=both;

alter system set log_archive_dest_state_2=enable scope=both;

alter system set remote_login_passwordfile=exclusive scope=spfile;

alter system set log_archive_format=%t_%s_%r.arc scope=spfile;

alter system set log_archive_max_processes=30 scope=spfile;

alter system set fal_server=yangqldg scope=both;

alter system set fal_client=yangql scope=both;

alter system set standby_file_management =auto scope=both;

4 修改listener.ora  tnames.ora檔案

---listener.ora

listener =

  (description_list =

    (description =

      (address = (protocol = tcp)(host = pre_publish)(port = 1521))

    )

  )

sid_list_listener =

  (sid_list =

    (sid_desc =

      (global_dbname = yangql)

      (oracle_home = /home/opt/oracle/products/11.2.0)

      (sid_name = yangql)

----tnsnames.ora-----

yangql =

  (description =

    (address_list =

      (address = (protocol = tcp)(host = 172.18.112.230)(port = 1521))

    (connect_data =

      (server = dedicated)

      (service_name = yangql)

yangqldg =

      (address = (protocol = tcp)(host = 172.18.87.199)(port = 1521))

----備庫操作

---備庫的參數檔案yangqldg.ora中關于dg的部分内容----

db_unique_name=yangqldg

log_archive_config='db_config=(yangqldg,yangql)'

log_archive_dest_1='location=/home/opt/oracle/archive_log'

log_archive_dest_2='service=yangql lgwr asyn valid_for=(all_logfiles,primary_roles) db_unique_name=yangql'

log_archive_dest_state_1=enable

log_archive_dest_state_2=enable/defer

remote_login_passwordfile=exclusive

log_archive_format=%t_%s_%r.arc

log_archive_max_processes=30

fal_server=yangqldg

fal_client=yangql

-----listener.ora

      (address = (protocol = tcp)(host = alibank_pre_publish)(port = 1521))

--rman 複制

--啟動備庫到nomount狀态

sqlplus "/as sysdba"

startup nomount pfile='/yangqldg.ora'

--執行duplicate standby 庫

主庫登陸rman,并auxiliary連接配接備庫

recovery manager: release 11.2.0.1.0 - production on tue apr 26 14:42:24 2011

copyright (c) 1982, 2009, oracle and/or its affiliates.  all rights reserved.

connected to target database: yangql (dbid=3584031961)

connected to auxiliary database: yangql (not mounted)

rman> run {

2>  allocate channel c1 type disk;

3>   allocate auxiliary channel s1 type disk;

4>    allocate auxiliary channel s2 type disk;

5>    sql channel c1 "alter system archive log current";

6>    duplicate target database for standby 

7>         from active database

8>         spfile

9>         set db_name='yangql'

10>         set db_unique_name='yangqldg'

11>         set instance_name='yangql'

12>         set audit_file_dest='/home/opt/oracle/admin/yangql/adump'

13>         set log_archive_dest_1='location=/home/opt/oracle/archive_log'

14>         set control_files='/home/opt/oracle/oradata/yangql/control01.ctl','/home/opt/oracle/oradata/yangql/control02.ctl'

15>         set standby_file_management='auto'

16>         set log_archive_config='dg_config=(yangqldg,yangql)'

17>         set log_archive_dest_2='service=yangql lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=yangql'

18>         set log_archive_dest_state_1='enable'

19>         set log_archive_dest_state_2='enable'

20>         set log_archive_format='%t_%s_%r.dbf'

21>         set undo_tablespace='undotbs1'

22>         set log_file_name_convert='/home/opt/oracle/oradata/yangql','/home/opt/oracle/oradata/yangql'

23>         set fal_client='yangqldg'

24>         set fal_server='yangql'

25>         nofilenamecheck; 

26>    sql channel c1 "alter system archive log current";

27> }

using target database control file instead of recovery catalog

allocated channel: c1

channel c1: sid=838 device type=disk

allocated channel: s1

channel s1: sid=91 device type=disk

allocated channel: s2

channel s2: sid=113 device type=disk

sql statement: alter system archive log current

starting duplicate db at 26-apr-11

contents of memory script.:

{

   backup as copy reuse

   targetfile  '/home/opt/oracle/products/11.2.0/dbs/orapwyangql' auxiliary format

 '/home/opt/oracle/products/11.2.0/dbs/orapwyangql'   targetfile

 '/home/opt/oracle/products/11.2.0/dbs/spfileyangql.ora' auxiliary format

 '/home/opt/oracle/products/11.2.0/dbs/spfileyangql.ora'   ;

   sql clone "alter system set spfile= ''/home/opt/oracle/products/11.2.0/dbs/spfileyangql.ora''";

}

executing memory script

starting backup at 26-apr-11

finished backup at 26-apr-11

sql statement: alter system set spfile= ''/home/opt/oracle/products/11.2.0/dbs/spfileyangql.ora''

   sql clone "alter system set  db_name =  ''yangql'' comment= '''' scope=spfile";

   sql clone "alter system set  db_unique_name =  ''yangqldg'' comment= '''' scope=spfile";

   sql clone "alter system set  instance_name =  ''yangql'' comment= '''' scope=spfile";

   sql clone "alter system set  audit_file_dest =  ''/home/opt/oracle/admin/yangql/adump'' comment= '''' scope=spfile";

   sql clone "alter system set  log_archive_dest_1 =  ''location=/home/opt/oracle/archive_log'' comment= '''' scope=spfile";

   sql clone "alter system set  control_files =  ''/home/opt/oracle/oradata/yangql/control01.ctl'', ''/home/opt/oracle/oradata/yangql/control02.ctl'' 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=(yangqldg,yangql)'' comment= '''' scope=spfile";

   sql clone "alter system set  log_archive_dest_2 =  ''service=yangql lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=yangql'' 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 =  ''%t_%s_%r.dbf'' comment= '''' scope=spfile";

   sql clone "alter system set  undo_tablespace =  ''undotbs1'' comment= '''' scope=spfile";

   sql clone "alter system set  log_file_name_convert =  ''/home/opt/oracle/oradata/yangql'', ''/home/opt/oracle/oradata/yangql'' comment= '''' scope=spfile";

   sql clone "alter system set  fal_client =  ''yangqldg'' comment= '''' scope=spfile";

   sql clone "alter system set  fal_server =  ''yangql'' comment= '''' scope=spfile";

   shutdown clone immediate;

   startup clone nomount;

sql statement: alter system set  db_name =  ''yangql'' comment= '''' scope=spfile

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

sql statement: alter system set  instance_name =  ''yangql'' comment= '''' scope=spfile

sql statement: alter system set  audit_file_dest =  ''/home/opt/oracle/admin/yangql/adump'' comment= '''' scope=spfile

sql statement: alter system set  log_archive_dest_1 =  ''location=/home/opt/oracle/archive_log'' comment= '''' scope=spfile

sql statement: alter system set  control_files =  ''/home/opt/oracle/oradata/yangql/control01.ctl'', ''/home/opt/oracle/oradata/yangql/control02.ctl'' 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=(yangqldg,yangql)'' comment= '''' scope=spfile

sql statement: alter system set  log_archive_dest_2 =  ''service=yangql lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=yangql'' 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 =  ''%t_%s_%r.dbf'' comment= '''' scope=spfile

sql statement: alter system set  undo_tablespace =  ''undotbs1'' comment= '''' scope=spfile

sql statement: alter system set  log_file_name_convert =  ''/home/opt/oracle/oradata/yangql'', ''/home/opt/oracle/oradata/yangql'' comment= '''' scope=spfile

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

sql statement: alter system set  fal_server =  ''yangql'' comment= '''' scope=spfile

oracle instance shut down

connected to auxiliary database (not started)

oracle instance started

total system global area    1653518336 bytes

fixed size                     2213896 bytes

variable size                939526136 bytes

database buffers             704643072 bytes

redo buffers                   7135232 bytes

channel s1: sid=958 device type=disk

channel s2: sid=1149 device type=disk

   backup as copy current controlfile for standby auxiliary format  '/home/opt/oracle/oradata/yangql/control01.ctl';

   restore clone controlfile to  '/home/opt/oracle/oradata/yangql/control02.ctl' from

 '/home/opt/oracle/oradata/yangql/control01.ctl';

channel c1: starting datafile copy

copying standby control file

output file name=/home/opt/oracle/products/11.2.0/dbs/snapcf_yangql.f tag=tag20110426t144453 recid=3 stamp=749486694

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

starting restore at 26-apr-11

channel s2: skipped, autobackup already found

channel s1: copied control file copy

finished restore at 26-apr-11

   sql clone 'alter database mount standby database';

sql statement: alter database mount standby database

rman-05538: warning: implicitly using db_file_name_convert

   set newname for tempfile  1 to  "/home/opt/oracle/oradata/yangql/temp01.dbf";

   switch clone tempfile all;

   set newname for datafile  1 to  "/home/opt/oracle/oradata/yangql/system01.dbf";

   set newname for datafile  2 to  "/home/opt/oracle/oradata/yangql/sysaux01.dbf";

   set newname for datafile  3 to  "/home/opt/oracle/oradata/yangql/undotbs01.dbf";

   set newname for datafile  4 to  "/home/opt/oracle/oradata/yangql/users01.dbf";

   set newname for datafile  5 to  "/home/opt/oracle/oradata/yangql/alijr01.dbf";

   set newname for datafile  6 to  "/home/opt/oracle/oradata/yangql/alijr02.dbf";

   set newname for datafile  7 to  "/home/opt/oracle/oradata/yangql/alijr03.dbf";

   set newname for datafile  8 to  "/home/opt/oracle/oradata/yangql/alijr04.dbf";

   set newname for datafile  9 to  "/home/opt/oracle/oradata/yangql/alijr05.dbf";

   set newname for datafile  10 to  "/home/opt/oracle/oradata/yangql/alijr06.dbf";

   set newname for datafile  11 to  "/home/opt/oracle/oradata/yangql/alijr07.dbf";

   set newname for datafile  12 to  "/home/opt/oracle/oradata/yangql/alijr08.dbf";

   set newname for datafile  13 to  "/home/opt/oracle/oradata/yangql/alijr09.dbf";

   set newname for datafile  14 to  "/home/opt/oracle/oradata/yangql/alijr10.dbf";

   set newname for datafile  15 to  "/home/opt/oracle/oradata/yangql/alijr11.dbf";

   set newname for datafile  16 to  "/home/opt/oracle/oradata/yangql/alijr12.dbf";

   set newname for datafile  17 to  "/home/opt/oracle/oradata/yangql/alijr13.dbf";

   set newname for datafile  18 to  "/home/opt/oracle/oradata/yangql/alijr14.dbf";

   set newname for datafile  19 to  "/home/opt/oracle/oradata/yangql/alijr15.dbf";

   set newname for datafile  20 to  "/home/opt/oracle/oradata/yangql/alijr16.dbf";

   set newname for datafile  21 to  "/home/opt/oracle/oradata/yangql/alijr17.dbf";

   set newname for datafile  22 to  "/home/opt/oracle/oradata/yangql/alijr18.dbf";

   set newname for datafile  23 to  "/home/opt/oracle/oradata/yangql/alijr19.dbf";

   datafile

    1 auxiliary format  "/home/opt/oracle/oradata/yangql/system01.dbf"   datafile

 2 auxiliary format  "/home/opt/oracle/oradata/yangql/sysaux01.dbf"   datafile

 3 auxiliary format  "/home/opt/oracle/oradata/yangql/undotbs01.dbf"   datafile

 4 auxiliary format  "/home/opt/oracle/oradata/yangql/users01.dbf"   datafile

 5 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr01.dbf"   datafile

 6 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr02.dbf"   datafile

 7 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr03.dbf"   datafile

 8 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr04.dbf"   datafile

 9 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr05.dbf"   datafile

 10 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr06.dbf"   datafile

 11 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr07.dbf"   datafile

 12 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr08.dbf"   datafile

 13 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr09.dbf"   datafile

 14 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr10.dbf"   datafile

 15 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr11.dbf"   datafile

 16 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr12.dbf"   datafile

 17 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr13.dbf"   datafile

 18 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr14.dbf"   datafile

 19 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr15.dbf"   datafile

 20 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr16.dbf"   datafile

 21 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr17.dbf"   datafile

 22 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr18.dbf"   datafile

 23 auxiliary format  "/home/opt/oracle/oradata/yangql/alijr19.dbf"   ;

   sql 'alter system archive log current';

executing command: set newname

renamed tempfile 1 to /home/opt/oracle/oradata/yangql/temp01.dbf in control file

input datafile file number=00005 name=/home/opt/oracle/oradata/yangql/alijr01.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr01.dbf tag=tag20110426t144511

channel c1: datafile copy complete, elapsed time: 00:01:55

input datafile file number=00006 name=/home/opt/oracle/oradata/yangql/alijr02.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr02.dbf tag=tag20110426t144511

channel c1: datafile copy complete, elapsed time: 00:02:05

input datafile file number=00007 name=/home/opt/oracle/oradata/yangql/alijr03.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr03.dbf tag=tag20110426t144511

channel c1: datafile copy complete, elapsed time: 00:01:45

input datafile file number=00008 name=/home/opt/oracle/oradata/yangql/alijr04.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr04.dbf tag=tag20110426t144511

channel c1: datafile copy complete, elapsed time: 00:01:35

input datafile file number=00009 name=/home/opt/oracle/oradata/yangql/alijr05.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr05.dbf tag=tag20110426t144511

input datafile file number=00010 name=/home/opt/oracle/oradata/yangql/alijr06.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr06.dbf tag=tag20110426t144511

input datafile file number=00011 name=/home/opt/oracle/oradata/yangql/alijr07.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr07.dbf tag=tag20110426t144511

input datafile file number=00012 name=/home/opt/oracle/oradata/yangql/alijr08.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr08.dbf tag=tag20110426t144511

input datafile file number=00013 name=/home/opt/oracle/oradata/yangql/alijr09.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr09.dbf tag=tag20110426t144511

input datafile file number=00014 name=/home/opt/oracle/oradata/yangql/alijr10.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr10.dbf tag=tag20110426t144511

input datafile file number=00015 name=/home/opt/oracle/oradata/yangql/alijr11.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr11.dbf tag=tag20110426t144511

input datafile file number=00016 name=/home/opt/oracle/oradata/yangql/alijr12.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr12.dbf tag=tag20110426t144511

input datafile file number=00017 name=/home/opt/oracle/oradata/yangql/alijr13.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr13.dbf tag=tag20110426t144511

input datafile file number=00018 name=/home/opt/oracle/oradata/yangql/alijr14.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr14.dbf tag=tag20110426t144511

channel c1: datafile copy complete, elapsed time: 00:01:41

input datafile file number=00019 name=/home/opt/oracle/oradata/yangql/alijr15.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr15.dbf tag=tag20110426t144511

channel c1: datafile copy complete, elapsed time: 00:02:35

input datafile file number=00020 name=/home/opt/oracle/oradata/yangql/alijr16.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr16.dbf tag=tag20110426t144511

input datafile file number=00021 name=/home/opt/oracle/oradata/yangql/alijr17.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr17.dbf tag=tag20110426t144511

channel c1: datafile copy complete, elapsed time: 00:02:00

input datafile file number=00022 name=/home/opt/oracle/oradata/yangql/alijr18.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr18.dbf tag=tag20110426t144511

channel c1: datafile copy complete, elapsed time: 00:01:44

input datafile file number=00023 name=/home/opt/oracle/oradata/yangql/alijr19.dbf

output file name=/home/opt/oracle/oradata/yangql/alijr19.dbf tag=tag20110426t144511

input datafile file number=00003 name=/home/opt/oracle/oradata/yangql/undotbs01.dbf

output file name=/home/opt/oracle/oradata/yangql/undotbs01.dbf tag=tag20110426t144511

channel c1: datafile copy complete, elapsed time: 00:01:36

input datafile file number=00001 name=/home/opt/oracle/oradata/yangql/system01.dbf

output file name=/home/opt/oracle/oradata/yangql/system01.dbf tag=tag20110426t144511

channel c1: datafile copy complete, elapsed time: 00:00:35

input datafile file number=00002 name=/home/opt/oracle/oradata/yangql/sysaux01.dbf

output file name=/home/opt/oracle/oradata/yangql/sysaux01.dbf tag=tag20110426t144511

channel c1: datafile copy complete, elapsed time: 00:00:15

input datafile file number=00004 name=/home/opt/oracle/oradata/yangql/users01.dbf

output file name=/home/opt/oracle/oradata/yangql/users01.dbf tag=tag20110426t144511

channel c1: datafile copy complete, elapsed time: 00:00:01

   switch clone datafile all;

datafile 1 switched to datafile copy

input datafile copy recid=3 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/system01.dbf

datafile 2 switched to datafile copy

input datafile copy recid=4 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/sysaux01.dbf

datafile 3 switched to datafile copy

input datafile copy recid=5 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/undotbs01.dbf

datafile 4 switched to datafile copy

input datafile copy recid=6 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/users01.dbf

datafile 5 switched to datafile copy

input datafile copy recid=7 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr01.dbf

datafile 6 switched to datafile copy

input datafile copy recid=8 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr02.dbf

datafile 7 switched to datafile copy

input datafile copy recid=9 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr03.dbf

datafile 8 switched to datafile copy

input datafile copy recid=10 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr04.dbf

datafile 9 switched to datafile copy

input datafile copy recid=11 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr05.dbf

datafile 10 switched to datafile copy

input datafile copy recid=12 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr06.dbf

datafile 11 switched to datafile copy

input datafile copy recid=13 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr07.dbf

datafile 12 switched to datafile copy

input datafile copy recid=14 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr08.dbf

datafile 13 switched to datafile copy

input datafile copy recid=15 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr09.dbf

datafile 14 switched to datafile copy

input datafile copy recid=16 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr10.dbf

datafile 15 switched to datafile copy

input datafile copy recid=17 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr11.dbf

datafile 16 switched to datafile copy

input datafile copy recid=18 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr12.dbf

datafile 17 switched to datafile copy

input datafile copy recid=19 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr13.dbf

datafile 18 switched to datafile copy

input datafile copy recid=20 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr14.dbf

datafile 19 switched to datafile copy

input datafile copy recid=21 stamp=749488890 file name=/home/opt/oracle/oradata/yangql/alijr15.dbf

datafile 20 switched to datafile copy

input datafile copy recid=22 stamp=749488891 file name=/home/opt/oracle/oradata/yangql/alijr16.dbf

datafile 21 switched to datafile copy

input datafile copy recid=23 stamp=749488891 file name=/home/opt/oracle/oradata/yangql/alijr17.dbf

datafile 22 switched to datafile copy

input datafile copy recid=24 stamp=749488891 file name=/home/opt/oracle/oradata/yangql/alijr18.dbf

datafile 23 switched to datafile copy

input datafile copy recid=25 stamp=749488891 file name=/home/opt/oracle/oradata/yangql/alijr19.dbf

finished duplicate db at 26-apr-11

released channel: c1

released channel: s1

released channel: s2

rman> exit

recovery manager complete.

======================備庫的操作================

檢查備庫上的資料檔案。

sql*plus: release 11.2.0.1.0 production on tue apr 26 13:07:48 2011

copyright (c) 1982, 2009, oracle.  all rights reserved.

connected to an idle instance.

@>startup nomount pfile='/home/opt/oracle/products/11.2.0/dbs/yangql.ora'

oracle instance started.

total system global area 1653518336 bytes

fixed size                  2213896 bytes

variable size            1006635000 bytes

database buffers          637534208 bytes

redo buffers                7135232 bytes

@>exit

disconnected from oracle database 11g enterprise edition release 11.2.0.1.0 - 64bit production

with the partitioning option

sql*plus: release 11.2.0.1.0 production on tue apr 26 14:04:43 2011

connected to:

oracle database 11g enterprise edition release 11.2.0.1.0 - 64bit production

@>select * from v$logfile;

group# status  type   member   is_

------ ------- ----------------------------------------------------------------------

 3     online      /home/opt/oracle/oradata/yangql/redo03.log no

2      online      /home/opt/oracle/oradata/yangql/redo02.log no

1      online      /home/opt/oracle/oradata/yangql/redo01.log no

@>col member for a45

    group# status  type    member                                        is_

---------- ------- ------- --------------------------------------------- ---

         3         online  /home/opt/oracle/oradata/yangql/redo03.log   no

         2         online  /home/opt/oracle/oradata/yangql/redo02.log   no

         1         online  /home/opt/oracle/oradata/yangql/redo01.log   no

@>col ts#        format 9999

@>col tablespace format a20

@>col file       format a52

@>select t.ts#, t.name "tablespace", d.file#, d.name "file", d.status, d.enabled

  2  from v$tablespace t, v$datafile d

  3  where t.ts#=d.ts#

  4  union all

  5  select t.ts#, t.name "tablespace", d.file#, d.name "file", d.status, d.enabled

  6  from v$tablespace t, v$tempfile d

  7  where t.ts#=d.ts#  order by 1, 4;

  ts# tablespace                file# file                                                 status  enabled

----- -------------------- ---------- ---------------------------------------------------- ------- ----------

    0 system                        1 /home/opt/oracle/oradata/yangql/system01.dbf        system  read write

    1 sysaux                        2 /home/opt/oracle/oradata/yangql/sysaux01.dbf        online  read write

    2 undotbs1                      3 /home/opt/oracle/oradata/yangql/undotbs01.dbf       online  read write

    3 temp                          1 /home/opt/oracle/oradata/yangql/temp01.dbf          online  read write

    4 users                         4 /home/opt/oracle/oradata/yangql/users01.dbf         online  read write

    6 ajr                         5 /home/opt/oracle/oradata/yangql/alijr01.dbf         online  read write

    6 ajr                         6 /home/opt/oracle/oradata/yangql/alijr02.dbf         online  read write

    6 ajr                         7 /home/opt/oracle/oradata/yangql/alijr03.dbf         online  read write

    6 ajr                         8 /home/opt/oracle/oradata/yangql/alijr04.dbf         online  read write

    6 ajr                         9 /home/opt/oracle/oradata/yangql/alijr05.dbf         online  read write

    6 ajr                        10 /home/opt/oracle/oradata/yangql/alijr06.dbf         online  read write

    6 ajr                        11 /home/opt/oracle/oradata/yangql/alijr07.dbf         online  read write

    6 ajr                        12 /home/opt/oracle/oradata/yangql/alijr08.dbf         online  read write

    6 ajr                        13 /home/opt/oracle/oradata/yangql/alijr09.dbf         online  read write

    6 ajr                        14 /home/opt/oracle/oradata/yangql/alijr10.dbf         online  read write

    6 ajr                        15 /home/opt/oracle/oradata/yangql/alijr11.dbf         online  read write

    6 ajr                        16 /home/opt/oracle/oradata/yangql/alijr12.dbf         online  read write

    6 ajr                        17 /home/opt/oracle/oradata/yangql/alijr13.dbf         online  read write

    6 ajr                        18 /home/opt/oracle/oradata/yangql/alijr14.dbf         online  read write

    6 ajr                        19 /home/opt/oracle/oradata/yangql/alijr15.dbf         online  read write

    6 ajr                        20 /home/opt/oracle/oradata/yangql/alijr16.dbf         online  read write

    6 ajr                        21 /home/opt/oracle/oradata/yangql/alijr17.dbf         online  read write

    6 ajr                        22 /home/opt/oracle/oradata/yangql/alijr18.dbf         online  read write

    6 ajr                        23 /home/opt/oracle/oradata/yangql/alijr19.dbf         online  read write

24 rows selected.

@>exit             

剩下的就是進行切換日志檢查dg的功能了~!