RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece
xixuefeng
ERR, RMAN
2014-05-30 1:18:51
4,203 次浏览
RMAN-06172
RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece已关闭评论
OEL 5.6
Oracle 11.2.0.4
测试:通过控制文件自动备份恢复spfile。
数据库启用了快速恢复区,并且存在已自动备份的控制文件和参数文件,因为用如下命令恢复是没有问题的。
|
1 |
restore spfile to pfile '?/dbs/initPROD.ora' from '/u01/app/FRA/PROD/autobackup/2014_03_01/o1_mf_s_841034563_9k1x63p5_.bkp'; |
现在的问题是,既然使用了控制文件自动备份,那么,为什么通过自动备份直接恢复会报如下错误
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
[oracle@prod dbs]$ rman target / Recovery Manager: Release 11.2.0.4.0 - Production on Sat Mar 1 10:48:05 2014 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database (not started) RMAN> set dbid 3649205611 executing command: SET DBID RMAN> RMAN> startup force nomount; startup failed: ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initPROD.ora' starting Oracle instance without parameter file for retrieval of spfile Oracle instance started Total System Global Area 1068937216 bytes Fixed Size 2260088 bytes Variable Size 281019272 bytes Database Buffers 780140544 bytes Redo Buffers 5517312 bytes RMAN> RMAN> RESTORE SPFILE FROM AUTOBACKUP; Starting restore at 01-MAR-14 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=19 device type=DISK channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140301 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140228 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140227 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140226 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140225 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140224 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140223 channel ORA_DISK_1: no AUTOBACKUP in 7 days found RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of restore command at 03/01/2014 10:49:47 RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece RMAN> |
原因其实挺简单,因为数据库没有mount,也就是说,并没有打开控制文件,所以,它并不知道自动备份的目录在哪儿,如果你show all一下的话,我们可以看到,所有的配置信息均为默认值
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
RMAN> show all; RMAN configuration parameters for database with db_unique_name DUMMY are: CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default CONFIGURE MAXSETSIZE TO UNLIMITED; # default CONFIGURE ENCRYPTION FOR DATABASE OFF; # default CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default RMAN> |
有的网友说,可以指定控制文件自动备份的目录即可,不过,我指定后,还是报同样的错误,如下:(/home/oracle目录下有自动备份的控备份片)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
RMAN> set controlfile autobackup format for device type disk to '/home/oracle/%F'; executing command: SET CONTROLFILE AUTOBACKUP FORMAT RMAN> RESTORE SPFILE FROM AUTOBACKUP; Starting restore at 01-MAR-14 using channel ORA_DISK_1 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140301 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140228 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140227 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140226 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140225 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140224 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140223 channel ORA_DISK_1: no AUTOBACKUP in 7 days found RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of restore command at 03/01/2014 10:56:37 RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece RMAN> |
最后采用如下方式恢复成功
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
RMAN> restore spfile from autobackup db_recovery_file_dest='/u01/app/FRA' db_name='PROD'; Starting restore at 01-MAR-14 using channel ORA_DISK_1 recovery area destination: /u01/app/FRA database name (or database unique name) used for search: PROD channel ORA_DISK_1: AUTOBACKUP /u01/app/FRA/PROD/autobackup/2014_03_01/o1_mf_s_841034563_9k1x63p5_.bkp found in the recovery area channel ORA_DISK_1: looking for AUTOBACKUP on day: 20140301 channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/app/FRA/PROD/autobackup/2014_03_01/o1_mf_s_841034563_9k1x63p5_.bkp channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete Finished restore at 01-MAR-14 RMAN> |
当然,如果你不“较劲”的话,直接指定绝对路径,也是一样可以恢复的。