设为首页 收藏本站
查看: 734|回复: 0

[经验分享] Oracle 11g配置DG

[复制链接]

尚未签到

发表于 2018-9-9 08:16:03 | 显示全部楼层 |阅读模式
[oracle@cwogg ~]$ rman target / auxiliary sys/123123@172.16.30.228/MECBS  
Recovery Manager: Release 11.2.0.4.0 - Production on Tue Sep 22 16:50:55 2015
  
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
  
connected to target database: PHUB (DBID=536511065)
  
connected to auxiliary database: PHUB (not mounted)
  
RMAN> @duplicate.sql
  
RMAN> duplicate target database
  
2> for standby
  
3> from active database nofilenamecheck
  
4> DORECOVER
  
5> spfile
  
6> set service_names='MECBS'
  
7> set db_unique_name='MECBS'
  
8> set log_archive_dest_1='location=+DATA VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=MECBS'
  
9> set log_archive_dest_2='SERVICE=PHUB  LGWR SYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PHUB'
  
10> set standby_file_management='AUTO'
  
11> set diagnostic_dest='/u01/app/oracle'
  
12> set audit_file_dest='/u01/app/oracle/admin/MECBS/adump'
  
13> set fal_server='PHUB'
  
14> set fal_client='MECBS'
  
15> set control_files='+DATA/mecbs/controlfile/control01.ctl','+DATA/mecbs/controlfile/control02.ctl'
  
16> set cluster_database='false'
  
17> #set DB_FILE_NAME_CONVERT='/oradata/rpt','+DATA/cwrptb/datafile','/oradata/smt','+DATA/cwrptb/datafile','/oradata/fol','+DATA/cwrptb/datafile','/oradata/acf','+DATA/cwrptb/datafile','/oradata/eol','+DATA/cwrptb/datafile','/oracle/product/ora11gr2/oradata/CWRPT','+DATA/cwrptb/datafile'
  
18> #set LOG_FILE_NAME_CONVERT='/arch/CWRPT/onlinelog','+DATA/cwrptb/onlinelog'
  
19> set db_create_file_dest='+DATA'
  
20> set db_recovery_file_dest='+DATA'
  
21> set db_recovery_file_dest_size='4G';
  
Starting Duplicate Db at 22-SEP-15
  
using target database control file instead of recovery catalog
  
allocated channel: ORA_AUX_DISK_1
  
channel ORA_AUX_DISK_1: SID=20 device type=DISK
  
allocated channel: ORA_AUX_DISK_2
  
channel ORA_AUX_DISK_2: SID=21 device type=DISK
  
contents of Memory Script:
  
{
  
   backup as copy reuse
  
   targetfile  '/u01/app/oracle/product/11.2.0/db_1/dbs/orapwPHUB' auxiliary format
  
'/u01/app/oracle/product/11.2.0/db_1/dbs/orapwMECBS'   targetfile
  
'+DATA/phub/spfilephub.ora' auxiliary format
  
'/u01/app/oracle/product/11.2.0/db_1/dbs/spfileMECBS.ora'   ;
  
   sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/db_1/dbs/spfileMECBS.ora''";
  
}
  
executing Memory Script
  
Starting backup at 22-SEP-15
  
allocated channel: ORA_DISK_1
  
channel ORA_DISK_1: SID=9 device type=DISK
  
allocated channel: ORA_DISK_2
  
channel ORA_DISK_2: SID=191 device type=DISK
  
Finished backup at 22-SEP-15
  
sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.0/db_1/dbs/spfileMECBS.ora''
  
contents of Memory Script:
  
