-bash-3.2$ rman target / auxiliary sys/password@standby
Recovery Manager: Release 10.2.0.4.0 - Production on Wed Feb 8 22:01:47 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: port (DBID=2726356005)
connected to auxiliary database: port (not mounted)
RMAN> run{
allocate channel c1 device type disk format '/u01/rmanbak/forstandby/%U' connect sys/password@port;
allocate auxiliary channel ac1 device type disk format '/u01/rmanbak/forstandby/%U';
duplicate target database for standby;
}2> 3> 4> 5>
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: sid=114 devtype=DISK
allocated channel: ac1
channel ac1: sid=318 devtype=DISK
Starting Duplicate Db at 2012-02-08 22:02:16
contents of Memory Script:
{
restore clone standby controlfile;
sql clone 'alter database mount standby database';
}
executing Memory Script
Starting restore at 2012-02-08 22:02:16
channel ac1: starting datafile backupset restore
channel ac1: restoring control file
channel ac1: reading from backup piece /u01/rmanbak/forstandby/ctl/CON_17n2r6q5_1_1
ORA-19870: error reading backup piece /u01/rmanbak/forstandby/ctl/CON_17n2r6q5_1_1
ORA-19505: failed to identify file "/u01/rmanbak/forstandby/ctl/CON_17n2r6q5_1_1"
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
failover to previous backup
released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 02/08/2012 22:02:19
RMAN-03015: error occurred in stored script Memory Script
RMAN-06026: some targets not found - aborting restore
RMAN-06024: no backup or copy of the control file found to restore
#########################################################################################
=======================错误原因,从库备份文件放置路径和主库不一致========================
#########################################################################################
RMAN>
RMAN>
RMAN> run{
allocate channel c1 device type disk format '/u01/rmanbak/forstandby/%U' connect sys/password@port;
allocate auxiliary channel ac1 device type disk format '/u01/rmanbak/forstandby/%U';
duplicate target database for standby;
}2> 3> 4> 5>
allocated channel: c1
channel c1: sid=114 devtype=DISK
allocated channel: ac1
channel ac1: sid=318 devtype=DISK
Starting Duplicate Db at 2012-02-08 22:04:35
contents of Memory Script:
{
restore clone standby controlfile;
sql clone 'alter database mount standby database';
}
executing Memory Script
Starting restore at 2012-02-08 22:04:35
channel ac1: starting datafile backupset restore
channel ac1: restoring control file
channel ac1: reading from backup piece /u01/rmanbak/forstandby/ctl/CON_17n2r6q5_1_1
channel ac1: restored backup piece 1
piece handle=/u01/rmanbak/forstandby/ctl/CON_17n2r6q5_1_1 tag=TAG20120208T214644
channel ac1: restore complete, elapsed time: 00:00:01
output filename=/u01/oracle/oradata/port/control01.ctl
output filename=/u01/oracle/oradata/port/control02.ctl
output filename=/u01/oracle/oradata/port/control03.ctl
Finished restore at 2012-02-08 22:04:36
sql statement: alter database mount standby database
released channel: c1
released channel: ac1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 02/08/2012 22:04:41
RMAN-05501: aborting duplication of target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/cuteinfo.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/cuteinfo_index.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/cuteinfo_data.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/zghgzz_index.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/zghgzz_data.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/chicago_index.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/chicago_data.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/chicago.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/wms_index.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/wms_data.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/system02.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/rman_catalog.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/users01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/sysaux01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/undotbs01.dbf conflicts with a file used by the target database
RMAN-05001: auxiliary filename /u01/oracle/oradata/port/system01.dbf conflicts with a file used by the target database
#########################################################################################
===============错误原因,主库和从库目录结构一致,为防止异常覆盖,出以上报错==============
===============可以用duplicate target database for standby nofilenamecheck;方法解决======
#########################################################################################
RMAN>duplicate target database for standby nofilenamecheck;
Starting Duplicate Db at 2012-02-08 22:08:59
using channel ORA_AUX_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 02/08/2012 22:08:59
RMAN-05500: the auxiliary database must be not mounted when issuing a DUPLICATE command
RMAN> exit
Recovery Manager complete.
-bash-3.2$ rman target / auxiliary sys/password@standby
Recovery Manager: Release 10.2.0.4.0 - Production on Wed Feb 8 22:09:52 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: port (DBID=2726356005)
connected to auxiliary database: port (DBID=2726356005, not open)
RMAN> duplicate target database for standby nofilenamecheck;
Starting Duplicate Db at 2012-02-08 22:10:05
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=320 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 02/08/2012 22:10:05
RMAN-05500: the auxiliary database must be not mounted when issuing a DUPLICATE command
#########################################################################################
======================错误原因,从库状态不对,应该在NOMOUNT状态下========================
#########################################################################################
RMAN>
RMAN> exit
Recovery Manager complete.
-bash-3.2$ rman target / auxiliary sys/password@standby
Recovery Manager: Release 10.2.0.4.0 - Production on Wed Feb 8 22:21:28 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: port (not mounted)
connected to auxiliary database: port (DBID=2726356005, not open)
RMAN> duplicate target database for standby nofilenamecheck;
Starting Duplicate Db at 2012-02-08 22:21:54
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=156 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 02/08/2012 22:21:55
RMAN-05502: the target database must be mounted when issuing a DUPLICATE command
#########################################################################################
======================错误原因,主库状态不对,应该在MOUNT状态下==========================
#########################################################################################
RMAN> exit
Recovery Manager complete.
-bash-3.2$ rman target / auxiliary sys/password@standby
Recovery Manager: Release 10.2.0.4.0 - Production on Wed Feb 8 22:24:49 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: port (DBID=2726356005, not open)
connected to auxiliary database: port (not mounted)
#########################################################################################
==================主库在MOUNT状态下,从库在NOMOUNT状态下才能执行如下语句=================
==================duplicate target database for standby nofilenamecheck==================
#########################################################################################
RMAN> duplicate target database for standby nofilenamecheck;
Starting Duplicate Db at 2012-02-08 22:25:11
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=155 devtype=DISK
contents of Memory Script:
{
restore clone standby controlfile;
sql clone 'alter database mount standby database';
}
executing Memory Script
Starting restore at 2012-02-08 22:25:12
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /u01/rmanbak/forstandby/ctl/CON_17n2r6q5_1_1
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/u01/rmanbak/forstandby/ctl/CON_17n2r6q5_1_1 tag=TAG20120208T214644
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:04
output filename=/u01/oracle/oradata/port/control01.ctl
output filename=/u01/oracle/oradata/port/control02.ctl
output filename=/u01/oracle/oradata/port/control03.ctl
Finished restore at 2012-02-08 22:25:16
sql statement: alter database mount standby database
released channel: ORA_AUX_DISK_1
contents of Memory Script:
{
set newname for tempfile 1 to
"/u01/oracle/oradata/port/temp01.dbf";
switch clone tempfile all;
set newname for datafile 1 to
"/u01/oracle/oradata/port/system01.dbf";
set newname for datafile 2 to
"/u01/oracle/oradata/port/undotbs01.dbf";
set newname for datafile 3 to
"/u01/oracle/oradata/port/sysaux01.dbf";
set newname for datafile 4 to
"/u01/oracle/oradata/port/users01.dbf";
set newname for datafile 5 to
"/u01/oracle/oradata/port/rman_catalog.dbf";
set newname for datafile 6 to
"/u01/oracle/oradata/port/system02.dbf";
set newname for datafile 7 to
"/u01/oracle/oradata/port/ms_data.dbf";
set newname for datafile 8 to
"/u01/oracle/oradata/port/ms_index.dbf";
set newname for datafile 9 to
"/u01/oracle/oradata/port/cago.dbf";
set newname for datafile 10 to
"/u01/oracle/oradata/port/cago_data.dbf";
set newname for datafile 11 to
"/u01/oracle/oradata/port/cago_index.dbf";
set newname for datafile 12 to
"/u01/oracle/oradata/port/chinazz_data.dbf";
set newname for datafile 13 to
"/u01/oracle/oradata/port/chinazz_index.dbf";
set newname for datafile 14 to
"/u01/oracle/oradata/port/info_data.dbf";
set newname for datafile 15 to
"/u01/oracle/oradata/port/info_index.dbf";
set newname for datafile 16 to
"/u01/oracle/oradata/port/info.dbf";
restore
check readonly
clone database
;
}
executing Memory Script
executing command: SET NEWNAME
renamed temporary file 1 to /u01/oracle/oradata/port/temp01.dbf in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
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 restore at 2012-02-08 22:25:22
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=155 devtype=DISK
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/oracle/oradata/port/system01.dbf
restoring datafile 00002 to /u01/oracle/oradata/port/undotbs01.dbf
restoring datafile 00003 to /u01/oracle/oradata/port/sysaux01.dbf
restoring datafile 00004 to /u01/oracle/oradata/port/users01.dbf
restoring datafile 00005 to /u01/oracle/oradata/port/rman_catalog.dbf
restoring datafile 00006 to /u01/oracle/oradata/port/system02.dbf
restoring datafile 00007 to /u01/oracle/oradata/port/ms_data.dbf
restoring datafile 00008 to /u01/oracle/oradata/port/ms_index.dbf
restoring datafile 00009 to /u01/oracle/oradata/port/cago.dbf
restoring datafile 00010 to /u01/oracle/oradata/port/cago_data.dbf
restoring datafile 00011 to /u01/oracle/oradata/port/cago_index.dbf
restoring datafile 00012 to /u01/oracle/oradata/port/chinazz_data.dbf
restoring datafile 00013 to /u01/oracle/oradata/port/chinazz_index.dbf
restoring datafile 00014 to /u01/oracle/oradata/port/info_data.dbf
restoring datafile 00015 to /u01/oracle/oradata/port/info_index.dbf
restoring datafile 00016 to /u01/oracle/oradata/port/info.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/rmanbak/forstandby/19n2r6r9_1_1
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/u01/rmanbak/forstandby/19n2r6r9_1_1 tag=TAG20120208T214721
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:05:26
Finished restore at 2012-02-08 22:30:49
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy recid=18 stamp=774743414 filename=/u01/oracle/oradata/port/system01.dbf
datafile 2 switched to datafile copy
input datafile copy recid=19 stamp=774743414 filename=/u01/oracle/oradata/port/undotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=20 stamp=774743414 filename=/u01/oracle/oradata/port/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=21 stamp=774743414 filename=/u01/oracle/oradata/port/users01.dbf
datafile 5 switched to datafile copy
input datafile copy recid=22 stamp=774743414 filename=/u01/oracle/oradata/port/rman_catalog.dbf
datafile 6 switched to datafile copy
input datafile copy recid=23 stamp=774743414 filename=/u01/oracle/oradata/port/system02.dbf
datafile 7 switched to datafile copy
input datafile copy recid=24 stamp=774743415 filename=/u01/oracle/oradata/port/ms_data.dbf
datafile 8 switched to datafile copy
input datafile copy recid=25 stamp=774743415 filename=/u01/oracle/oradata/port/ms_index.dbf
datafile 9 switched to datafile copy
input datafile copy recid=26 stamp=774743415 filename=/u01/oracle/oradata/port/cago.dbf
datafile 10 switched to datafile copy
input datafile copy recid=27 stamp=774743415 filename=/u01/oracle/oradata/port/cago_data.dbf
datafile 11 switched to datafile copy
input datafile copy recid=28 stamp=774743415 filename=/u01/oracle/oradata/port/cago_index.dbf
datafile 12 switched to datafile copy
input datafile copy recid=29 stamp=774743415 filename=/u01/oracle/oradata/port/chinazz_data.dbf
datafile 13 switched to datafile copy
input datafile copy recid=30 stamp=774743415 filename=/u01/oracle/oradata/port/chinazz_index.dbf
datafile 14 switched to datafile copy
input datafile copy recid=31 stamp=774743415 filename=/u01/oracle/oradata/port/info_data.dbf
datafile 15 switched to datafile copy
input datafile copy recid=32 stamp=774743415 filename=/u01/oracle/oradata/port/info_index.dbf
datafile 16 switched to datafile copy
input datafile copy recid=33 stamp=774743415 filename=/u01/oracle/oradata/port/info.dbf
Finished Duplicate Db at 2012-02-08 22:30:52
RMAN>
Connection closed.
本文转自zylhsy 51CTO博客,原文链接:http://blog.51cto.com/yunlongzheng/775191,如需转载请自行联系原作者