太懒
分类: Oracle
2014-08-01 17:18:44
IP
SQL> select INST_ID,FILE#,STATUS,NAME from gv$datafile;INST_ID FILE# STATUS NAME---------- ---------- ------- --------------------------------------------------1 1 SYSTEM /u02/oradata/mydb1/system01.dbf1 2 ONLINE /u02/oradata/mydb1/sysaux01.dbf1 3 ONLINE /u02/oradata/mydb1/undotbs101.dbf1 4 ONLINE /u02/oradata/mydb1/users01.dbf1 7 ONLINE /u02/oradata/mydb1/zabbix101.dbf1 8 ONLINE /u02/oradata/mydb1/hyperic0101.dbf6 rows selected.SQL>SQL> select INST_ID,INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,VERSION,STATUS from gv$instance;INST_ID INSTANCE_NUMBER INSTANCE_NAME HOST_NAME VERSION STATUS---------- --------------- ---------------- -------------------- ----------------- ------------1 1 mydb1 my2950 11.2.0.3.0 OPENSQL> select INST_ID,FILE#,STATUS,NAME from gv$datafile;INST_ID FILE# STATUS NAME---------- ---------- ------- --------------------------------------------------1 1 SYSTEM /u02/oradata/mydb1/system01.dbf1 2 ONLINE /u02/oradata/mydb1/sysaux01.dbf1 3 ONLINE /u02/oradata/mydb1/undotbs101.dbf1 4 ONLINE /u02/oradata/mydb1/users01.dbf1 7 ONLINE /u02/oradata/mydb1/zabbix101.dbf1 8 ONLINE /u02/oradata/mydb1/hyperic0101.dbf6 rows selected.SQL>SQL> select2 a.GROUP#,a.thread#,a.sequence#,a.bytes/1024/1024 "size(MB)",b.member3 from v$log a,v$logfile b4 where a.group#=b.GROUP#5 order by 1;GROUP# THREAD# SEQUENCE# size(MB) MEMBER---------- ---------- ---------- ---------- --------------------------------------------------3 2 0 50 /u03/oraredo/mydb1/onlinelog/redoa03.log4 2 0 50 /u03/oraredo/mydb1/onlinelog/redoa04.log5 3 0 50 /u03/oraredo/mydb1/onlinelog/redoa05.log6 3 0 50 /u03/oraredo/mydb1/onlinelog/redoa06.log7 1 110 100 /u03/oraredo/mydb1/onlinelog/redoaa01.log8 1 106 100 /u03/oraredo/mydb1/onlinelog/redoaa02.log9 1 107 100 /u03/oraredo/mydb1/onlinelog/redoaa03.log10 1 108 100 /u03/oraredo/mydb1/onlinelog/redoaa04.log11 1 109 100 /u03/oraredo/mydb1/onlinelog/redoaa05.log9 rows selected.SQL>
性能采集工具 OSWbb Oracle OSWatcher Black Box只安装软件SID: dupdb数据文件 /u01/data/oradata/dupdbredolog /u01/data/onlinelog/dupdbflash /u01/data/flash_recover_areamkdir -p /u01/data/oradata/dupdbmkdir -p /u01/data/onlinelog/dupdbmkdir -p /u01/data/flash_recover_areachown -R oracle:oinstall /u01/data/chmod -R 775 /u01/data/[oracle@node1 ~]$ pwd/home/oracle[oracle@node1 ~]$ ls.bash_history .bash_logout .bash_profile .bashrc db_env .gnome2/ grid_env .kshrc .mozilla/[oracle@node1 ~]$ wget ftp://10.101.0.17/pub/kik/ora11203_rac_conf/db_sfonly_single.rsp--2014-05-20 12:34:18-- ftp://10.101.0.17/pub/kik/ora11203_rac_conf/db_sfonly_single.rsp=> “db_sfonly_single.rsp”Connecting to 10.101.0.17:21... connected.Logging in as anonymous ... Logged in!==> SYST ... done. ==> PWD ... done.==> TYPE I ... done. ==> CWD (1) /pub/kik/ora11203_rac_conf ... done.==> SIZE db_sfonly_single.rsp ... 25069==> PASV ... done. ==> RETR db_sfonly_single.rsp ... done.Length: 25069 (24K) (unauthoritative)100%[=======================================================================================================================================>] 25,069 --.-K/s in 0.002s2014-05-20 12:34:18 (9.68 MB/s) - “db_sfonly_single.rsp” saved [25069][oracle@node1 ~]$ more db_sfonly_single.rsp |grep ^[^#$]oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0oracle.install.option=INSTALL_DB_SWONLYORACLE_HOSTNAME=node1.momo.orgUNIX_GROUP_NAME=oinstallINVENTORY_LOCATION=/u01/app/oracle/oraInventorySELECTED_LANGUAGES=en,zh_CNORACLE_HOME=/u01/app/oracle/product/11.2.3/db_1ORACLE_BASE=/u01/app/oracleoracle.install.db.InstallEdition=EEoracle.install.db.EEOptionsSelection=falseoracle.install.db.optionalComponents=oracle.install.db.DBA_GROUP=dbaoracle.install.db.OPER_GROUP=oinstalloracle.install.db.CLUSTER_NODES=oracle.install.db.isRACOneInstall=falseoracle.install.db.racOneServiceName=oracle.install.db.config.starterdb.type=GENERAL_PURPOSEoracle.install.db.config.starterdb.globalDBName=oracle.install.db.config.starterdb.SID=oracle.install.db.config.starterdb.characterSet=oracle.install.db.config.starterdb.memoryOption=falseoracle.install.db.config.starterdb.memoryLimit=oracle.install.db.config.starterdb.installExampleSchemas=falseoracle.install.db.config.starterdb.enableSecuritySettings=trueoracle.install.db.config.starterdb.password.ALL=oracle.install.db.config.starterdb.password.SYS=oracle.install.db.config.starterdb.password.SYSTEM=oracle.install.db.config.starterdb.password.SYSMAN=oracle.install.db.config.starterdb.password.DBSNMP=oracle.install.db.config.starterdb.control=DB_CONTROLoracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=oracle.install.db.config.starterdb.automatedBackup.enable=falseoracle.install.db.config.starterdb.automatedBackup.osuid=oracle.install.db.config.starterdb.automatedBackup.ospwd=oracle.install.db.config.starterdb.storageType=oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=oracle.install.db.config.asm.diskGroup=oracle.install.db.config.asm.ASMSNMPPassword=MYORACLESUPPORT_USERNAME=MYORACLESUPPORT_PASSWORD=SECURITY_UPDATES_VIA_MYORACLESUPPORT=falseDECLINE_SECURITY_UPDATES=truePROXY_HOST=PROXY_PORT=PROXY_USER=PROXY_PWD=PROXY_REALM=COLLECTOR_SUPPORTHUB_URL=oracle.installer.autoupdates.option=SKIP_UPDATESoracle.installer.autoupdates.downloadUpdatesLoc=AUTOUPDATES_MYORACLESUPPORT_USERNAME=AUTOUPDATES_MYORACLESUPPORT_PASSWORD=[oracle@node1 ~]$[oracle@node1 ~]$ cd /nfs/oracle11G/x86_64/112030/p10404530_112030_Linux-x86-64_1+2of7/[oracle@node1 p10404530_112030_Linux-x86-64_1+2of7]$ cd /nfs/oracle11G/x86_64/112030/p10404530_112030_Linux-x86-64_1+2of7/database/[oracle@node1 database]$ lsdoc/ install/ readme.html* response/ rpm/ runInstaller* sshsetup/ stage/ welcome.html*[oracle@node1 database]$ lltotal 52drwxr-xr-x 12 oracle oinstall 4096 Sep 19 2011 doc/drwxr-xr-x 4 oracle oinstall 4096 Sep 22 2011 install/-rwxr-xr-x 1 oracle oinstall 28122 Sep 22 2011 readme.html*drwxr-xr-x 2 oracle oinstall 58 Sep 22 2011 response/drwxr-xr-x 2 oracle oinstall 33 Sep 22 2011 rpm/-rwxr-xr-x 1 oracle oinstall 3226 Sep 22 2011 runInstaller*drwxr-xr-x 2 oracle oinstall 28 Sep 22 2011 sshsetup/drwxr-xr-x 14 oracle oinstall 4096 Sep 22 2011 stage/-rwxr-xr-x 1 oracle oinstall 5466 Aug 23 2011 welcome.html*[oracle@node1 database]$[oracle@node1 database]$ ./runInstaller -ignorePrereq -ignoreSysPrereqs -silent -responseFile /home/oracle/db_sfonly_single.rsp[oracle@node1 database]$[oracle@node1 database]$ [WARNING] [INS-35342] The specified group for Database Operator (OSOPER) may not be defined in the system.CAUSE: The OS group you specified as the OSOPER group may not be configured on the server, or in the Network Information Service (NIS).ACTION: Check the group name you selected, and specify a different group, or create the group on the server or in the Network Information Service.[oracle@node1 database]$ You can find the log of this install session at:/u01/app/oracle/oraInventory/logs/installActions2014-05-20_12-37-46PM.logThe installation of Oracle Database 11g was successful.Please check '/u01/app/oracle/oraInventory/logs/silentInstall2014-05-20_12-37-46PM.log' for more details.As a root user, execute the following script(s):1. /u01/app/oracle/product/11.2.3/db_1/root.sh少一个?[root@node1 ~]# /u01/app/oracle/product/11.2.3/db_1/root.shCheck /u01/app/oracle/product/11.2.3/db_1/install/root_node1_2014-05-20_12-52-25.log for the output of root script[root@node1 ~]# more /u01/app/oracle/product/11.2.3/db_1/install/root_node1_2014-05-20_12-52-25.logPerforming root user operation for Oracle 11gThe following environment variables are set as:ORACLE_OWNER= oracleORACLE_HOME= /u01/app/oracle/product/11.2.3/db_1Creating /etc/oratab file...Entries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root script.Now product-specific root actions will be performed.Finished product-specific root actions.[root@node1 ~]#[root@node1 ~]# more /etc/oraInst.locinventory_loc=/u01/app/oracle/oraInventoryinst_group=oinstall[root@node1 ~]#
[root@my2950 IO_Test_Tool]# pwd/var/ftp/pub/software/IO_Test_Tool[root@my2950 IO_Test_Tool]# lsorion_linux_x86 oswbb oswbb601.tar[root@my2950 IO_Test_Tool]#scp /var/ftp/pub/software/IO_Test_Tool/oswbb601.tar root@10.101.5.91:/root
destination database[oracle@node1 admin]$ pwd/u01/app/oracle/product/11.2.3/db_1/network/admin[oracle@node1 admin]$ lltotal 4drwxr-xr-x 2 oracle oinstall 61 May 20 12:39 samples/-rw-r--r-- 1 oracle oinstall 205 May 11 2011 shrept.lst[oracle@node1 admin]$
auxiliary instance创建pfile[oracle@node1 admin]$[oracle@node1 admin]$ netcaOracle Net Services Configuration:Default local naming configuration complete.Created net service name: mydb1Default local naming configuration complete.Created net service name: dupdbOracle Net Services configuration successful. The exit code is 0[oracle@node1 admin]$ lltotal 8drwxr-xr-x 2 oracle oinstall 61 May 20 12:39 samples/-rw-r--r-- 1 oracle oinstall 205 May 11 2011 shrept.lst-rw-r--r-- 1 oracle oinstall 508 May 20 13:44 tnsnames.ora[oracle@node1 admin]$ more tnsnames.ora# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.3/db_1/network/admin/tnsnames.ora# Generated by Oracle configuration tools.MYDB1 =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 10.101.0.17)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = mydb1)))DUPDB =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 10.101.5.91)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = dupdb)))[oracle@node1 admin]$auxiliary instance必须配置成静态监听[oracle@node1 admin]$ lltotal 8drwxr-xr-x 2 oracle oinstall 61 May 20 12:39 samples/-rw-r--r-- 1 oracle oinstall 205 May 11 2011 shrept.lst-rw-r--r-- 1 oracle oinstall 508 May 20 13:44 tnsnames.ora[oracle@node1 admin]$ lsnrctl statusLSNRCTL for Linux: Version 11.2.0.3.0 - Production on 20-MAY-2014 14:17:44Copyright (c) 1991, 2011, Oracle. All rights reserved.Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))TNS-12541: TNS:no listenerTNS-12560: TNS:protocol adapter errorTNS-00511: No listenerLinux Error: 111: Connection refused[oracle@node1 admin]$[oracle@node1 admin]$ netcaOracle Net Services Configuration:Configuring Listener:LISTENERListener configuration complete.Oracle Net Listener Startup:Running Listener Control:/u01/app/oracle/product/11.2.3/db_1/bin/lsnrctl start LISTENERListener Control complete.Listener started successfully.Oracle Net Services configuration successful. The exit code is 0[oracle@node1 admin]$[oracle@node1 admin]$[oracle@node1 admin]$[oracle@node1 admin]$[oracle@node1 admin]$[oracle@node1 admin]$ lltotal 16-rw-r--r-- 1 oracle oinstall 375 May 20 14:18 listener.oradrwxr-xr-x 2 oracle oinstall 61 May 20 12:39 samples/-rw-r--r-- 1 oracle oinstall 205 May 11 2011 shrept.lst-rw-r--r-- 1 oracle oinstall 508 May 20 14:18 tnsnames1405202PM1810.bak-rw-r--r-- 1 oracle oinstall 508 May 20 13:44 tnsnames.ora[oracle@node1 admin]$ more listener.ora# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.3/db_1/network/admin/listener.ora# Generated by Oracle configuration tools.LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = node1.momo.org)(PORT = 1521))(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))))ADR_BASE_LISTENER = /u01/app/oracle[oracle@node1 admin]$修改一下添加SID_LIST_listener=(SID_LIST=(SID_DESC=(SID_NAME=dupdb)(ORACLE_HOME=/u01/app/oracle/product/11.2.3/db_1)))[oracle@node1 admin]$ more listener.ora# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.3/db_1/network/admin/listener.ora# Generated by Oracle configuration tools.LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = node1.momo.org)(PORT = 1521))(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))))SID_LIST_listener=(SID_LIST=(SID_DESC=(SID_NAME=dupdb)(ORACLE_HOME=/u01/app/oracle/product/11.2.3/db_1)))ADR_BASE_LISTENER = /u01/app/oracle[oracle@node1 admin]$测试一下是不是正常登陆[oracle@node1 admin]$ sqlplus sys/111111@mydb1 as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Tue May 20 13:45:08 2014Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL>[oracle@node1 admin]$ sqlplus sys/111111@dupdb as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Tue May 20 14:28:27 2014Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL>
echo "DB_NAME=dupdb" >> $ORACLE_HOME/dbs/initMYDB1.oraecho "DB_NAME=dupdb" >> $ORACLE_HOME/dbs/initDUPDB.ora[oracle@node1 admin]$ pwd/u01/app/oracle/product/11.2.3/db_1/network/admin[oracle@node1 admin]$ cd ../../dbs/[oracle@node1 dbs]$ lltotal 4-rw-r--r-- 1 oracle oinstall 2851 May 15 2009 init.ora[oracle@node1 dbs]$ echo "DB_NAME=dupdb" >> $ORACLE_HOME/dbs/initDUPDB.ora[oracle@node1 dbs]$
[oracle@node1 dbs]$ pwd/u01/app/oracle/product/11.2.3/db_1/dbs[oracle@node1 dbs]$ lltotal 8-rw-r--r-- 1 oracle oinstall 14 May 20 13:46 initDUPDB.ora-rw-r--r-- 1 oracle oinstall 2851 May 15 2009 init.ora[oracle@node1 dbs]$ oraporapipe orapki orapwd orapwdO[oracle@node1 dbs]$ orapwd file=?/dbs/orapwdupdb password=111111[oracle@node1 dbs]$ lltotal 12-rw-r--r-- 1 oracle oinstall 14 May 20 13:46 initDUPDB.ora-rw-r--r-- 1 oracle oinstall 2851 May 15 2009 init.ora-rw-r----- 1 oracle oinstall 1536 May 20 13:47 orapwdupdb[oracle@node1 dbs]$
start RMAN and connect to the target and auxiliary instancessqlplus 到 nomount状态[oracle@node1 dbs]$[oracle@node1 dbs]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Tue May 20 13:49:14 2014Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to an idle instance.SQL> startup nomount pfile=?/dbs/initDUPDB.oraORACLE instance started.Total System Global Area 238034944 bytesFixed Size 2227136 bytesVariable Size 180356160 bytesDatabase Buffers 50331648 bytesRedo Buffers 5120000 bytesSQL>
rman
SELECT FILE#,NAME FROM V$DATAFILE;FILE# NAME---------- ----------------------------------------------------------1 /u02/oradata/mydb1/system01.dbf2 /u02/oradata/mydb1/sysaux01.dbf3 /u02/oradata/mydb1/undotbs101.dbf4 /u02/oradata/mydb1/users01.dbf7 /U02/ORADATA/MYDB1/ZABBIX101.DBF8 /u02/oradata/mydb1/hyperic0101.dbf
[root@my2950 oswbb]# ./startOSWbb.sh 10 10[root@my2950 oswbb]# Setting the archive log directory to/var/ftp/pub/software/IO_Test_Tool/oswbb/archiveTesting for discovery of OS Utilities...VMSTAT found on your system.IOSTAT found on your system.MPSTAT found on your system.NETSTAT found on your system.TOP found on your system.Testing for discovery of OS CPU COUNToswbb is looking for the CPU COUNT on your systemCPU COUNT will be used by oswbba to automatically look for cpu problemsCPU COUNT found on your system.CPU COUNT = 2Discovery completed.[root@my2950 oswbb]#[root@node1 oswbb]# ./startOSWbb.sh 10 10[root@node1 oswbb]# Setting the archive log directory to/root/oswbb/archiveTesting for discovery of OS Utilities...VMSTAT found on your system.IOSTAT found on your system.MPSTAT found on your system.NETSTAT found on your system.TOP found on your system.Testing for discovery of OS CPU COUNToswbb is looking for the CPU COUNT on your systemCPU COUNT will be used by oswbba to automatically look for cpu problemsCPU COUNT found on your system.CPU COUNT = 2Discovery completed.[root@node1 oswbb]#
RMAN> RUN2> {SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';DUPLICATE TARGET DATABASE TO dupdbfrom active databaseLOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log','/u01/data/onlinelog/dupdb/redo01b.log','/u01/data/onlinelog/dupdb/redo01c.log','/u01/data/onlinelog/dupdb/redo01d.log','/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSEPASSWORD FILE spfileset db_recovery_file_dest 'location=/u01/data/flash_recover_area';14> }executing command: SET NEWNAMEStarting Duplicate Db at 20-MAY-2014 14:33:11RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of Duplicate Db command at 05/20/2014 14:33:11RMAN-05501: aborting duplication of target databaseRMAN-05557: Target instance not started with server parameter fileRMAN>去source端看看SQL> show parameter pfileNAME TYPE VALUE------------------------------------ ----------- ------------------------------spfile stringSQL> create spfile from pfile;File created.SQL> host ll ?/dbs/bin/bash: ll: command not foundSQL> host ls -l ?/dbsls: cannot access ?/dbs: No such file or directorySQL>SQL>SQL> host ls -l $ORACLE_HOME/dbstotal 18468drwxr-xr-x 2 oracle dba 137 May 16 10:43 bak-rw-r----- 1 oracle dba 18890752 May 20 14:34 control02.ctl-rw-rw---- 1 oracle dba 1544 May 16 10:50 hc_mydb1.datlrwxrwxrwx 1 oracle dba 22 May 16 10:44 initmydb1.ora -> initmydb1.ora.20140516-rw-r--r-- 1 oracle dba 2315 May 16 10:45 initmydb1.ora.20140516-rw-r----- 1 oracle dba 24 May 15 17:29 lkMYDB1-rw-r----- 1 oracle dba 2560 May 15 17:27 orapwmydb1-rw-r----- 1 oracle dba 2560 May 20 14:34 spfilemydb1.oraSQL>SQL> show parameter pfileNAME TYPE VALUE------------------------------------ ----------- ------------------------------spfile stringSQL> create spfile from pfile;File created.SQL>SQL>SQL> host ls -l $ORACLE_HOME/dbstotal 18468drwxr-xr-x 2 oracle dba 137 May 16 10:43 bak-rw-r----- 1 oracle dba 18890752 May 20 14:34 control02.ctl-rw-rw---- 1 oracle dba 1544 May 16 10:50 hc_mydb1.datlrwxrwxrwx 1 oracle dba 22 May 16 10:44 initmydb1.ora -> initmydb1.ora.20140516-rw-r--r-- 1 oracle dba 2315 May 16 10:45 initmydb1.ora.20140516-rw-r----- 1 oracle dba 24 May 15 17:29 lkMYDB1-rw-r----- 1 oracle dba 2560 May 15 17:27 orapwmydb1-rw-r----- 1 oracle dba 2560 May 20 14:34 spfilemydb1.oraSQL>SQL>SQL> startup force;ORACLE instance started.Total System Global Area 521936896 bytesFixed Size 2229944 bytesVariable Size 159385928 bytesDatabase Buffers 352321536 bytesRedo Buffers 7999488 bytesDatabase mounted.Database opened.SQL>SQL> show parameter pfileNAME TYPE VALUE------------------------------------ ----------- ------------------------------spfile string /u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.oraSQL>再来一次[oracle@node1 admin]$ rman target sys/234561@mydb1 auxiliary sys/234561@dupdbRecovery Manager: Release 11.2.0.3.0 - Production on Tue May 20 14:36:35 2014Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.connected to target database: MYDB1 (DBID=1497461080)connected to auxiliary database: DUPDB (not mounted)RMAN>RMAN> RUN2> {SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';DUPLICATE TARGET DATABASE TO dupdbfrom active databaseLOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log','/u01/data/onlinelog/dupdb/redo01b.log','/u01/data/onlinelog/dupdb/redo01c.log','/u01/data/onlinelog/dupdb/redo01d.log','/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSEPASSWORD FILE spfileset db_recovery_file_dest 'location=/u01/data/flash_recover_area';14> }executing command: SET NEWNAMEStarting Duplicate Db at 20-MAY-2014 14:36:39using target database control file instead of recovery catalogallocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=111 device type=DISKcontents of Memory Script:{backup as copy reusetargetfile '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary fo rmat'/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb' targetfile'/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format'/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora' ;sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs /spfiledupdb.ora''";}executing Memory ScriptStarting backup at 20-MAY-2014 14:36:40allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=24 device type=DISKRMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/20/2014 14:36: 41ORA-17629: Cannot connect to the remote database serverORA-17627: ORA-12154: TNS:could not resolve the connect identifier specifiedORA-17629: Cannot connect to the remote database servercontinuing other job steps, job failed will not be re-runRMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of Duplicate Db command at 05/20/2014 14:36:42RMAN-05501: aborting duplication of target databaseRMAN-03015: error occurred in stored script Memory ScriptRMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/20/2014 14:36: 42ORA-17629: Cannot connect to the remote database serverORA-17627: ORA-12154: TNS:could not resolve the connect identifier specifiedORA-17629: Cannot connect to the remote database serverRMAN>故意没有配置source端的tns服务检查一下[oracle@my2950 admin]$ pwd/u01/app/oracle/product/11.2.3/db_1/network/admin[oracle@my2950 admin]$ more tnsnames.ora# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.3/db_1/network/admin/tnsnames.ora# Generated by Oracle configuration tools.MYDB1 =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = mydb1)))[oracle@my2950 admin]$[oracle@my2950 admin]$ vi tnsnames.ora[oracle@my2950 admin]$# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.3/db_1/network/admin/tnsnames.ora# Generated by Oracle configuration tools.MYDB1 =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = mydb1)))DUPDB =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 10.101.5.91)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = dupdb)))同时也测试一下联通[oracle@my2950 ~]$ sqlplus sys/111111@dupdb as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Tue May 20 14:40:46 2014Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> exitDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options[oracle@my2950 ~]$ sqlplus sys/111111@mydb1 as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Tue May 20 14:40:53 2014Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> exitDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options[oracle@my2950 ~]$退出rman,重新执行RMAN> RUN{SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';DUPLICATE TARGET DATABASE TO dupdbfrom active databaseLOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log','/u01/data/onlinelog/dupdb/redo01b.log','/u01/data/onlinelog/dupdb/redo01c.log','/u01/data/onlinelog/dupdb/redo01d.log','/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSEPASSWORD FILE spfileset db_recovery_file_dest 'location=/u01/data/flash_recover_area';14> }executing command: SET NEWNAMEStarting Duplicate Db at 20-MAY-2014 14:41:39using target database control file instead of recovery catalogallocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=102 device type=DISKcontents of Memory Script:{backup as copy reusetargetfile '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary format'/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb' targetfile'/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format'/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora' ;sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''";}executing Memory ScriptStarting backup at 20-MAY-2014 14:41:40allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=156 device type=DISKFinished backup at 20-MAY-2014 14:41:43sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''contents of Memory Script:{sql clone "alter system set db_name =''DUPDB'' comment=''duplicate'' scope=spfile";sql clone "alter system set db_recovery_file_dest =''location=/u01/data/flash_recover_area'' comment='''' scope=spfile";shutdown clone immediate;startup clone nomount;}executing Memory Scriptsql statement: alter system set db_name = ''DUPDB'' comment= ''duplicate'' scope=spfilesql statement: alter system set db_recovery_file_dest = ''location=/u01/data/flash_recover_area'' comment= '''' scope=spfileOracle instance shut downconnected to auxiliary database (not started)RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of Duplicate Db command at 05/20/2014 14:41:48RMAN-05501: aborting duplication of target databaseRMAN-03015: error occurred in stored script Memory ScriptRMAN-04014: startup failed: ORA-01261: Parameter db_create_file_dest destination string cannot be translatedORA-01262: Stat failed on a file destination directoryLinux-x86_64 Error: 2: No such file or directoryRMAN>继续RMAN> RUN{SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';DUPLICATE TARGET DATABASE TO dupdbfrom active databaseLOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log','/u01/data/onlinelog/dupdb/redo01b.log','/u01/data/onlinelog/dupdb/redo01c.log','/u01/data/onlinelog/dupdb/redo01d.log','/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSEPASSWORD FILE spfileset db_recovery_file_dest '/u01/data/flash_recovery_area';14> }executing command: SET NEWNAMEStarting Duplicate Db at 20-MAY-2014 14:56:46RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of Duplicate Db command at 05/20/2014 14:56:46RMAN-05501: aborting duplication of target databaseRMAN-06403: could not obtain a fully authorized sessionRMAN-04006: error from auxiliary database: ORA-01034: ORACLE not availableORA-27101: shared memory realm does not existLinux-x86_64 Error: 2: No such file or directoryRMAN>这次干脆,数据库宕啦?检查一下[oracle@node1 ~]$[oracle@node1 ~]$ ps -eaf|grep oracleroot 2861 1332 0 12:28 ? 00:00:00 sshd: oracle [priv]oracle 2866 2861 0 12:28 ? 00:00:00 sshd: oracle@nottyroot 6392 1332 0 13:37 ? 00:00:00 sshd: oracle [priv]oracle 6397 6392 0 13:37 ? 00:00:00 sshd: oracle@pts/2oracle 6404 6397 0 13:37 pts/2 00:00:00 -bashoracle 7246 1 0 14:28 ? 00:00:00 /u01/app/oracle/product/11.2.3/db_1/bin/tnslsnr LISTENER -inheritoracle 10960 6404 0 14:56 pts/2 00:00:00 rlwrap rman target sys/234561@mydb1 auxiliary sys/234561@dupdboracle 10961 10960 0 14:56 pts/0 00:00:00 rman target sys/234561@mydb1 auxiliary sys/234561@dupdboracle 10966 1 0 14:56 ? 00:00:00 oracledupdb (LOCAL=NO)root 12501 1332 0 14:57 ? 00:00:00 sshd: oracle [priv]oracle 12840 12501 0 14:57 ? 00:00:00 sshd: oracle@pts/3oracle 12892 12840 0 14:57 pts/3 00:00:00 -bashoracle 13030 12892 0 14:57 pts/3 00:00:00 ps -eaforacle 13031 12892 0 14:57 pts/3 00:00:00 grep oracle[oracle@node1 ~]$[oracle@node1 ~]$果然没了,重新启动到nomount'下[oracle@node1 db_1]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Tue May 20 14:59:03 2014Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to an idle instance.SQL> startup nomount pfile=?/dbs/initdupdb.oraLRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.3/db_1/dbs/initdupdb.ora'ORA-01078: failure in processing system parametersSQL> startup nomount pfile=?/dbs/initDUPDB.oraORACLE instance started.Total System Global Area 238034944 bytesFixed Size 2227136 bytesVariable Size 180356160 bytesDatabase Buffers 50331648 bytesRedo Buffers 5120000 bytesSQL>继续有出错RMAN> RUN{SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';DUPLICATE TARGET DATABASE TO dupdbfrom active databaseLOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log','/u01/data/onlinelog/dupdb/redo01b.log','/u01/data/onlinelog/dupdb/redo01c.log','/u01/data/onlinelog/dupdb/redo01d.log','/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSEPASSWORD FILE spfileset db_recovery_file_dest '/u01/data/flash_recovery_area/';14> }executing command: SET NEWNAMEStarting Duplicate Db at 20-MAY-2014 15:02:03using target database control file instead of recovery catalogallocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=10 device type=DISKcontents of Memory Script:{backup as copy reusetargetfile '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary format'/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb' targetfile'/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format'/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora' ;sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''";}executing Memory ScriptStarting backup at 20-MAY-2014 15:02:04allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=156 device type=DISKFinished backup at 20-MAY-2014 15:02:06sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''contents of Memory Script:{sql clone "alter system set db_name =''DUPDB'' comment=''duplicate'' scope=spfile";sql clone "alter system set db_recovery_file_dest =''/u01/data/flash_recovery_area/'' comment='''' scope=spfile";shutdown clone immediate;startup clone nomount;}executing Memory Scriptsql statement: alter system set db_name = ''DUPDB'' comment= ''duplicate'' scope=spfilesql statement: alter system set db_recovery_file_dest = ''/u01/data/flash_recovery_area/'' comment= '''' scope=spfileOracle instance shut downconnected to auxiliary database (not started)RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of Duplicate Db command at 05/20/2014 15:02:13RMAN-05501: aborting duplication of target databaseRMAN-03015: error occurred in stored script Memory ScriptRMAN-04014: startup failed: ORA-01261: Parameter db_create_file_dest destination string cannot be translatedORA-01262: Stat failed on a file destination directoryLinux-x86_64 Error: 2: No such file or directoryRMAN>修改脚本加一条又出错RMAN> RUN2> {3> SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';DUPLICATE TARGET DATABASE TO dupdbfrom active databaseLOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log','/u01/data/onlinelog/dupdb/redo01b.log','/u01/data/onlinelog/dupdb/redo01c.log','/u01/data/onlinelog/dupdb/redo01d.log','/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSEPASSWORD FILE spfileset db_recovery_file_dest '/u01/data/flash_recovery_area/'set db_create_file_dest '/u01/data/oradata/dupdb/';15> }executing command: SET NEWNAMEStarting Duplicate Db at 20-MAY-2014 15:04:44using target database control file instead of recovery catalogallocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=10 device type=DISKcontents of Memory Script:{backup as copy reusetargetfile '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary format'/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb' targetfile'/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format'/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora' ;sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''";}executing Memory ScriptStarting backup at 20-MAY-2014 15:04:44allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=31 device type=DISKFinished backup at 20-MAY-2014 15:04:47sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''contents of Memory Script:{sql clone "alter system set db_name =''DUPDB'' comment=''duplicate'' scope=spfile";sql clone "alter system set db_recovery_file_dest =''/u01/data/flash_recovery_area/'' comment='''' scope=spfile";sql clone "alter system set db_create_file_dest =''/u01/data/oradata/dupdb/'' comment='''' scope=spfile";shutdown clone immediate;startup clone nomount;}executing Memory Scriptsql statement: alter system set db_name = ''DUPDB'' comment= ''duplicate'' scope=spfilesql statement: alter system set db_recovery_file_dest = ''/u01/data/flash_recovery_area/'' comment= '''' scope=spfilesql statement: alter system set db_create_file_dest = ''/u01/data/oradata/dupdb/'' comment= '''' scope=spfileOracle instance shut downconnected to auxiliary database (not started)RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of Duplicate Db command at 05/20/2014 15:05:01RMAN-05501: aborting duplication of target databaseRMAN-03015: error occurred in stored script Memory ScriptRMAN-04014: startup failed: ORA-09925: Unable to create audit trail fileLinux-x86_64 Error: 2: No such file or directoryAdditional information: 9925RMAN>ls -l/u01/app/oracle/admin/mydb1/adumpmkdir -p /u01/app/oracle/admin/mydb1/adump[oracle@node1 db_1]$ ls -l /u01/app/oracle/admin/mydb1/adumpls: cannot access /u01/app/oracle/admin/mydb1/adump: No such file or directory[oracle@node1 db_1]$ mkdir -p /u01/app/oracle/admin/mydb1/adump继续15:11开始RMAN> RUN2> {SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';DUPLICATE TARGET DATABASE TO dupdbfrom active databaseLOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log','/u01/data/onlinelog/dupdb/redo01b.log','/u01/data/onlinelog/dupdb/redo01c.log','/u01/data/onlinelog/dupdb/redo01d.log','/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSEPASSWORD FILE spfileset AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'set db_recovery_file_dest '/u01/data/flash_recovery_area/'set db_create_file_dest '/u01/data/oradata/dupdb/';16> }executing command: SET NEWNAMEStarting Duplicate Db at 20-MAY-2014 15:10:56using target database control file instead of recovery catalogallocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=10 device type=DISKcontents of Memory Script:{backup as copy reusetargetfile '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary format'/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb' targetfile'/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format'/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora' ;sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''";}executing Memory ScriptStarting backup at 20-MAY-2014 15:10:57allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=161 device type=DISKFinished backup at 20-MAY-2014 15:10:59sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''contents of Memory Script:{sql clone "alter system set db_name =''DUPDB'' comment=''duplicate'' scope=spfile";sql clone "alter system set AUDIT_FILE_DEST =''/u01/app/oracle/admin/mydb1/adump/'' comment='''' scope=spfile";sql clone "alter system set db_recovery_file_dest =''/u01/data/flash_recovery_area/'' comment='''' scope=spfile";sql clone "alter system set db_create_file_dest =''/u01/data/oradata/dupdb/'' comment='''' scope=spfile";shutdown clone immediate;startup clone nomount;}executing Memory Scriptsql statement: alter system set db_name = ''DUPDB'' comment= ''duplicate'' scope=spfilesql statement: alter system set AUDIT_FILE_DEST = ''/u01/app/oracle/admin/mydb1/adump/'' comment= '''' scope=spfilesql statement: alter system set db_recovery_file_dest = ''/u01/data/flash_recovery_area/'' comment= '''' scope=spfilesql statement: alter system set db_create_file_dest = ''/u01/data/oradata/dupdb/'' comment= '''' scope=spfileOracle instance shut downconnected to auxiliary database (not started)Oracle instance startedTotal System Global Area 521936896 bytesFixed Size 2229944 bytesVariable Size 159385928 bytesDatabase Buffers 352321536 bytesRedo Buffers 7999488 bytescontents of Memory Script:{sql clone "alter system set db_name =''MYDB1'' comment=''Modified by RMAN duplicate'' scope=spfile";sql clone "alter system set db_unique_name =''DUPDB'' comment=''Modified by RMAN duplicate'' scope=spfile";shutdown clone immediate;startup clone force nomountbackup as copy current controlfile auxiliary format '/u02/oradata/mydb1/control01.ctl';restore clone controlfile to '/u01/app/oracle/product/11.2.3/db_1/dbs/control02.ctl' from'/u02/oradata/mydb1/control01.ctl';alter clone database mount;}executing Memory Scriptsql statement: alter system set db_name = ''MYDB1'' comment= ''Modified by RMAN duplicate'' scope=spfilesql statement: alter system set db_unique_name = ''DUPDB'' comment= ''Modified by RMAN duplicate'' scope=spfileOracle instance shut downOracle instance startedTotal System Global Area 521936896 bytesFixed Size 2229944 bytesVariable Size 159385928 bytesDatabase Buffers 352321536 bytesRedo Buffers 7999488 bytesStarting backup at 20-MAY-2014 15:11:16using channel ORA_DISK_1channel ORA_DISK_1: starting datafile copycopying current control fileOracle instance startedTotal System Global Area 521936896 bytesFixed Size 2229944 bytesVariable Size 159385928 bytesDatabase Buffers 352321536 bytesRedo Buffers 7999488 bytescontents of Memory Script:{sql clone "alter system set db_name =''DUPDB'' comment=''Reset to original value by RMAN'' scope=spfile";sql clone "alter system reset db_unique_name scope=spfile";shutdown clone immediate;}executing Memory Scriptsql statement: alter system set db_name = ''DUPDB'' comment= ''Reset to original value by RMAN'' scope=spfilesql statement: alter system reset db_unique_name scope=spfileOracle instance shut downRMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of Duplicate Db command at 05/20/2014 15:11:27RMAN-05501: aborting duplication of target databaseRMAN-03015: error occurred in stored script Memory ScriptRMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/20/2014 15:11:19ORA-17628: Oracle error 19505 returned by remote Oracle serverRMAN>12就报错......RMAN> RUN{SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';DUPLICATE TARGET DATABASE TO dupdbfrom active databaseLOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log','/u01/data/onlinelog/dupdb/redo01b.log','/u01/data/onlinelog/dupdb/redo01c.log','/u01/data/onlinelog/dupdb/redo01d.log','/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSEPASSWORD FILE spfileset AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'set db_recovery_file_dest '/u01/data/flash_recovery_area/'set db_create_file_dest '/u01/data/oradata/dupdb/';16> }executing command: SET NEWNAMEStarting Duplicate Db at 20-MAY-2014 15:26:22RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of Duplicate Db command at 05/20/2014 15:26:22RMAN-05501: aborting duplication of target databaseRMAN-05537: DUPLICATE without TARGET connection when auxiliary instance is started with spfile cannot use SPFILE clauseRMAN>娘希匹的怀疑还是路径问题source端检查一下SQL> show parameter controlNAME TYPE VALUE------------------------------------ ----------- ------------------------------control_file_record_keep_time integer 7control_files string /u02/oradata/mydb1/control01.ctl, /u01/app/oracle/product/11.2.3/db_1/dbs/control02.ctlcontrol_management_pack_access string DIAGNOSTIC+TUNINGSQL>duplicate脚本再添加一行set control_files '/u01/data/oradata/dupdb/control01.ctl'又出错...RMAN> RUN2> {SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';DUPLICATE TARGET DATABASE TO 'dupdb'from active databaseLOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log','/u01/data/onlinelog/dupdb/redo01b.log','/u01/data/onlinelog/dupdb/redo01c.log','/u01/data/onlinelog/dupdb/redo01d.log','/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSEPASSWORD FILE spfileset AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'set control_files '/u01/data/oradata/dupdb/control01.ctl'set db_recovery_file_dest '/u01/data/flash_recovery_area/'set db_create_file_dest '/u01/data/oradata/dupdb/';17> }executing command: SET NEWNAMEStarting Duplicate Db at 20-MAY-2014 15:42:24using target database control file instead of recovery catalogallocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=10 device type=DISKcontents of Memory Script:{backup as copy reusetargetfile '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary format'/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb' targetfile'/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format'/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora' ;sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''";}executing Memory ScriptStarting backup at 20-MAY-2014 15:42:24allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=24 device type=DISKFinished backup at 20-MAY-2014 15:42:27sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''contents of Memory Script:{sql clone "alter system set db_name =''DUPDB'' comment=''duplicate'' scope=spfile";sql clone "alter system set AUDIT_FILE_DEST =''/u01/app/oracle/admin/mydb1/adump/'' comment='''' scope=spfile";sql clone "alter system set control_files =''/u01/data/oradata/dupdb/control01.ctl'' comment='''' scope=spfile";sql clone "alter system set db_recovery_file_dest =''/u01/data/flash_recovery_area/'' comment='''' scope=spfile";sql clone "alter system set db_create_file_dest =''/u01/data/oradata/dupdb/'' comment='''' scope=spfile";shutdown clone immediate;startup clone nomount;}executing Memory Scriptsql statement: alter system set db_name = ''DUPDB'' comment= ''duplicate'' scope=spfilesql statement: alter system set AUDIT_FILE_DEST = ''/u01/app/oracle/admin/mydb1/adump/'' comment= '''' scope=spfilesql statement: alter system set control_files = ''/u01/data/oradata/dupdb/control01.ctl'' comment= '''' scope=spfilesql statement: alter system set db_recovery_file_dest = ''/u01/data/flash_recovery_area/'' comment= '''' scope=spfilesql statement: alter system set db_create_file_dest = ''/u01/data/oradata/dupdb/'' comment= '''' scope=spfileOracle instance shut downconnected to auxiliary database (not started)Oracle instance startedTotal System Global Area 521936896 bytesFixed Size 2229944 bytesVariable Size 159385928 bytesDatabase Buffers 352321536 bytesRedo Buffers 7999488 bytescontents of Memory Script:{sql clone "alter system set db_name =''MYDB1'' comment=''Modified by RMAN duplicate'' scope=spfile";sql clone "alter system set db_unique_name =''DUPDB'' comment=''Modified by RMAN duplicate'' scope=spfile";shutdown clone immediate;startup clone force nomountbackup as copy current controlfile auxiliary format '/u01/data/oradata/dupdb/control01.ctl';alter clone database mount;}executing Memory Scriptsql statement: alter system set db_name = ''MYDB1'' comment= ''Modified by RMAN duplicate'' scope=spfilesql statement: alter system set db_unique_name = ''DUPDB'' comment= ''Modified by RMAN duplicate'' scope=spfileOracle instance shut downOracle instance startedTotal System Global Area 521936896 bytesFixed Size 2229944 bytesVariable Size 159385928 bytesDatabase Buffers 352321536 bytesRedo Buffers 7999488 bytesStarting backup at 20-MAY-2014 15:42:44using channel ORA_DISK_1channel ORA_DISK_1: starting datafile copycopying current control fileoutput file name=/u01/app/oracle/product/11.2.3/db_1/dbs/snapcf_mydb1.f tag=TAG20140520T154241 RECID=21 STAMP=848072563channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03Finished backup at 20-MAY-2014 15:42:47database mountedOracle instance startedTotal System Global Area 521936896 bytesFixed Size 2229944 bytesVariable Size 159385928 bytesDatabase Buffers 352321536 bytesRedo Buffers 7999488 bytescontents of Memory Script:{sql clone "alter system set db_name =''DUPDB'' comment=''Reset to original value by RMAN'' scope=spfile";sql clone "alter system reset db_unique_name scope=spfile";shutdown clone immediate;}executing Memory Scriptsql statement: alter system set db_name = ''DUPDB'' comment= ''Reset to original value by RMAN'' scope=spfilesql statement: alter system reset db_unique_name scope=spfileOracle instance shut downRMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of Duplicate Db command at 05/20/2014 15:43:01RMAN-05501: aborting duplication of target databaseRMAN-05504: at least two redo log files or groups must be specified for this commandRMAN> quitRecovery Manager complete.[oracle@node1 admin]$再次修改RUN{SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';DUPLICATE TARGET DATABASE TO 'dupdb'from active databaseLOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log') SIZE 100M REUSE,GROUP 2 ('/u01/data/onlinelog/dupdb/redo01b.log') SIZE 100M REUSE,GROUP 3 ('/u01/data/onlinelog/dupdb/redo01c.log') SIZE 100M REUSE,GROUP 4 ('/u01/data/onlinelog/dupdb/redo01d.log') SIZE 100M REUSE,GROUP 5 ('/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSEPASSWORD FILE spfileset AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'set control_files '/u01/data/oradata/dupdb/control01.ctl'set db_recovery_file_dest '/u01/data/flash_recovery_area/'set db_create_file_dest '/u01/data/oradata/dupdb/';}RMAN> RUN{SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';DUPLICATE TARGET DATABASE TO 'dupdb'from active databaseLOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log') SIZE 100M REUSE,GROUP 2 ('/u01/data/onlinelog/dupdb/redo01b.log') SIZE 100M REUSE,GROUP 3 ('/u01/data/onlinelog/dupdb/redo01c.log') SIZE 100M REUSE,GROUP 4 ('/u01/data/onlinelog/dupdb/redo01d.log') SIZE 100M REUSE,GROUP 5 ('/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSEPASSWORD FILE spfileset AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'set control_files '/u01/data/oradata/dupdb/control01.ctl'set db_recovery_file_dest '/u01/data/flash_recovery_area/'set db_create_file_dest '/u01/data/oradata/dupdb/';17> }executing command: SET NEWNAMEStarting Duplicate Db at 20-MAY-2014 15:52:20using target database control file instead of recovery catalogallocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=10 device type=DISKcontents of Memory Script:{backup as copy reusetargetfile '/u01/app/oracle/product/11.2.3/db_1/dbs/orapwmydb1' auxiliary format'/u01/app/oracle/product/11.2.3/db_1/dbs/orapwdupdb' targetfile'/u01/app/oracle/product/11.2.3/db_1/dbs/spfilemydb1.ora' auxiliary format'/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora' ;sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''";}executing Memory ScriptStarting backup at 20-MAY-2014 15:52:21allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=34 device type=DISKFinished backup at 20-MAY-2014 15:52:23sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.3/db_1/dbs/spfiledupdb.ora''contents of Memory Script:{sql clone "alter system set db_name =''DUPDB'' comment=''duplicate'' scope=spfile";sql clone "alter system set AUDIT_FILE_DEST =''/u01/app/oracle/admin/mydb1/adump/'' comment='''' scope=spfile";sql clone "alter system set control_files =''/u01/data/oradata/dupdb/control01.ctl'' comment='''' scope=spfile";sql clone "alter system set db_recovery_file_dest =''/u01/data/flash_recovery_area/'' comment='''' scope=spfile";sql clone "alter system set db_create_file_dest =''/u01/data/oradata/dupdb/'' comment='''' scope=spfile";shutdown clone immediate;startup clone nomount;}executing Memory Scriptsql statement: alter system set db_name = ''DUPDB'' comment= ''duplicate'' scope=spfilesql statement: alter system set AUDIT_FILE_DEST = ''/u01/app/oracle/admin/mydb1/adump/'' comment= '''' scope=spfilesql statement: alter system set control_files = ''/u01/data/oradata/dupdb/control01.ctl'' comment= '''' scope=spfilesql statement: alter system set db_recovery_file_dest = ''/u01/data/flash_recovery_area/'' comment= '''' scope=spfilesql statement: alter system set db_create_file_dest = ''/u01/data/oradata/dupdb/'' comment= '''' scope=spfileOracle instance shut downconnected to auxiliary database (not started)Oracle instance startedTotal System Global Area 521936896 bytesFixed Size 2229944 bytesVariable Size 159385928 bytesDatabase Buffers 352321536 bytesRedo Buffers 7999488 bytescontents of Memory Script:{sql clone "alter system set db_name =''MYDB1'' comment=''Modified by RMAN duplicate'' scope=spfile";sql clone "alter system set db_unique_name =''DUPDB'' comment=''Modified by RMAN duplicate'' scope=spfile";shutdown clone immediate;startup clone force nomountbackup as copy current controlfile auxiliary format '/u01/data/oradata/dupdb/control01.ctl';alter clone database mount;}executing Memory Scriptsql statement: alter system set db_name = ''MYDB1'' comment= ''Modified by RMAN duplicate'' scope=spfilesql statement: alter system set db_unique_name = ''DUPDB'' comment= ''Modified by RMAN duplicate'' scope=spfileOracle instance shut downOracle instance startedTotal System Global Area 521936896 bytesFixed Size 2229944 bytesVariable Size 159385928 bytesDatabase Buffers 352321536 bytesRedo Buffers 7999488 bytesStarting backup at 20-MAY-2014 15:52:39using channel ORA_DISK_1channel ORA_DISK_1: starting datafile copycopying current control fileoutput file name=/u01/app/oracle/product/11.2.3/db_1/dbs/snapcf_mydb1.f tag=TAG20140520T155236 RECID=22 STAMP=848073157channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07Finished backup at 20-MAY-2014 15:52:46database mountedcontents of Memory Script:{sql clone 'alter database flashback off';set newname for datafile 1 to"/u01/data/oradata/dupdb/system01.dbf";set newname for datafile 2 to"/u01/data/oradata/dupdb/sysaux01.dbf";set newname for datafile 3 to"/u01/data/oradata/dupdb/undotbs101.dbf";set newname for datafile 4 to"/u01/data/oradata/dupdb/users01.dbf";set newname for datafile 7 to"/u01/data/oradata/dupdb/zabbix101.dbf";set newname for datafile 8 to"/u01/data/oradata/dupdb/hyperic0101.dbf";backup as copy reusedatafile 1 auxiliary format"/u01/data/oradata/dupdb/system01.dbf" datafile2 auxiliary format"/u01/data/oradata/dupdb/sysaux01.dbf" datafile3 auxiliary format"/u01/data/oradata/dupdb/undotbs101.dbf" datafile4 auxiliary format"/u01/data/oradata/dupdb/users01.dbf" datafile7 auxiliary format"/u01/data/oradata/dupdb/zabbix101.dbf" datafile8 auxiliary format"/u01/data/oradata/dupdb/hyperic0101.dbf" ;sql 'alter system archive log current';}executing Memory Scriptsql statement: alter database flashback offexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEStarting backup at 20-MAY-2014 15:52:53using channel ORA_DISK_1channel ORA_DISK_1: starting datafile copyinput datafile file number=00002 name=/u02/oradata/mydb1/sysaux01.dbfoutput file name=/u01/data/oradata/dupdb/sysaux01.dbf tag=TAG20140520T155251channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:06channel ORA_DISK_1: starting datafile copyinput datafile file number=00008 name=/u02/oradata/mydb1/hyperic0101.dbfoutput file name=/u01/data/oradata/dupdb/hyperic0101.dbf tag=TAG20140520T155251channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:25channel ORA_DISK_1: starting datafile copyinput datafile file number=00001 name=/u02/oradata/mydb1/system01.dbfoutput file name=/u01/data/oradata/dupdb/system01.dbf tag=TAG20140520T155251channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:15channel ORA_DISK_1: starting datafile copyinput datafile file number=00007 name=/u02/oradata/mydb1/zabbix101.dbfoutput file name=/u01/data/oradata/dupdb/zabbix101.dbf tag=TAG20140520T155251channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55channel ORA_DISK_1: starting datafile copyinput datafile file number=00003 name=/u02/oradata/mydb1/undotbs101.dbfoutput file name=/u01/data/oradata/dupdb/undotbs101.dbf tag=TAG20140520T155251channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35channel ORA_DISK_1: starting datafile copyinput datafile file number=00004 name=/u02/oradata/mydb1/users01.dbfoutput file name=/u01/data/oradata/dupdb/users01.dbf tag=TAG20140520T155251channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01Finished backup at 20-MAY-2014 16:02:12sql statement: alter system archive log currentcontents of Memory Script:{backup as copy reusearchivelog like "/u04/orafra/fast_recovery_area/mydb1/MYDB1/archivelog/2014_05_20/o1_mf_1_112_9qp302j7_.arc" auxiliary format"/u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_20/o1_mf_1_112_%u_.arc" ;catalog clone recovery area;switch clone datafile all;}executing Memory ScriptStarting backup at 20-MAY-2014 16:02:14using channel ORA_DISK_1channel ORA_DISK_1: starting archived log copyinput archived log thread=1 sequence=112 RECID=684 STAMP=848073731output file name=/u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_20/o1_mf_1_112_22p8p504_.arc RECID=0 STAMP=0channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:07Finished backup at 20-MAY-2014 16:02:21searching for all files in the recovery areaList of Files Unknown to the Database=====================================File Name: /u01/data/flash_recovery_area/DUPDB/flashback/o1_mf_9qp1vvnt_.flbFile Name: /u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_20/o1_mf_1_112_22p8p504_.arccataloging files...cataloging doneList of Cataloged Files=======================File Name: /u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_20/o1_mf_1_112_22p8p504_.arcList of Files Which Where Not Cataloged=======================================File Name: /u01/data/flash_recovery_area/DUPDB/flashback/o1_mf_9qp1vvnt_.flbRMAN-07529: Reason: catalog is not supported for this file typedatafile 1 switched to datafile copyinput datafile copy RECID=22 STAMP=848073742 file name=/u01/data/oradata/dupdb/system01.dbfdatafile 2 switched to datafile copyinput datafile copy RECID=23 STAMP=848073742 file name=/u01/data/oradata/dupdb/sysaux01.dbfdatafile 3 switched to datafile copyinput datafile copy RECID=24 STAMP=848073742 file name=/u01/data/oradata/dupdb/undotbs101.dbfdatafile 4 switched to datafile copyinput datafile copy RECID=25 STAMP=848073742 file name=/u01/data/oradata/dupdb/users01.dbfdatafile 7 switched to datafile copyinput datafile copy RECID=26 STAMP=848073742 file name=/u01/data/oradata/dupdb/zabbix101.dbfdatafile 8 switched to datafile copyinput datafile copy RECID=27 STAMP=848073742 file name=/u01/data/oradata/dupdb/hyperic0101.dbfcontents of Memory Script:{set until scn 28113067;recoverclone databasedelete archivelog;}executing Memory Scriptexecuting command: SET until clauseStarting recover at 20-MAY-2014 16:02:22allocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=133 device type=DISKstarting media recoveryarchived log for thread 1 with sequence 112 is already on disk as file /u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_20/o1_mf_1_112_22p8p504_.arcarchived log file name=/u01/data/flash_recovery_area/DUPDB/archivelog/2014_05_20/o1_mf_1_112_22p8p504_.arc thread=1 sequence=112media recovery complete, elapsed time: 00:00:04Finished recover at 20-MAY-2014 16:02:28Oracle instance startedTotal System Global Area 521936896 bytesFixed Size 2229944 bytesVariable Size 159385928 bytesDatabase Buffers 352321536 bytesRedo Buffers 7999488 bytescontents of Memory Script:{sql clone "alter system set db_name =''DUPDB'' 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 Scriptsql statement: alter system set db_name = ''DUPDB'' comment= ''Reset to original value by RMAN'' scope=spfilesql statement: alter system reset db_unique_name scope=spfileOracle instance shut downconnected to auxiliary database (not started)Oracle instance startedTotal System Global Area 521936896 bytesFixed Size 2229944 bytesVariable Size 159385928 bytesDatabase Buffers 352321536 bytesRedo Buffers 7999488 bytessql statement: CREATE CONTROLFILE REUSE SET DATABASE "DUPDB" RESETLOGS ARCHIVELOGMAXLOGFILES 192MAXLOGMEMBERS 3MAXDATAFILES 1024MAXINSTANCES 32MAXLOGHISTORY 292LOGFILEGROUP 1 ( '/u01/data/onlinelog/dupdb/redo01a.log' ) SIZE 100 M REUSE,GROUP 2 ( '/u01/data/onlinelog/dupdb/redo01b.log' ) SIZE 100 M REUSE,GROUP 3 ( '/u01/data/onlinelog/dupdb/redo01c.log' ) SIZE 100 M REUSE,GROUP 4 ( '/u01/data/onlinelog/dupdb/redo01d.log' ) SIZE 100 M REUSE,GROUP 5 ( '/u01/data/onlinelog/dupdb/redo01e.log' ) SIZE 100 M REUSEDATAFILE'/u01/data/oradata/dupdb/system01.dbf'CHARACTER SET AL32UTF8contents of Memory Script:{set newname for tempfile 1 to"/u01/data/oradata/dupdb/temp01.dbf";switch clone tempfile all;catalog clone datafilecopy "/u01/data/oradata/dupdb/sysaux01.dbf","/u01/data/oradata/dupdb/undotbs101.dbf","/u01/data/oradata/dupdb/users01.dbf","/u01/data/oradata/dupdb/zabbix101.dbf","/u01/data/oradata/dupdb/hyperic0101.dbf";switch clone datafile all;}executing Memory Scriptexecuting command: SET NEWNAMErenamed tempfile 1 to /u01/data/oradata/dupdb/temp01.dbf in control filecataloged datafile copydatafile copy file name=/u01/data/oradata/dupdb/sysaux01.dbf RECID=1 STAMP=848073760cataloged datafile copydatafile copy file name=/u01/data/oradata/dupdb/undotbs101.dbf RECID=2 STAMP=848073760cataloged datafile copydatafile copy file name=/u01/data/oradata/dupdb/users01.dbf RECID=3 STAMP=848073760cataloged datafile copydatafile copy file name=/u01/data/oradata/dupdb/zabbix101.dbf RECID=4 STAMP=848073760cataloged datafile copydatafile copy file name=/u01/data/oradata/dupdb/hyperic0101.dbf RECID=5 STAMP=848073760datafile 2 switched to datafile copyinput datafile copy RECID=1 STAMP=848073760 file name=/u01/data/oradata/dupdb/sysaux01.dbfdatafile 3 switched to datafile copyinput datafile copy RECID=2 STAMP=848073760 file name=/u01/data/oradata/dupdb/undotbs101.dbfdatafile 4 switched to datafile copyinput datafile copy RECID=3 STAMP=848073760 file name=/u01/data/oradata/dupdb/users01.dbfdatafile 7 switched to datafile copyinput datafile copy RECID=4 STAMP=848073760 file name=/u01/data/oradata/dupdb/zabbix101.dbfdatafile 8 switched to datafile copyinput datafile copy RECID=5 STAMP=848073760 file name=/u01/data/oradata/dupdb/hyperic0101.dbfcontents of Memory Script:{Alter clone database open resetlogs;}executing Memory Scriptdatabase openedReenabling controlfile options for auxiliary databaseExecuting: alter database flashback onFinished Duplicate Db at 20-MAY-2014 16:02:59RMAN>15:52开始执行,终于开始duplicate啦,期间登录source端看dm-16读操作比较多datavg-lvoradate (dm-16) 253:16 0 20G 0 lvm /u02刚好是数据文件存放的分区.结束以后,检查一下SQL> select INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,VERSION,STATUS from v$instance;INSTANCE_NUMBER INSTANCE_NAME HOST_NAME VERSION STATUS--------------- ---------------- ---------------------------------------------------------------- ----------------- ------------1 dupdb node1 11.2.0.3.0 OPENSQL>SQL> select FILE#,BYTES/1024/1024,name from v$tempfile;FILE# BYTES/1024/1024 NAME---------- --------------- --------------------------------------------------1 37 /u01/data/oradata/dupdb/temp01.dbfSQL>SQL> select file#,BYTES/1024/1024,name from v$datafile;FILE# BYTES/1024/1024 NAME---------- --------------- --------------------------------------------------1 760 /u01/data/oradata/dupdb/system01.dbf2 1450 /u01/data/oradata/dupdb/sysaux01.dbf3 365 /u01/data/oradata/dupdb/undotbs101.dbf4 5 /u01/data/oradata/dupdb/users01.dbf7 500 /u01/data/oradata/dupdb/zabbix101.dbf8 2048 /u01/data/oradata/dupdb/hyperic0101.dbf6 rows selected.SQL>SQL>select name from v$datafileunion allselect name from v$tempfileunion allselect name from v$controlfileunion all7 select member from v$logfile;NAME--------------------------------------------------/u01/data/oradata/dupdb/system01.dbf/u01/data/oradata/dupdb/sysaux01.dbf/u01/data/oradata/dupdb/undotbs101.dbf/u01/data/oradata/dupdb/users01.dbf/u01/data/oradata/dupdb/zabbix101.dbf/u01/data/oradata/dupdb/hyperic0101.dbf/u01/data/oradata/dupdb/temp01.dbf/u01/data/oradata/dupdb/control01.ctl/u01/data/onlinelog/dupdb/redo01e.log/u01/data/onlinelog/dupdb/redo01d.log/u01/data/onlinelog/dupdb/redo01c.logNAME--------------------------------------------------/u01/data/onlinelog/dupdb/redo01b.log/u01/data/onlinelog/dupdb/redo01a.log13 rows selected.SQL>最终的脚本RUN{SET NEWNAME FOR DATABASE TO '/u01/data/oradata/dupdb/%b';DUPLICATE TARGET DATABASE TO 'dupdb'from active databaseLOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log') SIZE 100M REUSE,GROUP 2 ('/u01/data/onlinelog/dupdb/redo01b.log') SIZE 100M REUSE,GROUP 3 ('/u01/data/onlinelog/dupdb/redo01c.log') SIZE 100M REUSE,GROUP 4 ('/u01/data/onlinelog/dupdb/redo01d.log') SIZE 100M REUSE,GROUP 5 ('/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSEPASSWORD FILE spfileset AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'set control_files '/u01/data/oradata/dupdb/control01.ctl'set db_recovery_file_dest '/u01/data/flash_recovery_area/'set db_create_file_dest '/u01/data/oradata/dupdb/';}修改一下也可以RUN{SET NEWNAME FOR DATAFILE 1 TO /u01/data/oradata/dupdb/system01.dbf;SET NEWNAME FOR DATAFILE 2 TO /u01/data/oradata/dupdb/sysaux01.dbf;SET NEWNAME FOR DATAFILE 3 TO /u01/data/oradata/dupdb/undotbs101.dbf;SET NEWNAME FOR DATAFILE 4 TO /u01/data/oradata/dupdb/users01.dbf;SET NEWNAME FOR DATAFILE 7 TO /u01/data/oradata/dupdb/zabbix101.dbf;SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic0101.dbf;SET NEWNAME FOR TEMPFILE 1 TO /u01/data/oradata/dupdb/temp01.dbf;DUPLICATE TARGET DATABASE TO 'dupdb'from active databaseLOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log') SIZE 100M REUSE,GROUP 2 ('/u01/data/onlinelog/dupdb/redo01b.log') SIZE 100M REUSE,GROUP 3 ('/u01/data/onlinelog/dupdb/redo01c.log') SIZE 100M REUSE,GROUP 4 ('/u01/data/onlinelog/dupdb/redo01d.log') SIZE 100M REUSE,GROUP 5 ('/u01/data/onlinelog/dupdb/redo01e.log') SIZE 100M REUSEPASSWORD FILEspfileset AUDIT_FILE_DEST '/u01/app/oracle/admin/mydb1/adump/'set control_files '/u01/data/oradata/dupdb/control01.ctl'set db_recovery_file_dest '/u01/data/flash_recovery_area/'set db_create_file_dest '/u01/data/oradata/dupdb/';}测试一下
3> SET NEWNAME FOR DATAFILE 1 TO /u01/data/oradata/dupdb/system01.dbf;SET NEWNAME FOR DATAFILE 1 TO /u01/data/oradata/dupdb/system01.dbf;RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-00558: error encountered while parsing input commandsRMAN-01006: error signaled during parseRMAN-02001: unrecognized punctuation symbol "/"SET NEWNAME FOR DATAFILE 2 TO /u01/data/oradata/dupdb/sysaux01.dbf;SET NEWNAME FOR DATAFILE 2 TO /u01/data/oradata/dupdb/sysaux01.dbf;SET NEWNAME FOR DATAFILE 3 TO /u01/data/oradata/dupdb/undotbs101.dbf;SET NEWNAME FOR DATAFILE 3 TO /u01/data/oradata/dupdb/undotbs101.dbf;RMAN>RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-00558: error encountered while parsing input commandsRMAN-01006: error signaled during parseRMAN-02001: unrecognized punctuation symbol "/"SET NEWNAME FOR DATAFILE 4 TO /u01/data/oradata/dupdb/users01.dbf;SET NEWNAME FOR DATAFILE 4 TO /u01/data/oradata/dupdb/users01.dbf;SET NEWNAME FOR DATAFILE 7 TO /SET NEWNAME FOR DATAFILE 7 TO /RMAN>SET NEWNAME FOR DATAFILE 7 TO /RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-00558: error encountered while parsing input commandsRMAN-01006: error signaled during parseRMAN-02001: unrecognized punctuation symbol "/"SET NEWNAME FOR DATAFILE 7 TO /u01/data/oradata/dupdb/zabbix101.dbf;SET NEWNAME FOR DATAFILE 7 TO /u01/data/oradata/dupdb/zabbix101.dbf;SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic01SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic010RMAN>RMAN> SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic010RMAN>SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic010RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-00558: error encountered while parsing input commandsRMAN-01006: error signaled during parseRMAN-02001: unrecognized punctuation symbol "/"SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic0101.dbf;}SET NEWNAME FOR DATAFILE 8 TO /u01/data/oradata/dupdb/hyperic0101.dbf;SET NEWNAME FOR TEMPFILE 1 TO /u01/data/oSET NEWNAME FOR TEMPFILE 1 TO /u01/data/oRMAN>SET NEWNAME FOR TEMPFILE 1 TO /u01/data/oRMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-00558: error encountered while parsing input commandsRMAN-01006: error signaled during parseRMAN-02001: unrecognized punctuation symbol "/"SET NEWNAME FOR TEMPFILE 1 TO /u01/data/oradata/dupdb/temp01.dbf;SET NEWNAME FOR TEMPFILE 1 TO /u01/data/oradata/dupdb/temp01.dbf;RMAN>RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-00558: error encountered while parsing input commandsRMAN-01006: error signaled during parseRMAN-02001: unrecognized punctuation symbol "/"DUPLICATE TARGET DATABASE TO 'dupdb'DUPLICATE TARGET DATABASE TO 'dupdb'from active databasefrom active databaseRMAN>RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-00558: error encountered while parsing input commandsRMAN-01006: error signaled during parseRMAN-02001: unrecognized punctuation symbol "/"LOGFILELOGFILEGROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log')SIZE 100M REUSE,GROUP 1 ('/u01/data/onlinelog/dupdb/redo01a.log') SIZE 100M REUSE,RMAN>RMAN> 2> 3> 4>