{
  
   sql clone "alter system set  service_names =
  
''MECBS'' comment=
  
'''' scope=spfile";
  
   sql clone "alter system set  db_unique_name =
  
''MECBS'' comment=
  
'''' scope=spfile";
  
   sql clone "alter system set  log_archive_dest_1 =
  
''location=+DATA VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=MECBS'' comment=
  
'''' scope=spfile";
  
   sql clone "alter system set  log_archive_dest_2 =
  
''SERVICE=PHUB  LGWR SYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PHUB'' comment=
  
'''' scope=spfile";
  
   sql clone "alter system set  standby_file_management =
  
''AUTO'' comment=
  
'''' scope=spfile";
  
   sql clone "alter system set  diagnostic_dest =
  
''/u01/app/oracle'' comment=
  
'''' scope=spfile";
  
   sql clone "alter system set  audit_file_dest =
  
''/u01/app/oracle/admin/MECBS/adump'' comment=
  
'''' scope=spfile";
  
   sql clone "alter system set  fal_server =
  
''PHUB'' comment=
  
'''' scope=spfile";
  
   sql clone "alter system set  fal_client =
  
''MECBS'' comment=
  
'''' scope=spfile";
  
   sql clone "alter system set  control_files =
  
''+DATA/mecbs/controlfile/control01.ctl'', ''+DATA/mecbs/controlfile/control02.ctl'' comment=
  
'''' scope=spfile";
  
   sql clone "alter system set  cluster_database =
  
false comment=
  
'''' scope=spfile";
  
   sql clone "alter system set  db_create_file_dest =
  
''+DATA'' comment=
  
'''' scope=spfile";
  
   sql clone "alter system set  db_recovery_file_dest =
  
''+DATA'' comment=
  
'''' scope=spfile";
  
   sql clone "alter system set  db_recovery_file_dest_size =
  
4G comment=
  
'''' scope=spfile";
  
   shutdown clone immediate;
  
   startup clone nomount;
  
}
  
executing Memory Script
  
sql statement: alter system set  service_names =  ''MECBS'' comment= '''' scope=spfile
  
sql statement: alter system set  db_unique_name =  ''MECBS'' comment= '''' scope=spfile
  
sql statement: alter system set  log_archive_dest_1 =  ''location=+DATA VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=MECBS'' comment= '''' scope=spfile
  
sql statement: alter system set  log_archive_dest_2 =  ''SERVICE=PHUB  LGWR SYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=PHUB'' comment= '''' scope=spfile
  
sql statement: alter system set  standby_file_management =  ''AUTO'' comment= '''' scope=spfile
  
sql statement: alter system set  diagnostic_dest =  ''/u01/app/oracle'' comment= '''' scope=spfile
  
sql statement: alter system set  audit_file_dest =  ''/u01/app/oracle/admin/MECBS/adump'' comment= '''' scope=spfile
  
sql statement: alter system set  fal_server =  ''PHUB'' comment= '''' scope=spfile
  
sql statement: alter system set  fal_client =  ''MECBS'' comment= '''' scope=spfile
  
sql statement: alter system set  control_files =  ''+DATA/mecbs/controlfile/control01.ctl'', ''+DATA/mecbs/controlfile/control02.ctl'' comment= '''' scope=spfile
  
sql statement: alter system set  cluster_database =  false comment= '''' scope=spfile
  
sql statement: alter system set  db_create_file_dest =  ''+DATA'' comment= '''' scope=spfile
  
sql statement: alter system set  db_recovery_file_dest =  ''+DATA'' comment= '''' scope=spfile
  
sql statement: alter system set  db_recovery_file_dest_size =  4G comment= '''' scope=spfile
  
Oracle instance shut down
  
connected to auxiliary database (not started)
  
Oracle instance started
  
Total System Global Area     835104768 bytes
  
Fixed Size                     2257840 bytes
  
Variable Size                541068368 bytes
  
Database Buffers             289406976 bytes
  
Redo Buffers                   2371584 bytes
  
contents of Memory Script:
  
{
  
   backup as copy current controlfile for standby auxiliary format  '+DATA/mecbs/controlfile/control01.ctl';
  
   restore clone controlfile to  '+DATA/mecbs/controlfile/control02.ctl' from
  
'+DATA/mecbs/controlfile/control01.ctl';
  
}
  
