rman restore database(spfile,controlfile, datafile)

maojinyu發表於2011-06-02
Normal 0 7.8 pt 0 2 false false false MicrosoftInternetExplorer4

SQL> select dbid from v$database;

DBID

----------

50441556

[oracle@mysql1 ~]$ rman target /

RMAN> set DBID=50441556

RMAN> startup force nomount;

startup failed:

ORA-01078: failure in processing system parameters

LRM-00109: could not open parameter file '/home/oracle/u01/app/oracle/dbs/inittestasm.ora'

starting Oracle instance without parameter file for retrival of spfile Oracle instance started

Total System Global Area 159383552 bytes

Fixed Size 1266320 bytes

Variable Size 58723696 bytes

Database Buffers 92274688 bytes

Redo Buffers 7118848 bytes

RMAN> restore spfile from '/home/oracle/backup/database_0cmdrgc8_1_1.dbf';

RMAN> restore controlfile from '/home/oracle/backup/database_0cmdrgc8_1_1.dbf';

RMAN> startup force nomount;

RMAN> restore controlfile from '/home/oracle/backup/database_0cmdrgc8_1_1.dbf';

RMAN> alter database mount

RMAN> restore database

RMAN> recover database

RMAN> alter database open resetlogs;

[@more@] Normal 0 7.8 pt 0 2 false false false MicrosoftInternetExplorer4

找一個臨時pfile

RMAN> startup nomount;

RMAN> restore spfile to '/tmp/spfiletestasm.ora' from autobackup;

RMAN> !cp /tmp/spfiletestasm.ora $ORACLE_HOME/dbs

RMAN> startup nomount;

RMAN> restore controlfile from autobackup;

RMAN> alter database mount;

RMAN> restore database;

RMAN> recover database;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9907339/viewspace-1050668/,如需轉載,請註明出處,否則將追究法律責任。

相關文章