rman restore spfile from backup

spfile一般在$ORACLE_HOME/dbs(linux)目录,如果你丢失了spfile并不会引起实例立刻停掉,你的实例可以继续操作,尽管当你restore spfile的时候需要关闭重启实例,那么可以通过多种方式进行恢复

1).通过alert_sid.log,alert里面包含你修改过的所有参数,可以根据alert日志重新创建pfile,再创建spfile恢复

2).如果pfile还存在

shutdown immediate;

create spfile from pfile;

创建spfile

3).如果存在之前的spfile的备份,可以在rman 里面配置控制文件自动备份,spfile随着控制文件一起备份

CONFIGURE CONTROLFILE AUTOBACKUP ON;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘/home/oracle/rmanback/control_%F’;

注意事项:

如果实例已经用spfile启动,那么你不能覆盖存在的spfile;

当有recovery catalog 的时候能简化你的恢复过程,因为你不需要设置dbid

rman演示存在spfile备份的恢复(不连接catalog)

1、删除spfile,pfile

rm -rf spfiletest.ora inittest.ora

2、关闭实例

shutdown immediate;

3.启动实例到nomount 状态,当spfile不可用时,,rman用虚拟的参数文件启动实例

RMAN> startup force nomount;startup failed: ORA-01078: failure in processing system parametersLRM-00109: could not open parameter file ‘/home/u01/app/oracle/product/11.2.0/db_1/dbs/inittest.ora’starting Oracle instance without parameter file for retrieval of spfileOracle instance startedTotal System Global Area 158662656 bytesFixed Size 2226456 bytesVariable Size 130025192 bytesDatabase Buffers 20971520 bytesRedo Buffers 5439488 bytes

4.restore spfile from spfile autobackup

如果你想要restore spfile从自动备份,你必须要设置dbid,然后restore spfile from autobackup;

restore spfile from ‘/home/oracle/rmanback/control_c-2171455666-20150309-02’ –手动指定路径

RMAN> SET DBID 320066378;RMAN> RUN {SET CONTROLFILE AUTOBACKUP FORMATFOR DEVICE TYPE DISK TO ‘/home/oracle/rmanback/control_%F’;RESTORE SPFILE FROM AUTOBACKUP;}

RMAN> set dbid 2171455666;executing command: SET DBID

RMAN> set CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘/home/oracle/rmanback/control_%F’;executing command: SET CONTROLFILE AUTOBACKUP FORMAT

RMAN> restore spfile from autobackup;Starting restore at 2015-03-09 18:52:31using channel ORA_DISK_1channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150309channel ORA_DISK_1: AUTOBACKUP found: /home/oracle/rmanback/control_c-2171455666-20150309-02channel ORA_DISK_1: restoring spfile from AUTOBACKUP /home/oracle/rmanback/control_c-2171455666-20150309-02channel ORA_DISK_1: SPFILE restore from AUTOBACKUP completeFinished restore at 2015-03-09 18:52:33

5.启动实例

RMAN> startup force;Oracle instance starteddatabase mounteddatabase openedTotal System Global Area 1068937216 bytesFixed Size 2235208 bytesVariable Size 700449976 bytesDatabase Buffers 360710144 bytesRedo Buffers 5541888 bytes

–文章原创,禁止转载

怕走崎岖路,莫想登高峰。

rman restore spfile from backup

相关文章:

你感兴趣的文章:

标签云: