Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jan 11 15:32:10 2016
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1427785672)
connected to auxiliary database: PROD (not mounted)
RMAN> DUPLICATE TARGET DATABASE TO PROD FROM ACTIVE DATABASE
2> spfile PARAMETER_VALUE_CONVERT 'ORCL','PROD'
3> set CONTROL_FILES='/u01/app/oracle/oradata/PROD/control01.ctl','/u01/app/oracle/fast_recovery_area/PROD/control02.ctl'
4> set DB_FILE_NAME_CONVERT='ORCL','PROD'
5> set LOG_FILE_NAME_CONVERT='ORCL','PROD';
执行最后报错
Oracle instance shut down
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 01/11/2016 15:33:46
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 01/11/2016 15:33:37
ORA-17628: Oracle error 19505 returned by remote Oracle server
Report of database schema for database with db_unique_name ORCL
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 740 SYSTEM *** /u02/app/oracle/oradata/ORCL/system01.dbf
2 520 SYSAUX *** /u02/app/oracle/oradata/ORCL/sysaux01.dbf
3 70 UNDOTBS1 *** /u02/app/oracle/oradata/ORCL/undotbs01.dbf
4 5 USERS *** /u02/app/oracle/oradata/ORCL/users01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 20 TEMP 32767 /u01/app/oracle/oradata/ORCL/temp01.dbf
然后就发现了问题,怎么数据文件没有在它通常的位置?突然想起,前几天还做了一些改路径的操作。再回头看rman报出的日志
Starting backup at 2016-01-11 15:33:33
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u02/app/oracle/oradata/ORCL/system01.dbf
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 01/11/2016 15:33:34
ORA-17628: Oracle error 19505 returned by remote Oracle server
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u02/app/oracle/oradata/ORCL/sysaux01.dbf
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 01/11/2016 15:33:35
ORA-17628: Oracle error 19505 returned by remote Oracle server
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u02/app/oracle/oradata/ORCL/undotbs01.dbf
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 01/11/2016 15:33:36
ORA-17628: Oracle error 19505 returned by remote Oracle server
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u02/app/oracle/oradata/ORCL/users01.dbf
Oracle instance started
contents of Memory Script:
{
sql clone "alter system set db_name =
''PROD'' comment=
''Reset to original value by RMAN'' scope=spfile";
sql clone "alter system reset db_unique_name scope=spfile";
shutdown clone immediate;
}
connected to auxiliary database: PROD (not mounted)
RMAN> DUPLICATE TARGET DATABASE TO PROD FROM ACTIVE DATABASE
2> spfile PARAMETER_VALUE_CONVERT 'ORCL','PROD'
3> set CONTROL_FILES='/u01/app/oracle/oradata/PROD/control01.ctl','/u01/app/oracle/fast_recovery_area/PROD/control02.ctl'
4> set DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/ORCL','/u01/app/oracle/oradata/PROD','/u02/app/oracle/oradata/ORCL','/u01/app/oracle/oradata/PROD'
5> set LOG_FILE_NAME_CONVERT='ORCL','PROD';
Starting Duplicate Db at 2016-01-11 15:54:32
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK
contents of Memory Script:
{
backup as copy reuse
targetfile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileORCL.ora' auxiliary format
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilePROD.ora' ;
sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilePROD.ora''";
}
executing Memory Script
Starting backup at 2016-01-11 15:54:32
using channel ORA_DISK_1
Finished backup at 2016-01-11 15:54:34
sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilePROD.ora''
contents of Memory Script:
{
sql clone "alter system set db_name =
''PROD'' comment=
''duplicate'' scope=spfile";
sql clone "alter system set audit_file_dest =
''/u01/app/oracle/admin/PROD/adump'' comment=
'''' scope=spfile";
sql clone "alter system set dispatchers =
''(PROTOCOL=TCP) (SERVICE=PRODXDB)'' comment=
'''' scope=spfile";
sql clone "alter system set CONTROL_FILES =
''/u01/app/oracle/oradata/PROD/control01.ctl'', ''/u01/app/oracle/fast_recovery_area/PROD/control02.ctl'' comment=
'''' scope=spfile";
sql clone "alter system set db_file_name_convert =
''/u01/app/oracle/oradata/ORCL'', ''/u01/app/oracle/oradata/PROD'', ''/u02/app/oracle/oradata/ORCL'', ''/u01/app/oracle/oradata/PROD'' comment=
'''' scope=spfile";
sql clone "alter system set LOG_FILE_NAME_CONVERT =
''ORCL'', ''PROD'' comment=
'''' scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
sql statement: alter system set db_name = ''PROD'' comment= ''duplicate'' scope=spfile
sql statement: alter system set audit_file_dest = ''/u01/app/oracle/admin/PROD/adump'' comment= '''' scope=spfile
sql statement: alter system set dispatchers = ''(PROTOCOL=TCP) (SERVICE=PRODXDB)'' comment= '''' scope=spfile
sql statement: alter system set CONTROL_FILES = ''/u01/app/oracle/oradata/PROD/control01.ctl'', ''/u01/app/oracle/fast_recovery_area/PROD/control02.ctl'' comment= '''' scope=spfile
sql statement: alter system set db_file_name_convert = ''/u01/app/oracle/oradata/ORCL'', ''/u01/app/oracle/oradata/PROD'', ''/u02/app/oracle/oradata/ORCL'', ''/u01/app/oracle/oradata/PROD'' comment= '''' scope=spfile
sql statement: alter system set LOG_FILE_NAME_CONVERT = ''ORCL'', ''PROD'' comment= '''' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
contents of Memory Script:
{
sql clone "alter system set db_name =
''ORCL'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''PROD'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format '/u01/app/oracle/oradata/PROD/control01.ctl';
restore clone controlfile to '/u01/app/oracle/fast_recovery_area/PROD/control02.ctl' from
'/u01/app/oracle/oradata/PROD/control01.ctl';
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''PROD'' comment= ''Modified by RMAN duplicate'' scope=spfile
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 2016-01-11 15:54:49
database mounted
contents of Memory Script:
{
set newname for datafile 1 to
"/u01/app/oracle/oradata/PROD/system01.dbf";
set newname for datafile 2 to
"/u01/app/oracle/oradata/PROD/sysaux01.dbf";
set newname for datafile 3 to
"/u01/app/oracle/oradata/PROD/undotbs01.dbf";
set newname for datafile 4 to
"/u01/app/oracle/oradata/PROD/users01.dbf";
backup as copy reuse
datafile 1 auxiliary format
"/u01/app/oracle/oradata/PROD/system01.dbf" datafile
2 auxiliary format
"/u01/app/oracle/oradata/PROD/sysaux01.dbf" datafile
3 auxiliary format
"/u01/app/oracle/oradata/PROD/undotbs01.dbf" datafile
4 auxiliary format
"/u01/app/oracle/oradata/PROD/users01.dbf" ;
sql 'alter system archive log current';
}
executing Memory Script
List of Files Unknown to the Database
=====================================
File Name: /u01/app/oracle/fast_recovery_area/PROD/archivelog/2016_01_11/o1_mf_1_23_1sqr45ng_.arc
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u01/app/oracle/fast_recovery_area/PROD/archivelog/2016_01_11/o1_mf_1_23_1sqr45ng_.arc
List of files in Recovery Area not managed by the database
==========================================================
File Name: /u01/app/oracle/fast_recovery_area/PROD/control02.ctl
RMAN-07526: Reason: File is not an Oracle Managed File
number of files not managed by recovery area is 1, totaling 9.28MB
contents of Memory Script:
{
set until scn 1026162;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 2016-01-11 15:55:29
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 23 is already on disk as file /u01/app/oracle/fast_recovery_area/PROD/archivelog/2016_01_11/o1_mf_1_23_1sqr45ng_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/PROD/archivelog/2016_01_11/o1_mf_1_23_1sqr45ng_.arc thread=1 sequence=23
media recovery complete, elapsed time: 00:00:00
Finished recover at 2016-01-11 15:55:30
Oracle instance started
contents of Memory Script:
{
sql clone "alter system set db_name =
''PROD'' 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
sql statement: alter system set db_name = ''PROD'' 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 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 536874064 bytes
Database Buffers 289406976 bytes
Redo Buffers 6565888 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "PROD" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/u01/app/oracle/oradata/PROD/redo01.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/u01/app/oracle/oradata/PROD/redo02.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/u01/app/oracle/oradata/PROD/redo03.log' ) SIZE 50 M REUSE
DATAFILE
'/u01/app/oracle/oradata/PROD/system01.dbf'
CHARACTER SET AL32UTF8
contents of Memory Script:
{
set newname for tempfile 1 to
"/u01/app/oracle/oradata/PROD/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u01/app/oracle/oradata/PROD/sysaux01.dbf",
"/u01/app/oracle/oradata/PROD/undotbs01.dbf",
"/u01/app/oracle/oradata/PROD/users01.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u01/app/oracle/oradata/PROD/temp01.dbf in control file