标签:
1> run { 2> allocate channel prmy1 type disk; 3> allocate channel prmy2 type disk; 4> allocate channel prmy3 type disk; 5> allocate auxiliary channel stby type disk; 6> duplicate target database for standby from active database 7> spfile 8> parameter_value_convert ‘prim‘,‘stdby‘ 9> set db_unique_name=‘stdby‘ 10> set audit_file_dest=‘D:\app\Administrator\admin\stdby\adump‘ 11> set diagnostic_dest=‘D:\app\Administrator‘ 12> set db_file_name_convert=‘D:\app\Administrator\oradata\prim‘,‘D:\app\Administrator\oradata\stdby‘,‘D:\ORADATA‘,‘D:\app\Administrator\oradata\stdby‘,‘D:\‘,‘D:\app\Administrator\oradata\stdby\‘ 13> set log_file_name_convert=‘D:\app\Administrator\oradata\prim‘,‘D:\app\Administrator\oradata\stdby‘ 14> set control_files=‘D:\app\Administrator\oradata\stdby\control01.ctl‘,‘D:\app\Administrator\oradata\stdby\control02.ctl‘ 15> set log_archive_max_processes=‘5‘ 16> set fal_client=‘stdby‘ 17> set fal_server=‘prim‘ 18> set memory_target=‘8589934592‘ 19> set standby_file_management=‘AUTO‘ 20> set log_archive_config=‘dg_config=(prim,stdby)‘ 21> set log_archive_dest_1=‘location=D:\hrarch‘ 22> set log_archive_dest_2=‘service=prim ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=prim‘ 23> ; 24> } 使用目标数据库控制文件替代恢复目录 分配的通道: prmy1 通道 prmy1: SID=781 设备类型=DISK 分配的通道: prmy2 通道 prmy2: SID=1 设备类型=DISK 分配的通道: prmy3 通道 prmy3: SID=21 设备类型=DISK 分配的通道: stby 通道 stby: SID=67 设备类型=DISK 启动 Duplicate Db 于 13-10月-15 内存脚本的内容: { backup as copy reuse targetfile ‘d:\app\Administrator\product\11.2.0\dbhome_1\DATABASE\PWDprim.ORA‘ auxiliary format ‘D:\app\Administrator\product\11.2.0\dbhome_1\DATABASE\PWDstdby.ORA‘ target file ‘D:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\SPFILEprim.ORA‘ auxiliary format ‘D:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\SPFILEstdby.ORA‘ ; sql clone "alter system set spfile= ‘‘D:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\SPFILEstdby.ORA‘‘"; } 正在执行内存脚本 启动 backup 于 13-10月-15 完成 backup 于 13-10月-15 sql 语句: alter system set spfile= ‘‘D:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\SPFILEstdby.ORA‘‘ 内存脚本的内容: { sql clone "alter system set dispatchers = ‘‘(PROTOCOL=TCP) (SERVICE=stdbyXDB)‘‘ comment= ‘‘‘‘ scope=spfile"; sql clone "alter system set db_unique_name = ‘‘stdby‘‘ comment= ‘‘‘‘ scope=spfile"; sql clone "alter system set audit_file_dest = ‘‘D:\app\Administrator\admin\stdby\adump‘‘ comment= ‘‘‘‘ scope=spfile"; sql clone "alter system set diagnostic_dest = ‘‘D:\app\Administrator‘‘ comment= ‘‘‘‘ scope=spfile"; sql clone "alter system set db_file_name_convert = ‘‘D:\app\Administrator\oradata\prim‘‘, ‘‘D:\app\Administrator\oradata\stdby‘‘, ‘‘D:\ORADATA‘‘, ‘‘D:\app\Administrator\oradata\stdby‘‘, ‘‘D:\‘‘, ‘‘D:\app\Administrator\oradata\stdby\‘‘ comment= ‘‘‘‘ scope=spfile"; sql clone "alter system set log_file_name_convert = ‘‘D:\app\Administrator\oradata\prim‘‘, ‘‘D:\app\Administrator\oradata\stdby‘‘ comment= ‘‘‘‘ scope=spfile"; sql clone "alter system set control_files = ‘‘D:\app\Administrator\oradata\stdby\control01.ctl‘‘, ‘‘D:\app\Administrator\oradata\stdby\control02.ctl‘‘ comment= ‘‘‘‘ scope=spfile"; sql clone "alter system set log_archive_max_processes = 5 comment= ‘‘‘‘ scope=spfile"; sql clone "alter system set fal_client = ‘‘stdby‘‘ comment= ‘‘‘‘ scope=spfile"; sql clone "alter system set fal_server = ‘‘prim‘‘ comment= ‘‘‘‘ scope=spfile"; sql clone "alter system set memory_target = 8589934592 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=(prim,stdby)‘‘ comment= ‘‘‘‘ scope=spfile"; sql clone "alter system set log_archive_dest_1 = ‘‘location=D:\hrarch‘‘ comment= ‘‘‘‘ scope=spfile"; sql clone "alter system set log_archive_dest_2 = ‘‘service=prim ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=prim‘‘ comment= ‘‘‘‘ scope=spfile"; shutdown clone immediate; startup clone nomount; } 正在执行内存脚本 sql 语句: alter system set dispatchers = ‘‘(PROTOCOL=TCP) (SERVICE=stdbyXDB)‘‘ comment= ‘‘‘‘ scope=spfile sql 语句: alter system set db_unique_name = ‘‘stdby‘‘ comment= ‘‘‘‘ scope=spfile sql 语句: alter system set audit_file_dest = ‘‘D:\app\Administrator\admin\stdby\adump‘‘ comment= ‘‘‘‘ scope=spfile sql 语句: alter system set diagnostic_dest = ‘‘D:\app\Administrator‘‘ comment= ‘‘‘‘ scope=spfile sql 语句: alter system set db_file_name_convert = ‘‘D:\app\Administrator\oradata\prim‘‘, ‘‘D:\app\Administrator\oradata\stdby‘‘, ‘‘D:\ORADATA‘‘, ‘‘D:\app\Administrator\oradata\stdby‘‘, ‘‘D:\‘‘, ‘‘D:\app\Administrator\oradata\stdby\‘‘ comment= ‘‘‘‘ scope=spfile sql 语句: alter system set log_file_name_convert = ‘‘D:\app\Administrator\oradata\prim‘‘, ‘‘D:\app\Administrator\oradata\stdby‘‘ comment= ‘‘‘‘ scope=spfile sql 语句: alter system set control_files = ‘‘D:\app\Administrator\oradata\stdby\control01.ctl‘‘, ‘‘D:\app\Administrator\oradata\stdby\control02.ctl‘‘ comment= ‘‘‘‘ scope=spfile sql 语句: alter system set log_archive_max_processes = 5 comment= ‘‘‘‘ scope=spfile sql 语句: alter system set fal_client = ‘‘stdby‘‘ comment= ‘‘‘‘ scope=spfile sql 语句: alter system set fal_server = ‘‘prim‘‘ comment= ‘‘‘‘ scope=spfile sql 语句: alter system set memory_target = 8589934592 comment= ‘‘‘‘ scope=spfile sql 语句: alter system set standby_file_management = ‘‘AUTO‘‘ comment= ‘‘‘‘ scope=spfile sql 语句: alter system set log_archive_config = ‘‘dg_config=(prim,stdby)‘‘ comment= ‘‘‘‘ scope=spfile sql 语句: alter system set log_archive_dest_1 = ‘‘location=D:\hrarch‘‘ comment= ‘‘‘‘ scope=spfile sql 语句: alter system set log_archive_dest_2 = ‘‘service=prim ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=prim‘‘ comment= ‘‘‘‘ scope=spfile Oracle 实例已关闭 已连接到辅助数据库 (未启动) Oracle 实例已启动 系统全局区域总计 8551575552 字节 Fixed Size 2192864 字节 Variable Size 4378855968 字节 Database Buffers 4160749568 字节 Redo Buffers 9777152 字节 分配的通道: stby 通道 stby: SID=488 设备类型=DISK 内存脚本的内容: { backup as copy current controlfile for standby auxiliary format ‘D:\APP\ADMINISTRATOR\ORADATA\stdby\CONTROL01.CTL‘; restore clone controlfile to ‘D:\APP\ADMINISTRATOR\ORADATA\stdby\CONTROL02.CTL‘ from ‘D:\APP\ADMINISTRATOR\ORADATA\stdby\CONTROL01.CTL‘; } 正在执行内存脚本 启动 backup 于 13-10月-15 通道 prmy1: 启动数据文件副本 复制备用控制文件 输出文件名=D:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\SNCFprim.ORA 标 记=TAG20151013T205135 RECID=14 STAMP=893019095 通道 prmy1: 数据文件复制完毕, 经过时间: 00:00:01 完成 backup 于 13-10月-15 启动 restore 于 13-10月-15 通道 stby: 已复制控制文件副本 完成 restore 于 13-10月-15 内存脚本的内容: { sql clone ‘alter database mount standby database‘; } 正在执行内存脚本 sql 语句: alter database mount standby database 内存脚本的内容: { set newname for tempfile 1 to "D:\APP\ADMINISTRATOR\ORADATA\stdby\TEMP01.DBF"; switch clone tempfile all; set newname for datafile 1 to "D:\APP\ADMINISTRATOR\ORADATA\stdby\SYSTEM01.DBF"; set newname for datafile 2 to "D:\APP\ADMINISTRATOR\ORADATA\stdby\SYSAUX01.DBF"; set newname for datafile 3 to "D:\APP\ADMINISTRATOR\ORADATA\stdby\UNDOTBS01.DBF"; set newname for datafile 4 to "D:\APP\ADMINISTRATOR\ORADATA\stdby\USERS01.DBF"; set newname for datafile 5 to "D:\APP\ADMINISTRATOR\ORADATA\stdby\V3XSPACE.DBF"; set newname for datafile 6 to "D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_DATA01.DBF"; set newname for datafile 7 to "D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_DATA02.DBF"; set newname for datafile 8 to "D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_DATA03.DBF"; set newname for datafile 9 to "D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_INDEX01.DBF"; set newname for datafile 10 to "D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_INDEX02.DBF"; set newname for datafile 11 to "D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_INDEX03.DBF"; backup as copy reuse datafile 1 auxiliary format "D:\APP\ADMINISTRATOR\ORADATA\stdby\SYSTEM01.DBF" datafile 2 auxiliary format "D:\APP\ADMINISTRATOR\ORADATA\stdby\SYSAUX01.DBF" datafile 3 auxiliary format "D:\APP\ADMINISTRATOR\ORADATA\stdby\UNDOTBS01.DBF" datafile 4 auxiliary format "D:\APP\ADMINISTRATOR\ORADATA\stdby\USERS01.DBF" datafile 5 auxiliary format "D:\APP\ADMINISTRATOR\ORADATA\stdby\V3XSPACE.DBF" datafile 6 auxiliary format "D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_DATA01.DBF" datafile 7 auxiliary format "D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_DATA02.DBF" datafile 8 auxiliary format "D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_DATA03.DBF" datafile 9 auxiliary format "D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_INDEX01.DBF" datafile 10 auxiliary format "D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_INDEX02.DBF" datafile 11 auxiliary format "D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_INDEX03.DBF"; sql ‘alter system archive log current‘; } 正在执行内存脚本 正在执行命令: SET NEWNAME 临时文件 1 在控制文件中已重命名为 D:\APP\ADMINISTRATOR\ORADATA\stdby\TEMP01.DB F 正在执行命令: SET NEWNAME 正在执行命令: SET NEWNAME 正在执行命令: SET NEWNAME 正在执行命令: SET NEWNAME 正在执行命令: SET NEWNAME 正在执行命令: SET NEWNAME 正在执行命令: SET NEWNAME 正在执行命令: SET NEWNAME 正在执行命令: SET NEWNAME 正在执行命令: SET NEWNAME 正在执行命令: SET NEWNAME 启动 backup 于 13-10月-15 通道 prmy1: 启动数据文件副本 输入数据文件: 文件号=00005 名称=D:\V3XSPACE.DBF 通道 prmy2: 启动数据文件副本 输入数据文件: 文件号=00001 名称=D:\APP\ADMINISTRATOR\ORADATA\prim\SYSTEM01.DBF 通道 prmy3: 启动数据文件副本 输入数据文件: 文件号=00003 名称=D:\APP\ADMINISTRATOR\ORADATA\prim\UNDOTBS01.DBF 输出文件名=D:\APP\ADMINISTRATOR\ORADATA\stdby\UNDOTBS01.DBF 标记=TAG20151013T205142 通道 prmy3: 数据文件复制完毕, 经过时间: 00:02:46 通道 prmy3: 启动数据文件副本 输入数据文件: 文件号=00006 名称=D:\ORADATA\NNC_DATA01.DBF 输出文件名=D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_DATA01.DBF 标记=TAG20151013T205142 通道 prmy3: 数据文件复制完毕, 经过时间: 00:01:25 通道 prmy3: 启动数据文件副本 输入数据文件: 文件号=00002 名称=D:\APP\ADMINISTRATOR\ORADATA\prim\SYSAUX01.DBF 输出文件名=D:\APP\ADMINISTRATOR\ORADATA\stdby\SYSAUX01.DBF 标记=TAG20151013T205142 通道 prmy3: 数据文件复制完毕, 经过时间: 00:00:45 通道 prmy3: 启动数据文件副本 输入数据文件: 文件号=00009 名称=D:\ORADATA\NNC_INDEX01.DBF 输出文件名=D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_INDEX01.DBF 标记=TAG20151013T205142 通道 prmy3: 数据文件复制完毕, 经过时间: 00:00:35 通道 prmy3: 启动数据文件副本 输入数据文件: 文件号=00007 名称=D:\ORADATA\NNC_DATA02.DBF 输出文件名=D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_DATA02.DBF 标记=TAG20151013T205142 通道 prmy3: 数据文件复制完毕, 经过时间: 00:00:15 通道 prmy3: 启动数据文件副本 输入数据文件: 文件号=00008 名称=D:\ORADATA\NNC_DATA03.DBF 输出文件名=D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_DATA03.DBF 标记=TAG20151013T205142 通道 prmy3: 数据文件复制完毕, 经过时间: 00:00:25 通道 prmy3: 启动数据文件副本 输入数据文件: 文件号=00010 名称=D:\ORADATA\NNC_INDEX02.DBF 输出文件名=D:\APP\ADMINISTRATOR\ORADATA\stdby\SYSTEM01.DBF 标记=TAG20151013T205142 通道 prmy2: 数据文件复制完毕, 经过时间: 00:06:27 通道 prmy2: 启动数据文件副本 输入数据文件: 文件号=00011 名称=D:\ORADATA\NNC_INDEX03.DBF 输出文件名=D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_INDEX02.DBF 标记=TAG20151013T205142 通道 prmy3: 数据文件复制完毕, 经过时间: 00:00:15 通道 prmy3: 启动数据文件副本 输入数据文件: 文件号=00004 名称=D:\APP\ADMINISTRATOR\ORADATA\prim\USERS01.DBF 输出文件名=D:\APP\ADMINISTRATOR\ORADATA\stdby\USERS01.DBF 标记=TAG20151013T205142 通道 prmy3: 数据文件复制完毕, 经过时间: 00:00:01 输出文件名=D:\APP\ADMINISTRATOR\ORADATA\stdby\NNC_INDEX03.DBF 标记=TAG20151013T205142 通道 prmy2: 数据文件复制完毕, 经过时间: 00:00:15 输出文件名=D:\APP\ADMINISTRATOR\ORADATA\stdby\V3XSPACE.DBF 标记=TAG20151013T205142 通道 prmy1: 数据文件复制完毕, 经过时间: 00:11:32 完成 backup 于 13-10月-15 sql 语句: alter system archive log current 内存脚本的内容: { switch clone datafile all; } 正在执行内存脚本 数据文件 1 已转换成数据文件副本 输入数据文件副本 RECID=14 STAMP=893019795 文件名=D:\APP\ADMINISTRATOR\ORADATA\HRSTDBY\SYSTEM01.DBF 数据文件 2 已转换成数据文件副本 输入数据文件副本 RECID=15 STAMP=893019796 文件名=D:\APP\ADMINISTRATOR\ORADATA\HRSTDBY\SYSAUX01.DBF 数据文件 3 已转换成数据文件副本 输入数据文件副本 RECID=16 STAMP=893019796 文件名=D:\APP\ADMINISTRATOR\ORADATA\HRSTDBY\UNDOTBS01.DBF 数据文件 4 已转换成数据文件副本 输入数据文件副本 RECID=17 STAMP=893019796 文件名=D:\APP\ADMINISTRATOR\ORADATA\HRSTDBY\USERS01.DBF 数据文件 5 已转换成数据文件副本 输入数据文件副本 RECID=18 STAMP=893019796 文件名=D:\APP\ADMINISTRATOR\ORADATA\HRSTDBY\V3XSPACE.DBF 数据文件 6 已转换成数据文件副本 输入数据文件副本 RECID=19 STAMP=893019796 文件名=D:\APP\ADMINISTRATOR\ORADATA\HRSTDBY\NNC_DATA01.DBF 数据文件 7 已转换成数据文件副本 输入数据文件副本 RECID=20 STAMP=893019796 文件名=D:\APP\ADMINISTRATOR\ORADATA\HRSTDBY\NNC_DATA02.DBF 数据文件 8 已转换成数据文件副本 输入数据文件副本 RECID=21 STAMP=893019796 文件名=D:\APP\ADMINISTRATOR\ORADATA\HRSTDBY\NNC_DATA03.DBF 数据文件 9 已转换成数据文件副本 输入数据文件副本 RECID=22 STAMP=893019796 文件名=D:\APP\ADMINISTRATOR\ORADATA\HRSTDBY\NNC_INDEX01.DBF 数据文件 10 已转换成数据文件副本 输入数据文件副本 RECID=23 STAMP=893019796 文件名=D:\APP\ADMINISTRATOR\ORADATA\HRSTDBY\NNC_INDEX02.DBF 数据文件 11 已转换成数据文件副本 输入数据文件副本 RECID=24 STAMP=893019796 文件名=D:\APP\ADMINISTRATOR\ORADATA\HRSTDBY\NNC_INDEX03.DBF 完成 Duplicate Db 于 13-10月-15 释放的通道: prmy1 释放的通道: prmy2 释放的通道: prmy3 释放的通道: stby RMAN>
Creating Physical Standby Using RMAN DUPLICATE...FROM ACTIVE DATABASE执行结果
标签:
原文地址:http://www.cnblogs.com/abclife/p/4877122.html