首页 » ORACLE 9i-23ai » 如何修复ORA-01111, ORA-01110, ORA-01157 errors on Standby database

如何修复ORA-01111, ORA-01110, ORA-01157 errors on Standby database

在oracle DATAGUARD环境,STANDBY_FILE_MANAGEMENT 参数控制standby database的文件管理。当启用自动备用文件管理时(AUTO),Primary数据库上的操作系统文件添加和删除将在备用数据库上复制。将此参数设置为MANUAL可能会导致MRP进程crash,也可能因为备库的映射错误或磁盘空间不足等原因,中止应用产生gap, 在standby db 的alert日志中可以发现备用数据库出现ORA-01111、ORA-01110、ORA-01157错误,备数据库中创建的文件为UNNAMED or MISSING的文件名。 下面记录修复方法.

错误日志

Errors in file /u01/app/oracle/diag/rdbms/orclstdy/orclstdy/trace/orclstdy_mrp00_11317.trc:
ORA-01111: name for data file 11 is unknown – rename to correct file
ORA-01110: data file 11: ‘/u01/app/oracle/product/11.2.0.4/db/dbs/UNNAMED00011’
ORA-01157: cannot identify/lock data file 11 – see DBWR trace file
ORA-01111: name for data file 11 is unknown – rename to correct file
ORA-01110: data file 11: ‘/u01/app/oracle/product/11.2.0.4/db/dbs/UNNAMED00011’

停MRP

SQL> select PROCESS,THREAD#,SEQUENCE#,STATUS from v$managed_standby where process='MRP0';

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

停止 MRP 如果它仍旧在running.

Standby DB 检查文件

SQL> show parameter standby_file_management

select * from v$recover_file where error like ‘%FILE%’;
select name from v$datafile where name like ‘%UNNAMED%’;


Primary DB 确认正确实文件名

Select file#, name,bytes from v$datafile where file#=11;  -- ABOVE FILE#

修复standby datafile

SQL> alter system set standby_file_management=’manual’;
SQL> show parameter standby_file_management;

SQL> alter database create datafile ‘/u01/app/oracle/product/11.2.0.4/db/dbs/UNNAMED00011’ as ‘+data/test/datafile/standby11.dbf’ size 8292M;
Database altered.

Note:
If You are managing File system ASM with OMF, you are not allowed to create data file, Because it will file system names and format maintained by ASM.If you try to Create datafile as above with ASM File, You will pass with “ORA-01276: Cannot add file ‘xxx/xxx.1223.23231241’ File has an Oracle Managed.” error。

SQL> alter database create datafile ‘/XXX/db_1/dbs/UNNAMED00011’ as new;
-- or --
SQL> alter database create datafile ‘/XXX/db_1/dbs/UNNAMED00011’ as '+data' size 8292M;

启动MRP

SQL> alter system set standby_file_management=AUTO scope=both;
System altered.

SQL> alter database recover managed standby database disconnect from session;

— OVER —

打赏

, , ,

对不起,这篇文章暂时关闭评论。