oracle rman备份spfile,RMAN备份恢复之SPFILE的恢复(一)
缺少初始化文件,數(shù)據(jù)庫(kù)是無(wú)法啟動(dòng)的。如果通過(guò)RMAN備份了初始化參數(shù),那么可以通過(guò)RMAN對(duì)初始化參數(shù)進(jìn)行恢復(fù)。
這篇文章簡(jiǎn)單介紹CATALOG方式下初始化參數(shù)的恢復(fù)問(wèn)題。
初始化參數(shù)的丟失和損壞,并不會(huì)造成太嚴(yán)重的問(wèn)題,即使是最壞的情況,導(dǎo)致無(wú)法進(jìn)行恢復(fù),也是可以通過(guò)手工編輯一個(gè)新的PFILE文件,來(lái)啟動(dòng)實(shí)例的。
而且,在數(shù)據(jù)庫(kù)的alert文件中包含了每次數(shù)據(jù)庫(kù)啟動(dòng)使用的所有非默認(rèn)值初始化參數(shù),因此重新編寫(xiě)一個(gè)初始化參數(shù)并不困難。
不過(guò),既然對(duì)SPFILE進(jìn)行了備份,那么完全可以采用恢復(fù)的方式來(lái)還原SPFILE。
對(duì)于CATALOG方式,SPFILE的恢復(fù)相對(duì)簡(jiǎn)單很多。不過(guò)Oracle文檔上對(duì)于SPFILE的恢復(fù)的描述有些小問(wèn)題:SET DBID這個(gè)步驟是不能省略的,否則會(huì)報(bào)錯(cuò)。
$ rman target / catalog "rman/rman@testcen"
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database (not started)
connected to recovery catalog database
RMAN> startup force nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/opt/ora9/product/9.2/dbs/inittestdata.ora'
trying to start the Oracle instance without parameter files ...
Oracle instance started
Total System Global Area 97588504 bytes
Fixed Size 451864 bytes
Variable Size 46137344 bytes
Database Buffers 50331648 bytes
Redo Buffers 667648 bytes
RMAN> restore spfile;
Starting restore at 27-6月-07
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/27/2007 10:36:46
RMAN-12010: automatic channel allocation initialization failed
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog
正確的方式如下:
$ rman target / catalog "rman/rman@testcen"
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: DUMMY (not mounted)
connected to recovery catalog database
RMAN> set dbid 2270762593;
executing command: SET DBID
RMAN> startup force nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/opt/ora9/product/9.2/dbs/inittestdata.ora'
trying to start the Oracle instance without parameter files ...
Oracle instance started
Total System Global Area 97588504 bytes
Fixed Size 451864 bytes
Variable Size 46137344 bytes
Database Buffers 50331648 bytes
Redo Buffers 667648 bytes
RMAN> restore spfile;
Starting restore at 27-6月-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=9 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=10 devtype=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: sid=11 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: restoring SPFILE
output filename=/opt/ora9/product/9.2/dbs/spfiletestdata.ora
channel ORA_DISK_1: restored backup piece 1
piece handle=/data1/backup/testdata/c-2270762593-20070626-01 tag=null params=NULL
channel ORA_DISK_1: restore complete
Finished restore at 27-6月-07
RMAN> startup force
Oracle instance started
database mounted
database opened
Total System Global Area 1175525576 bytes
Fixed Size 452808 bytes
Variable Size 335544320 bytes
Database Buffers 838860800 bytes
Redo Buffers 667648 bytes
starting full resync of recovery catalog
full resync complete
SET DBID這個(gè)步驟是必須的。對(duì)于CATALOG模式,如果不知道數(shù)據(jù)庫(kù)的ID,可以通過(guò)CATALOG用戶登陸到CATALOG數(shù)據(jù)庫(kù)中進(jìn)行查詢:
$ sqlplus rman/rman@testcen
SQL*Plus: Release 9.2.0.4.0 - Production on星期三6月27 15:36:30 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
Session altered.
SQL> select dbid from rc_database where name = 'TESTDATA';
DBID
----------
2270762593
恢復(fù)之后,重啟數(shù)據(jù)庫(kù)實(shí)例,使得SPFILE生效。
總結(jié)
以上是生活随笔為你收集整理的oracle rman备份spfile,RMAN备份恢复之SPFILE的恢复(一)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: IOC操作Bean管理XML方式(bea
- 下一篇: 炫界 (795) -(脸兵马俑)_秦兵马