先在备库里面安装好数据库软件既可
1、11G 在线复制数据库流程很简单
1.1 主库生成pfile 发送到备库
1.2 主库的密码文件发送到备库
1.3 配置好网络监听
1.4 开始复制数据库
2、实际操作步骤
2.1
主库创建pfile 给备库使用
sql>create pfile='/u01/init.ora' from spfile
发送到备库
scp /u01/init.ora:root@192.168.88.16:/u01/init.ora -----可以存放在任何oracle 访问的目录 但是要自己能够记得 到时候startup 的时候需要使用
发送密码文件给备库
在$ORACLE_HOME/dbs 下找到 orapwsid 的文件发送到备库的 $ORACLE_HOME/dbs 下面
在备库编辑init.ora 用作备库的初始化文件
这是编辑后的文件
*.audit_file_dest='/u01/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/oradata/orcl/control01.ctl','/u01/flash_recovery_area/orcl/control02.ctl','/u01/oradata/orcl/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.db_recovery_file_dest='/u01/flash_recovery_area'
*.db_recovery_file_dest_size=4070572032
*.diagnostic_dest='/u01'
*.memory_target=977272832
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.star_transformation_enabled='TRUE'
*.undo_tablespace='UNDOTBS1'
db_file_name_convert=('/u01/oradata/og1/','/u01/oradata/orcl/','/u01/oracle/dbs/','/u01/oradata/orcl/')
log_file_name_convert=('/u01/oradata/og1/','/u01/oradata/orcl')
这里只改几个参数
*.audit_file_dest---这里我们要创建几个目录/u01/admin/orcl/adump 数据库软件装好后 ORACLE_BASE 下面是没有admin 这个目录的 需要我们自己创建
*.control_files--- 控制文件这里我们也要创建一个文件夹/u01/oradata/orcl/
*.db_name=
*.db_recovery_file_dest--- 也要创建目录
db_file_name_convert---- 这里DB_FILE_NAME_CONVERT DB_FILE_NAME_CONVERT = 'string1' , 'string2' , 'string3' , 'string4'
string1 is the pattern of the primary database filename
string2 is the pattern of the standby database filename
string3 is the pattern of the primary database filename
string4 is the pattern of the standby database filename---- 例如 我主库有好几个文件夹 放数据文件
log_file_name_convert----存放redo 日志文件地方也要创建目录
总结下: 由于我们备库只安装了软件没有创建实例 所以有些目录是没有的 需要我们自己创建 也就是说上面使用到的目录 全部要在备库中先创建好 并且 权限给 ORACLE 用户
3、配置网络监听
主库listener.ora 静态监听格式如下
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ogg1.localdomain)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/oracle)
(SID_NAME =og1)
)
(SID_DESC =
(ORACLE_HOME = /u01/oracle)
(SID_NAME =og1)
)
)
ADR_BASE_LISTENER = /u01
备库:listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/oracle)
(SID_NAME =orcl)
)
(SID_DESC =
(ORACLE_HOME = /u01/oracle)
(SID_NAME =orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = backup.localdomain)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /u01
lsnrctl stop /start 重启监听
4、复制数据库
在备库
rman target sys/oracle@og1 auxiliary sys/oracle@orcl
注意sys/oracle@og1 为连接源库
sys/oracle@orcl为连接本机也就是备库
rman>duplicate target database to orcl from active database;
duplicate target database to orcl from active database;
Starting Duplicate Db at 30-JUL-14
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=18 device type=DISK
contents of Memory Script:
{
sql clone "create spfile from memory";
}
executing Memory Script
sql statement: create spfile from memory
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 972898304 bytes
Fixed Size 2219272 bytes
Variable Size 570426104 bytes
Database Buffers 394264576 bytes
Redo Buffers 5988352 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''OG1'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''ORCL'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format '/u01/oradata/orcl/control01.ctl';
restore clone controlfile to '/u01/flash_recovery_area/orcl/control02.ctl' from
'/u01/oradata/orcl/control01.ctl';
restore clone controlfile to '/u01/oradata/orcl/control02.ctl' from
'/u01/oradata/orcl/control01.ctl';
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''OG1'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 972898304 bytes
Fixed Size 2219272 bytes
Variable Size 570426104 bytes
Database Buffers 394264576 bytes
Redo Buffers 5988352 bytes
Starting backup at 30-JUL-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=42 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/oracle/dbs/snapcf_og1.f tag=TAG20140730T221208 RECID=4 STAMP=854316729
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 30-JUL-14
Starting restore at 30-JUL-14
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 30-JUL-14
Starting restore at 30-JUL-14
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 30-JUL-14
database mounted
contents of Memory Script:
{
set newname for datafile 1 to
"/u01/oradata/orclsystem01.dbf";
set newname for datafile 2 to
"/u01/oradata/orclsysaux01.dbf";
set newname for datafile 3 to
"/u01/oradata/orclundotbs01.dbf";
set newname for datafile 4 to
"/u01/oradata/orclusers01.dbf";
set newname for datafile 5 to
"/u01/oradata/orcloggfile.dbf";
set newname for datafile 6 to
"/u01/oradata/orclggddl.dbf";
backup as copy reuse
datafile 1 auxiliary format
"/u01/oradata/orclsystem01.dbf" datafile
2 auxiliary format
"/u01/oradata/orclsysaux01.dbf" datafile
3 auxiliary format
"/u01/oradata/orclundotbs01.dbf" datafile
4 auxiliary format
"/u01/oradata/orclusers01.dbf" datafile
5 auxiliary format
"/u01/oradata/orcloggfile.dbf" datafile
6 auxiliary format
"/u01/oradata/orclggddl.dbf" ;
sql 'alter system archive log current';
}
executing Memory Script
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 30-JUL-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/oradata/og1/sysaux01.dbf
output file name=/u01/oradata/orclsysaux01.dbf tag=TAG20140730T221219
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/oradata/og1/system01.dbf
output file name=/u01/oradata/orclsystem01.dbf tag=TAG20140730T221219
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/u01/oracle/dbs/ggddl.dbf
output file name=/u01/oradata/orclggddl.dbf tag=TAG20140730T221219
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/oradata/og1/undotbs01.dbf
output file name=/u01/oradata/orclundotbs01.dbf tag=TAG20140730T221219
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/oradata/og1/oggfile.dbf
output file name=/u01/oradata/orcloggfile.dbf tag=TAG20140730T221219
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/oradata/og1/users01.dbf
output file name=/u01/oradata/orclusers01.dbf tag=TAG20140730T221219
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 30-JUL-14
sql statement: alter system archive log current
contents of Memory Script:
{
backup as copy reuse
archivelog like "/u01/flash_recovery_area/OG1/archivelog/2014_07_30/o1_mf_1_172_9xkzg3ob_.arc" auxiliary format
"/u01/flash_recovery_area/ORCL/archivelog/2014_07_30/o1_mf_1_172_%u_.arc" ;
catalog clone recovery area;
switch clone datafile all;
}
executing Memory Script
Starting backup at 30-JUL-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=172 RECID=168 STAMP=854316868
output file name=/u01/flash_recovery_area/ORCL/archivelog/2014_07_30/o1_mf_1_172_1ipenlq4_.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
Finished backup at 30-JUL-14
searching for all files in the recovery area
List of Files Unknown to the Database
=====================================
File Name: /u01/flash_recovery_area/ORCL/archivelog/2014_07_30/o1_mf_1_172_1ipenlq4_.arc
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/flash_recovery_area/ORCL/archivelog/2014_07_30/o1_mf_1_172_1ipenlq4_.arc
datafile 1 switched to datafile copy
input datafile copy RECID=4 STAMP=854316939 file name=/u01/oradata/orclsystem01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=5 STAMP=854316939 file name=/u01/oradata/orclsysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=6 STAMP=854316939 file name=/u01/oradata/orclundotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=7 STAMP=854316940 file name=/u01/oradata/orclusers01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=8 STAMP=854316940 file name=/u01/oradata/orcloggfile.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=9 STAMP=854316940 file name=/u01/oradata/orclggddl.dbf
contents of Memory Script:
{
set until scn 3992098;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 30-JUL-14
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 172 is already on disk as file /u01/flash_recovery_area/ORCL/archivelog/2014_07_30/o1_mf_1_172_1ipenlq4_.arc
archived log file name=/u01/flash_recovery_area/ORCL/archivelog/2014_07_30/o1_mf_1_172_1ipenlq4_.arc thread=1 sequence=172
media recovery complete, elapsed time: 00:00:00
Finished recover at 30-JUL-14
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set db_name =
''ORCL'' comment=
''Reset to original value by RMAN'' scope=spfile";
sql clone "alter system reset db_unique_name scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
database dismounted
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 972898304 bytes
Fixed Size 2219272 bytes
Variable Size 570426104 bytes
Database Buffers 394264576 bytes
Redo Buffers 5988352 bytes
sql statement: alter system set db_name = ''ORCL'' comment= ''Reset to original value by RMAN'' scope=spfile
sql statement: alter system reset db_unique_name scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 972898304 bytes
Fixed Size 2219272 bytes
Variable Size 570426104 bytes
Database Buffers 394264576 bytes
Redo Buffers 5988352 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORCL" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/u01/oradata/orclredo01.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/u01/oradata/orclredo02.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/u01/oradata/orclredo03.log' ) SIZE 50 M REUSE
DATAFILE
'/u01/oradata/orclsystem01.dbf'
CHARACTER SET AL32UTF8
contents of Memory Script:
{
set newname for tempfile 1 to
"/u01/oradata/orcltemp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u01/oradata/orclsysaux01.dbf",
"/u01/oradata/orclundotbs01.dbf",
"/u01/oradata/orclusers01.dbf",
"/u01/oradata/orcloggfile.dbf",
"/u01/oradata/orclggddl.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u01/oradata/orcltemp01.dbf in control file
cataloged datafile copy
datafile copy file name=/u01/oradata/orclsysaux01.dbf RECID=1 STAMP=854316955
cataloged datafile copy
datafile copy file name=/u01/oradata/orclundotbs01.dbf RECID=2 STAMP=854316956
cataloged datafile copy
datafile copy file name=/u01/oradata/orclusers01.dbf RECID=3 STAMP=854316956
cataloged datafile copy
datafile copy file name=/u01/oradata/orcloggfile.dbf RECID=4 STAMP=854316956
cataloged datafile copy
datafile copy file name=/u01/oradata/orclggddl.dbf RECID=5 STAMP=854316956
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=854316955 file name=/u01/oradata/orclsysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=854316956 file name=/u01/oradata/orclundotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=854316956 file name=/u01/oradata/orclusers01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=854316956 file name=/u01/oradata/orcloggfile.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=854316956 file name=/u01/oradata/orclggddl.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 30-JUL-14
1、11G 在线复制数据库流程很简单
1.1 主库生成pfile 发送到备库
1.2 主库的密码文件发送到备库
1.3 配置好网络监听
1.4 开始复制数据库
2、实际操作步骤
2.1
主库创建pfile 给备库使用
sql>create pfile='/u01/init.ora' from spfile
发送到备库
scp /u01/init.ora:root@192.168.88.16:/u01/init.ora -----可以存放在任何oracle 访问的目录 但是要自己能够记得 到时候startup 的时候需要使用
发送密码文件给备库
在$ORACLE_HOME/dbs 下找到 orapwsid 的文件发送到备库的 $ORACLE_HOME/dbs 下面
在备库编辑init.ora 用作备库的初始化文件
这是编辑后的文件
*.audit_file_dest='/u01/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/oradata/orcl/control01.ctl','/u01/flash_recovery_area/orcl/control02.ctl','/u01/oradata/orcl/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.db_recovery_file_dest='/u01/flash_recovery_area'
*.db_recovery_file_dest_size=4070572032
*.diagnostic_dest='/u01'
*.memory_target=977272832
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.star_transformation_enabled='TRUE'
*.undo_tablespace='UNDOTBS1'
db_file_name_convert=('/u01/oradata/og1/','/u01/oradata/orcl/','/u01/oracle/dbs/','/u01/oradata/orcl/')
log_file_name_convert=('/u01/oradata/og1/','/u01/oradata/orcl')
这里只改几个参数
*.audit_file_dest---这里我们要创建几个目录/u01/admin/orcl/adump 数据库软件装好后 ORACLE_BASE 下面是没有admin 这个目录的 需要我们自己创建
*.control_files--- 控制文件这里我们也要创建一个文件夹/u01/oradata/orcl/
*.db_name=
*.db_recovery_file_dest--- 也要创建目录
db_file_name_convert---- 这里DB_FILE_NAME_CONVERT DB_FILE_NAME_CONVERT = 'string1' , 'string2' , 'string3' , 'string4'
string1 is the pattern of the primary database filename
string2 is the pattern of the standby database filename
string3 is the pattern of the primary database filename
string4 is the pattern of the standby database filename---- 例如 我主库有好几个文件夹 放数据文件
log_file_name_convert----存放redo 日志文件地方也要创建目录
总结下: 由于我们备库只安装了软件没有创建实例 所以有些目录是没有的 需要我们自己创建 也就是说上面使用到的目录 全部要在备库中先创建好 并且 权限给 ORACLE 用户
3、配置网络监听
主库listener.ora 静态监听格式如下
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ogg1.localdomain)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/oracle)
(SID_NAME =og1)
)
(SID_DESC =
(ORACLE_HOME = /u01/oracle)
(SID_NAME =og1)
)
)
ADR_BASE_LISTENER = /u01
备库:listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/oracle)
(SID_NAME =orcl)
)
(SID_DESC =
(ORACLE_HOME = /u01/oracle)
(SID_NAME =orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = backup.localdomain)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /u01
lsnrctl stop /start 重启监听
4、复制数据库
在备库
rman target sys/oracle@og1 auxiliary sys/oracle@orcl
注意sys/oracle@og1 为连接源库
sys/oracle@orcl为连接本机也就是备库
rman>duplicate target database to orcl from active database;
duplicate target database to orcl from active database;
Starting Duplicate Db at 30-JUL-14
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=18 device type=DISK
contents of Memory Script:
{
sql clone "create spfile from memory";
}
executing Memory Script
sql statement: create spfile from memory
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 972898304 bytes
Fixed Size 2219272 bytes
Variable Size 570426104 bytes
Database Buffers 394264576 bytes
Redo Buffers 5988352 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''OG1'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''ORCL'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format '/u01/oradata/orcl/control01.ctl';
restore clone controlfile to '/u01/flash_recovery_area/orcl/control02.ctl' from
'/u01/oradata/orcl/control01.ctl';
restore clone controlfile to '/u01/oradata/orcl/control02.ctl' from
'/u01/oradata/orcl/control01.ctl';
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''OG1'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 972898304 bytes
Fixed Size 2219272 bytes
Variable Size 570426104 bytes
Database Buffers 394264576 bytes
Redo Buffers 5988352 bytes
Starting backup at 30-JUL-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=42 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/oracle/dbs/snapcf_og1.f tag=TAG20140730T221208 RECID=4 STAMP=854316729
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 30-JUL-14
Starting restore at 30-JUL-14
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 30-JUL-14
Starting restore at 30-JUL-14
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 30-JUL-14
database mounted
contents of Memory Script:
{
set newname for datafile 1 to
"/u01/oradata/orclsystem01.dbf";
set newname for datafile 2 to
"/u01/oradata/orclsysaux01.dbf";
set newname for datafile 3 to
"/u01/oradata/orclundotbs01.dbf";
set newname for datafile 4 to
"/u01/oradata/orclusers01.dbf";
set newname for datafile 5 to
"/u01/oradata/orcloggfile.dbf";
set newname for datafile 6 to
"/u01/oradata/orclggddl.dbf";
backup as copy reuse
datafile 1 auxiliary format
"/u01/oradata/orclsystem01.dbf" datafile
2 auxiliary format
"/u01/oradata/orclsysaux01.dbf" datafile
3 auxiliary format
"/u01/oradata/orclundotbs01.dbf" datafile
4 auxiliary format
"/u01/oradata/orclusers01.dbf" datafile
5 auxiliary format
"/u01/oradata/orcloggfile.dbf" datafile
6 auxiliary format
"/u01/oradata/orclggddl.dbf" ;
sql 'alter system archive log current';
}
executing Memory Script
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 30-JUL-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/oradata/og1/sysaux01.dbf
output file name=/u01/oradata/orclsysaux01.dbf tag=TAG20140730T221219
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/oradata/og1/system01.dbf
output file name=/u01/oradata/orclsystem01.dbf tag=TAG20140730T221219
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/u01/oracle/dbs/ggddl.dbf
output file name=/u01/oradata/orclggddl.dbf tag=TAG20140730T221219
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/oradata/og1/undotbs01.dbf
output file name=/u01/oradata/orclundotbs01.dbf tag=TAG20140730T221219
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/oradata/og1/oggfile.dbf
output file name=/u01/oradata/orcloggfile.dbf tag=TAG20140730T221219
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/oradata/og1/users01.dbf
output file name=/u01/oradata/orclusers01.dbf tag=TAG20140730T221219
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 30-JUL-14
sql statement: alter system archive log current
contents of Memory Script:
{
backup as copy reuse
archivelog like "/u01/flash_recovery_area/OG1/archivelog/2014_07_30/o1_mf_1_172_9xkzg3ob_.arc" auxiliary format
"/u01/flash_recovery_area/ORCL/archivelog/2014_07_30/o1_mf_1_172_%u_.arc" ;
catalog clone recovery area;
switch clone datafile all;
}
executing Memory Script
Starting backup at 30-JUL-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=172 RECID=168 STAMP=854316868
output file name=/u01/flash_recovery_area/ORCL/archivelog/2014_07_30/o1_mf_1_172_1ipenlq4_.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
Finished backup at 30-JUL-14
searching for all files in the recovery area
List of Files Unknown to the Database
=====================================
File Name: /u01/flash_recovery_area/ORCL/archivelog/2014_07_30/o1_mf_1_172_1ipenlq4_.arc
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/flash_recovery_area/ORCL/archivelog/2014_07_30/o1_mf_1_172_1ipenlq4_.arc
datafile 1 switched to datafile copy
input datafile copy RECID=4 STAMP=854316939 file name=/u01/oradata/orclsystem01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=5 STAMP=854316939 file name=/u01/oradata/orclsysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=6 STAMP=854316939 file name=/u01/oradata/orclundotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=7 STAMP=854316940 file name=/u01/oradata/orclusers01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=8 STAMP=854316940 file name=/u01/oradata/orcloggfile.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=9 STAMP=854316940 file name=/u01/oradata/orclggddl.dbf
contents of Memory Script:
{
set until scn 3992098;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 30-JUL-14
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 172 is already on disk as file /u01/flash_recovery_area/ORCL/archivelog/2014_07_30/o1_mf_1_172_1ipenlq4_.arc
archived log file name=/u01/flash_recovery_area/ORCL/archivelog/2014_07_30/o1_mf_1_172_1ipenlq4_.arc thread=1 sequence=172
media recovery complete, elapsed time: 00:00:00
Finished recover at 30-JUL-14
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set db_name =
''ORCL'' comment=
''Reset to original value by RMAN'' scope=spfile";
sql clone "alter system reset db_unique_name scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
database dismounted
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 972898304 bytes
Fixed Size 2219272 bytes
Variable Size 570426104 bytes
Database Buffers 394264576 bytes
Redo Buffers 5988352 bytes
sql statement: alter system set db_name = ''ORCL'' comment= ''Reset to original value by RMAN'' scope=spfile
sql statement: alter system reset db_unique_name scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 972898304 bytes
Fixed Size 2219272 bytes
Variable Size 570426104 bytes
Database Buffers 394264576 bytes
Redo Buffers 5988352 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORCL" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/u01/oradata/orclredo01.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/u01/oradata/orclredo02.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/u01/oradata/orclredo03.log' ) SIZE 50 M REUSE
DATAFILE
'/u01/oradata/orclsystem01.dbf'
CHARACTER SET AL32UTF8
contents of Memory Script:
{
set newname for tempfile 1 to
"/u01/oradata/orcltemp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u01/oradata/orclsysaux01.dbf",
"/u01/oradata/orclundotbs01.dbf",
"/u01/oradata/orclusers01.dbf",
"/u01/oradata/orcloggfile.dbf",
"/u01/oradata/orclggddl.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u01/oradata/orcltemp01.dbf in control file
cataloged datafile copy
datafile copy file name=/u01/oradata/orclsysaux01.dbf RECID=1 STAMP=854316955
cataloged datafile copy
datafile copy file name=/u01/oradata/orclundotbs01.dbf RECID=2 STAMP=854316956
cataloged datafile copy
datafile copy file name=/u01/oradata/orclusers01.dbf RECID=3 STAMP=854316956
cataloged datafile copy
datafile copy file name=/u01/oradata/orcloggfile.dbf RECID=4 STAMP=854316956
cataloged datafile copy
datafile copy file name=/u01/oradata/orclggddl.dbf RECID=5 STAMP=854316956
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=854316955 file name=/u01/oradata/orclsysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=854316956 file name=/u01/oradata/orclundotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=854316956 file name=/u01/oradata/orclusers01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=854316956 file name=/u01/oradata/orcloggfile.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=854316956 file name=/u01/oradata/orclggddl.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 30-JUL-14
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26764973/viewspace-1242461/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26764973/viewspace-1242461/