executing Memory Script
  
Starting backup at 22-SEP-15
  
using channel ORA_DISK_1
  
using channel ORA_DISK_2
  
channel ORA_DISK_1: starting datafile copy
  
copying standby control file
  
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_PHUB.f tag=TAG20150922T165146 RECID=2 STAMP=891103907
  
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
  
Finished backup at 22-SEP-15
  
Starting restore at 22-SEP-15
  
allocated channel: ORA_AUX_DISK_1
  
channel ORA_AUX_DISK_1: SID=23 device type=DISK
  
allocated channel: ORA_AUX_DISK_2
  
channel ORA_AUX_DISK_2: SID=24 device type=DISK
  
channel ORA_AUX_DISK_2: skipped, AUTOBACKUP already found
  
channel ORA_AUX_DISK_1: copied control file copy
  
Finished restore at 22-SEP-15
  
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;
  
   set newname for clone datafile  5 to new;
  
   set newname for clone datafile  6 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
  
   datafile  5 auxiliary format new
  
   datafile  6 auxiliary format new
  
   ;
  
   sql 'alter system archive log current';
  
}
  
executing Memory Script
  
executing command: SET NEWNAME
  
renamed tempfile 1 to +DATA in control file
  
executing command: SET NEWNAME
  
executing command: SET NEWNAME
  
executing command: SET NEWNAME
  
executing command: SET NEWNAME
  
executing command: SET NEWNAME
  
executing command: SET NEWNAME
  
Starting backup at 22-SEP-15
  
using channel ORA_DISK_1
  
using channel ORA_DISK_2
  
channel ORA_DISK_1: starting datafile copy
  
input datafile file number=00006 name=+DATA/phub/datafile/llc01.dbf
  
channel ORA_DISK_2: starting datafile copy
  
input datafile file number=00001 name=+DATA/phub/datafile/system.287.890482863
  
output file name=+DATA/mecbs/datafile/system.259.891103927 tag=TAG20150922T165212
  
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:02:25
  
channel ORA_DISK_2: starting datafile copy
  
input datafile file number=00002 name=+DATA/phub/datafile/sysaux.269.890482863
  
output file name=+DATA/mecbs/datafile/sysaux.260.891104071 tag=TAG20150922T165212
  
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:01:55
  
channel ORA_DISK_2: starting datafile copy
  
input datafile file number=00005 name=+DATA/phub/datafile/example.271.890482863
  
output file name=+DATA/mecbs/datafile/example.261.891104187 tag=TAG20150922T165212
  
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:55
  
channel ORA_DISK_2: starting datafile copy
  
input datafile file number=00003 name=+DATA/phub/datafile/undotbs1.272.890482863
  
output file name=+DATA/mecbs/datafile/undotbs1.262.891104243 tag=TAG20150922T165212
  
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:25
  
channel ORA_DISK_2: starting datafile copy
  
input datafile file number=00004 name=+DATA/phub/datafile/users.260.890482863
  
output file name=+DATA/mecbs/datafile/users.263.891104267 tag=TAG20150922T165212
  
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:15
  
output file name=+DATA/mecbs/datafile/llc.258.891103925 tag=TAG20150922T165212
  
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:08:27
  
Finished backup at 22-SEP-15
  
sql statement: alter system archive log current
  
contents of Memory Script:
  
{
  
   backup as copy reuse
  
   archivelog like  "+DATA/phub/archivelog/2015_09_22/thread_1_seq_27.325.891104439" auxiliary format
  
"+DATA"   ;
  
   catalog clone start with  "+DATA";
  
   switch clone datafile all;
  
}
  
executing Memory Script
  
Starting backup at 22-SEP-15
  
using channel ORA_DISK_1
  
using channel ORA_DISK_2
  
channel ORA_DISK_1: starting archived log copy
  
input archived log thread=1 sequence=27 RECID=54 STAMP=891104440
  
