spfile丢失恢复实验

本文介绍了当Oracle数据库的SPFILE丢失时如何进行恢复的过程。通过使用RMAN工具从自动备份中恢复SPFILE,并解决了恢复过程中遇到的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

丢失spfile的恢复

1、实验过程

[root@oracledbs]# pwd

/u01/app/oracle/product/11.2.0/db_1/dbs

[root@oracledbs]# ll

total9672

-rw-rw----1 oracle dba    1544 Mar  1 13:16 hc_DBUA0.dat

-rw-rw----1 oracle dba    1544 Mar 28 10:25hc_yyy.dat

-rw-r--r--1 oracle dba    2851 May 15  2009 init.ora

-rw-r-----1 oracle dba      24 Mar  1 13:25 lkYYY

-rw-r-----1 oracle dba    1536 Mar 26 12:00orapwyyy

-rw-r-----1 oracle dba 9879552 Mar 26 12:19 snapcf_yyy.f

-rw-r-----1 oracle dba    2560 Mar 28 10:25spfileyyy.ora

[root@oracledbs]# rm spfileyyy.ora

[root@oracledbs]# ll

total9668

-rw-rw----1 oracle dba    1544 Mar  1 13:16 hc_DBUA0.dat

-rw-rw----1 oracle dba    1544 Mar 28 10:25hc_yyy.dat

-rw-r--r--1 oracle dba    2851 May 15  2009 init.ora

-rw-r-----1 oracle dba      24 Mar  1 13:25 lkYYY

-rw-r-----1 oracle dba    1536 Mar 26 12:00orapwyyy

-rw-r-----1 oracle dba 9879552 Mar 26 12:19 snapcf_yyy.f

2、开始恢复

RMAN>restore spfile fromautobackup; 

 

Startingrestore at 28-MAR-18

usingtarget database control file instead of recovery catalog

allocatedchannel: ORA_DISK_1

channelORA_DISK_1: SID=1145 device type=DISK

 

RMAN-00571:===========================================================

RMAN-00569:=============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571:===========================================================

RMAN-03002:failure of restore command at 03/28/2018 10:21:53

RMAN-06564:must use the TO clause when the instance is started with SPFILE

RMAN>shutdown immediate;

 

databaseclosed

databasedismounted

Oracleinstance shut down

RMAN>startup nomount;

 

connectedto target database (not started)

startupfailed: ORA-01078: failure in processing system parameters

LRM-00109:could not open parameter file '/u01/app/oracle/product/11.2.0/db_1/dbs/inityyy.ora'

 

startingOracle instance without parameter file for retrieval of spfile   #没有检索数据库的参数文件启动实例

Oracleinstance started

 

TotalSystem Global Area     158662656 bytes

 

FixedSize                     2211448 bytes

VariableSize                 92275080 bytes

DatabaseBuffers              58720256 bytes

RedoBuffers                   5455872 bytes

RMAN>restore spfile fromautobackup;

 

Startingrestore at 28-MAR-18

allocatedchannel: ORA_DISK_1

channelORA_DISK_1: SID=96 device type=DISK

 

channelORA_DISK_1: looking for AUTOBACKUP on day: 20180328

channelORA_DISK_1: looking for AUTOBACKUP on day: 20180327

channelORA_DISK_1: looking for AUTOBACKUP on day: 20180326

channelORA_DISK_1: looking for AUTOBACKUP on day: 20180325

channelORA_DISK_1: looking for AUTOBACKUP on day: 20180324

channelORA_DISK_1: looking for AUTOBACKUP on day: 20180323

channelORA_DISK_1: looking for AUTOBACKUP on day: 20180322

channelORA_DISK_1: no AUTOBACKUP in 7 days found

RMAN-00571:===========================================================

RMAN-00569:=============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571:===========================================================

RMAN-03002:failure of restore command at 03/28/2018 10:22:54

RMAN-06172:no AUTOBACKUP found or specified handle is not a valid copy or piece

RMAN>restore spfile from'/file/backup/rman/controlfile_c-2086322433-20180326-09';

 

Startingrestore at 28-MAR-18

usingchannel ORA_DISK_1

 

channelORA_DISK_1: restoring spfile from AUTOBACKUP/file/backup/rman/controlfile_c-2086322433-20180326-09

channelORA_DISK_1: SPFILE restore from AUTOBACKUP complete

Finishedrestore at 28-MAR-18

3、启动数据库

RMAN>shutdown immediate

 

Oracleinstance shut down

 

RMAN>startup;

 

connectedto target database (not started)

Oracleinstance started

databasemounted

databaseopened

 

TotalSystem Global Area    2405122048 bytes

 

FixedSize                     2215704 bytes

VariableSize                620757224 bytes

DatabaseBuffers            1761607680 bytes

RedoBuffers                  20541440 bytes

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值