Oracle技术之ASM上恢复STANDBY数据库出现ORA-15173错误
建立STANDBY數據庫時,在ASM上恢復主庫的數據文件出現了ORA-15173錯誤。
主庫和備庫都是單實例數據庫,不過都使用ASM作為存儲方式。
在備庫上利用主庫的備份進行restore database操作,碰到了這個錯誤:
[oracle@localhost data]$ rman target /
Recovery Manager: Release 10.2.0.3.0 - Production on Sat Feb 12 14:43:29 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: MOBILEDB (DBID=3009911466, not open)
RMAN> restore database;
Starting restore at 12-FEB-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1086 devtype=DISK
file 22 is excluded from whole database backup
file 25 is excluded from whole database backup
file 28 is excluded from whole database backup
file 30 is excluded from whole database backup
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +ORADG/mobiledb/datafile/system.260.649168943
restoring datafile 00002 to +ORADG/mobiledb/datafile/undotbs1.261.649168949
restoring datafile 00003 to +ORADG/mobiledb/datafile/sysaux.262.649168951
restoring datafile 00004 to +ORADG/mobiledb/datafile/users.264.649168953
restoring datafile 00005 to +ORAG2/mobiledb/datafile/club_stat.dbf
restoring datafile 00006 to +ORAG2/mobiledb/datafile/club_statindx.dbf
.
.
.
restoring datafile 00068 to +ORADG/mobiledb/datafile/users.328.652899937
channel ORA_DISK_1: reading from backup piece /rman_backup/data/df_MOBILEDB_5042_1_1
ORA-19870: error reading backup piece /rman_backup/data/df_MOBILEDB_5042_1_1
ORA-19504: failed to create file "+ORAG2/mobiledb/datafile/club_stat.dbf"
ORA-17502: ksfdcre:4 Failed to create file +ORAG2/mobiledb/datafile/club_stat.dbf
ORA-15173: entry 'mobiledb' does not exist in directory '/'
failover to previous backup
creating datafile fno=1 name=+ORADG/mobiledb/datafile/system.260.649168943
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 02/12/2011 14:50:44
ORA-01180: can not create datafile 1
ORA-01110: data file 1: '+ORADG/mobiledb/datafile/system.260.649168943'
導致這個錯誤的原因是RESTORE操作不會自動創建非數據庫所屬的目錄,雖然根據控制文件中存儲的位置,控制文件應該恢復到mobiledb目錄中,但是由于standby數據庫和primary數據庫的db_unique_name并不相同,因此實際RESTORE之后,數據文件會放在standby數據庫db_unique_name對應的名稱MOBILEDB_N目錄下,對于MOBILEDB_N目錄以及其下的DATAFILE、ONLINELOG等目錄,RESTORE操作會自動創建,但是mobiledb及其下的目錄,RESTORE并不會自動創建,即使這個目錄并不會寫入內容。
解決方法也很簡單,只需要通過asmcmd手工創建對應的目錄結構即可:
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ asmcmd
ASMCMD> cd +oradg
ASMCMD> mkdir mobiledb
ASMCMD> cd mobiledb
ASMCMD> mkdir datafile
ASMCMD> ls
datafile/
ASMCMD> cd ..
ASMCMD> ls
MOBILEDB_N/
mobiledb/
ASMCMD> cd +orag2
ASMCMD> mkdir mobiledb
ASMCMD> cd mobiledb
ASMCMD> mkdir datafile
ASMCMD> exit
再次運行RESTORE DATABASE命令,問題解決。
RMAN> restore database;
Starting restore at 12-FEB-11
using channel ORA_DISK_1
file 22 is excluded from whole database backup
file 25 is excluded from whole database backup
file 28 is excluded from whole database backup
file 30 is excluded from whole database backup
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +ORADG/mobiledb/datafile/system.260.649168943
restoring datafile 00002 to +ORADG/mobiledb/datafile/undotbs1.261.649168949
restoring datafile 00003 to +ORADG/mobiledb/datafile/sysaux.262.649168951
restoring datafile 00004 to +ORADG/mobiledb/datafile/users.264.649168953
restoring datafile 00005 to +ORAG2/mobiledb/datafile/club_stat.dbf
restoring datafile 00006 to +ORAG2/mobiledb/datafile/club_statindx.dbf
.
.
.
restoring datafile 00068 to +ORADG/mobiledb/datafile/users.328.652899937
channel ORA_DISK_1: reading from backup piece /rman_backup/data/df_MOBILEDB_5042_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/rman_backup/data/df_MOBILEDB_5042_1_1 tag=TAG20110212T113309
channel ORA_DISK_1: restore complete, elapsed time: 01:28:47
failover to previous backup
Finished restore at 12-FEB-11
oracle視頻教程請關注:http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html
轉載于:https://blog.51cto.com/19880614/1239173
總結
以上是生活随笔為你收集整理的Oracle技术之ASM上恢复STANDBY数据库出现ORA-15173错误的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JDK源码笔记-java.util.Ha
- 下一篇: 自定加载的简单实例