output file name=+DATA/mecbs/archivelog/2015_09_22/thread_1_seq_27.264.891104435 RECID=0 STAMP=0
  
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
  
Finished backup at 22-SEP-15
  
searching for all files that match the pattern +DATA
  
List of Files Unknown to the Database
  
=====================================
  
File Name: +data/mecbs/ARCHIVELOG/2015_09_22/thread_1_seq_27.264.891104435
  
File Name: +data/mecbs/DATAFILE/LLC.258.891103925
  
File Name: +data/mecbs/DATAFILE/SYSTEM.259.891103927
  
File Name: +data/mecbs/DATAFILE/SYSAUX.260.891104071
  
File Name: +data/mecbs/DATAFILE/EXAMPLE.261.891104187
  
File Name: +data/mecbs/DATAFILE/UNDOTBS1.262.891104243
  
File Name: +data/mecbs/DATAFILE/USERS.263.891104267
  
File Name: +data/ASM/ASMPARAMETERFILE/REGISTRY.253.891100399
  
cataloging files...
  
cataloging done
  
List of Cataloged Files
  
=======================
  
File Name: +data/mecbs/ARCHIVELOG/2015_09_22/thread_1_seq_27.264.891104435
  
File Name: +data/mecbs/DATAFILE/LLC.258.891103925
  
File Name: +data/mecbs/DATAFILE/SYSTEM.259.891103927
  
File Name: +data/mecbs/DATAFILE/SYSAUX.260.891104071
  
File Name: +data/mecbs/DATAFILE/EXAMPLE.261.891104187
  
File Name: +data/mecbs/DATAFILE/UNDOTBS1.262.891104243
  
File Name: +data/mecbs/DATAFILE/USERS.263.891104267
  
List of Files Which Where Not Cataloged
  
=======================================
  
File Name: +data/ASM/ASMPARAMETERFILE/REGISTRY.253.891100399
  
  RMAN-07518: Reason: Foreign database file DBID: 0  Database Name:
  
datafile 1 switched to datafile copy
  
input datafile copy RECID=8 STAMP=891104436 file name=+DATA/mecbs/datafile/system.259.891103927
  
datafile 2 switched to datafile copy
  
input datafile copy RECID=9 STAMP=891104436 file name=+DATA/mecbs/datafile/sysaux.260.891104071
  
datafile 3 switched to datafile copy
  
input datafile copy RECID=10 STAMP=891104436 file name=+DATA/mecbs/datafile/undotbs1.262.891104243
  
datafile 4 switched to datafile copy
  
input datafile copy RECID=11 STAMP=891104436 file name=+DATA/mecbs/datafile/users.263.891104267
  
datafile 5 switched to datafile copy
  
input datafile copy RECID=12 STAMP=891104436 file name=+DATA/mecbs/datafile/example.261.891104187
  
datafile 6 switched to datafile copy
  
input datafile copy RECID=13 STAMP=891104436 file name=+DATA/mecbs/datafile/llc.258.891103925
  
contents of Memory Script:
  
{
  
   set until scn  1889761;
  
   recover
  
   standby
  
   clone database
  
    delete archivelog
  
   ;
  
}
  
executing Memory Script
  
executing command: SET until clause
  
Starting recover at 22-SEP-15
  
using channel ORA_AUX_DISK_1
  
using channel ORA_AUX_DISK_2
  
starting media recovery
  
archived log for thread 1 with sequence 27 is already on disk as file +DATA/mecbs/archivelog/2015_09_22/thread_1_seq_27.264.891104435
  
archived log file name=+DATA/mecbs/archivelog/2015_09_22/thread_1_seq_27.264.891104435 thread=1 sequence=27
  
media recovery complete, elapsed time: 00:00:00
  
Finished recover at 22-SEP-15
  
Finished Duplicate Db at 22-SEP-15



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-568443-1-1.html 上篇帖子: oracle客户端中文乱码 下篇帖子: Oracle常用查询语句
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表