今天用rman做异地恢复,在恢复控制文件的时候出现了一个错误:
bash-3.00$ rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on 星期四 9月 27 00:18:55 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: tradedb (not mounted)
RMAN> restore controlfile from '/data/backup/tradedb/62isntt2_1_1';
Starting restore at 27-9月 -07
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=313 instance=prerac1 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/27/2007 00:19:34
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece
一开始是怀疑备份片中不包含spfile,于是从源库查了一下:
RMAN> list backup of controlfile;
备份集列表
===================
BS 关键字 类型 LV 大小
------- ---- -- ----------
191 Full 23.38G
包括的控制文件: Ckp SCN: 5631940113 Ckp 时间: 24-9月 -07
备份集 副本号 1 属于备份集 191
设备类型 经过时间 完成时间 压缩标记
----------- ------------ ---------- ---------- ---
DISK 00:08:52 24-9月 -07 NO TAG20070924T093632
备份集 191 副本号 1的备份段列表
BP 关键字 Pc# 状态 段名称
------- --- ----------- ----------
197 1 AVAILABLE /data/backup/tradedb/62isntt2_1_1
可以发现,源备份集是包含了控制文件的。既然备份集名称没有错,那可能是在ftp传送时出问题了,但是用ls -l查看两个文件大小是一样的。
出现这种情况还有一种可能:权限不足。于是看了一下当前备份集的权限情况:
bash-3.00$ ls -l /data/backup/tradedb/62isntt2_1_1
-rw-r----- 1 root root 25101238272 Sep 25 22:35 /data/backup/tradedb/62isntt2_1_1
果然,oracle是没有权限读取这个文件的,重新授权:
bash-3.00$ cd /data/backup/tradedb
bash-3.00$ ls
61isntt1_1_1 62isntt2_1_1 64isnvm0_1_1 65iso00i_1_1 lost+found soft
bash-3.00$ chmod a+r 6*
接着用rman恢复就没有问题了:
bash-3.00$ export ORACLE_SID=prerac1
bash-3.00$ rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on 星期四 9月 27 00:35:47 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: tradedb (not mounted)
RMAN> restore controlfile from '/data/backup/tradedb/62isntt2_1_1';
Starting restore at 27-9月 -07
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=316 instance=prerac1 devtype=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:17
output filename=+DATA/controlfile/control1
output filename=+DATA/controlfile/control2
output filename=+DATA/controlfile/control3
Finished restore at 27-9月 -07
小小问题,简单记录一下。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/231499/viewspace-63859/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/231499/viewspace-63859/