ORACLE 参数文件损坏恢复实例

实例启动时会报如下错误:

SQL> startup

ORA-01078: failure in processing system parameters

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

利用控制文件自动备份生成的参数文件备份恢复。

步骤:

  1. 使用RMAN启动实例到nomount状态。RMAN能够在没有参数文件的特殊情况下将实例启动到nomount状态

RMAN> startup nomount;

startup failed: ORA-01078: failure in processing system parameters

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

starting Oracle instance without parameter file for retrieval of spfile

Oracle instance started

Total System Global Area 158662656 bytes

Fixed Size 2226456 bytes

Variable Size 92276456 bytes

Database Buffers 58720256 bytes

Redo Buffers 5439488 bytes

b、执行restore spfile 命令,根据备份类型区别使用 from autobackup或 from '备份集路径'子句。这里使用自动备份。

RMAN> set dbid 1328529185;

executing command: SET DBID

RMAN> restore spfile from autobackup;

Starting restore at 01-DEC-12

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=18 device type=DISK

channel ORA_DISK_1: looking for AUTOBACKUP on day: 20121201

channel ORA_DISK_1: AUTOBACKUP found: c-1328529185-20121201-00

channel ORA_DISK_1: restoring spfile from AUTOBACKUP c-1328529185-20121201-00

channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete

Finished restore at 01-DEC-12

注意:此命令要求先指定数据库的DBID,DBID可以从控制文件自动备份文件名中获得,控制文件自动备份默认保存在 $ORACLE_HOME/dbs 目录。

当控制文件自动备份没有在默认位置

Rman>RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oracle/%F';

那么,数据库在nomount状态rman只能读取默认配置的,不能读取到更改后位置的

当回复的时候通过如下

Rman>set dbid 1328529185;

Rman>run

{

SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE disk to '/oracle/%F';

Restore controlfile from autobackup;

}

c、重启实例,恢复完成

RMAN> shutdown immediate;

Oracle instance shut down

RMAN> startup;

connected to target database (not started)

Oracle instance started

database mounted

database opened

Total System Global Area 1048059904 bytes

Fixed Size 2235000 bytes

Variable Size 608175496 bytes

Database Buffers 432013312 bytes

Redo Buffers 5636096 bytes

如果在实例运行中发现参数文件损坏,如下:

SQL> alter system set log_archive_dest_2='location=/u01/app/oracle/arch2' scope=spfile;

alter system set log_archive_dest_2='location=/u01/app/oracle/arch2' scope=spfile

*

ERROR at line 1:

ORA-01565: error in identifying file

'/u01/app/oracle/product/11.2.0/db_1/dbs/spfileorcl.ora'

ORA-27046: file size is not a multiple of logical block size

Additional information: 1

直接执行restore spfile恢复即可,不需关闭实例和设置DBID

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

注意:如果数据库是用spfile文件启动的,要恢复到其他位置,在copy到原位置即可。

cp /tmp/spfileorcl.ora $ORACLE_HOME/dbs

相关推荐
Hrain-AI2 小时前
多 Agent 并行不打架:worktree 隔离与反馈回流落地(附脚本)
网络·数据库·人工智能·架构
净水深流2 小时前
中央厨房冷链技术实践:多温区改造、WMS落地与IoT温控架构
大数据·数据库·人工智能·冷库冷链
l1t3 小时前
测试DuckDB 2.1的match_recognize模式匹配语句
数据库·duckdb
IpdataCloud4 小时前
AI智能体调用工具怎么核验来源IP?归属地、网络类型与代理风险识别(含Python代码)
数据库·python·tcp/ip
曹牧4 小时前
Java:SQL 注入漏洞
数据库
程序员JerrySUN4 小时前
Jetson Edge AI 实战01:Nano、Xavier、Orin 怎么选?Jetson 硬件选型详解【视频讲解】
java·数据库·redis·安全·mybatis
oradh5 小时前
Oracle Undo问题总结(ORA-600 [4xxx] 系列错误)
数据库·oracle
达梦数据5 小时前
DMDRS辅助表生成规则与作用
数据库·oracle
‎ദ്ദിᵔ.˛.ᵔ₎5 小时前
MySQL 表约束
数据库·mysql
Doris__HE5 小时前
【元脑服务器NF5476G7-NF5476M7技术规格分享】
运维·服务器·网络·数据库·性能优化