ora-01189故障解决办法

解决ORA-01189错误
本文详细解析了ORA-01189错误的成因,该错误通常出现在Oracle数据库中,当尝试创建控制文件时,发现某个数据文件来自上一次RESETLOGS操作前的备份。文章提供了具体的解决步骤,包括如何重建控制文件、调整数据库参数、在线数据文件以及进行介质恢复。

ORA-01189: 文件来自于与先前文件不同的 RESETLOGS
ORA-01110: 数据文件 4: 'D:\ORCLDATA\XEPACS\USERS01.DBF'
ORA-01189解释:
Cause: In a CREATE CONTROLFILE command, either this file or all previous files were backups from before the last RESETLOGS. This also may occur if this is a file that is offline and has been offline since before the last RESETLOGS.
Action: If the file was taken offline normally before the last RESETLOGS and is still offline, omit it from the CREATE CONTROLFILE command. Rename and online the file after the database is open. Otherwise, find the version of the mentioned file consistent with the rest of the datafiles and retry the command.
1 跳过有问题的数据文件重建控制文件或只用system01.dbf重建;

2 resetlogs打开数据库 ,注意更改undo相关参数为manual;

    alter system set "_allow_resetlogs_corruption"=true scope=spfile
    alter system set audit_trail=none scope=spfile;
    alter system set undo_management=MANUAL scope=spfile;

3 启动后rename 有问题的datafile

alter database rename file 'D:\ORACLE\PRODUCT\10.2.0\DBHOME_1\DATABASE\MISS
ING00004' to 'd:\orcldata\xepacs\users01.dbf';

由于scn较低,需要重新resetlogs调成一致,或者用bbed调整;
#4 推进scn
ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME ADJUST_SCN LEVEL 1';
LEVEL: Level 1 is usually sufficient - it raises the SCN to 1 billion
5 alter database datafile 4 online;
startup mount;
SQL> recover until cancel;
完成介质恢复。
SQL> alter database datafile 4 online;
数据库已更改。
SQL> alter database open resetlogs;
数据库已更改。

6 SQL> alter database open resetlogs;
此场景适用于offline了很久的数据文件,再online,丢失归档,或者数据库意外宕机

转载于:https://blog.51cto.com/snowhill/2379394

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值