介于Rman恢复的自动性,我们刚才对数据库的全库,单表空间,数据文件控制文件和参数文件都做了备份,这些备份的内容是数据库运行不可缺少的必要元素,通常情况下我们在生产库中只需要备份这些内容即可。有了这些备份,即使数据库的的任何信息丢失,我们都可以得以恢复使得数据库的正常运行,当然如果我们将archivelog 也备份,当然就会更好了,一般情况下这个可以不用备份,备份archivelog占用空间非常大。如果有海量的储存,当然备份也无妨咯。
Egg:
删除数据库的所有文件,仅保留redo日志和archivelog文件
删除控制文件:
[Oracle@wwldb WWL]$ pwd
/DBData/oradata/WWL
[oracle@wwldb WWL]$ ls
control02.ctl control03.ctl
[oracle@wwldb WWL]$ rm -rf *.ctl
[oracle@wwldbWWL]$
[oracle@wwldb WWL]$ pwd
/DBSoft/oradata/WWL
[oracle@wwldb WWL]$ ls
control01.ctl
[oracle@wwldb WWL]$ rm -rfcontrol01.ctl
[oracle@wwldbWWL]$
删除数据文件:
[oracle@wwldb WWL]$ ls
redo01.log redo02.log redo03.logsysaux01.dbf system01.dbf temp01.dbf undotbs01.dbf users01.dbf
[oracle@wwldb WWL]$ rm -rf *.dbf
[oracle@wwldb WWL]$ ls
redo01.log redo02.log redo03.log
[oracle@wwldbWWL]$
删除参数文件:
[oracle@wwldb dbs]$ cd$ORACLE_HOME/dbs
[oracle@wwldb dbs]$ rm -rfspfileWWL.ora
[oracle@wwldbdbs]$
执行大恢复:
1、现在数据库是关闭状态
[oracle@wwldb dbs]$ ps -ef|grep ora
root 2910 2888 0 10:02 ? 00:00:15hald-addon-storage: polling/dev/hdc
root 28954 3478 0 11:38 pts/100:00:00 su - oracle
oracle 28955 28954 0 11:38 pts/100:00:00 -bash
root 29361 3438 0 13:41 pts/200:00:00 su - oracle
oracle 29362 29361 0 13:41 pts/200:00:01 -bash
oracle 29988 29362 0 16:06 pts/200:00:00sqlplus as sysdba
oracle 30102 28955 0 17:03 pts/100:00:00 ps -ef
oracle 30103 28955 0 17:03 pts/100:00:00 grep ora
[oracle@wwldbdbs]$
2、要恢复首先要将数据库启动到mount状态才能恢复
[oracle@wwldb dbs]$ sqlplus / assysdba
SQL*Plus:Release 10.2.0.1.0 -Production on Wed May 23 17:03:42 2012
Copyright (c)1982, 2005, Oracle. Allrights reserved.
Connected to anidle instance.
SQL> startup
ORA-01078:failure in processingsystem parameters
LRM-00109: couldnot open parameterfile '/DBSoft/product/10.2.0/db_1/dbs/initWWL.ora'
SQL>
3、因为数据库没有参数文件,起不来,只能能启动到nomount状态
[oracle@wwldb dbs]$ rman target /
RecoveryManager: Release 10.2.0.1.0- Production on Wed May 23 17:06:32 2012
Copyright (c)1982, 2005, Oracle. Allrights reserved.
connected totarget database (notstarted)
RMAN> startup force nomount;
startup failed:ORA-01078: failure inprocessing system parameters
LRM-00109: couldnot open parameterfile '/DBSoft/product/10.2.0/db_1/dbs/initWWL.ora'
starting Oracleinstance withoutparameter file for retrival of spfile
Oracle instancestarted
Total System GlobalArea 159383552bytes
Fixed Size 1218244 bytes
VariableSize 58722620 bytes
DatabaseBuffers 92274688 bytes
RedoBuffers 7168000 bytes
RMAN>