ITPub博客

首页 > 数据库 > Oracle > Oracle 11g Data Guard 增加数据文件报错:ORA-01111、ORA-01110、ORA-01157

Oracle 11g Data Guard 增加数据文件报错:ORA-01111、ORA-01110、ORA-01157

Oracle 作者:fei890910 时间:2018-05-03 15:40:33 0 删除 编辑
Oracle 11g Data Guard 增加数据文件时报错,在主库执行的语句如下:

SQL> alter tablespace TS_MIS_DATA add datafile '/oradata1/misdb/TS_MIS_DATA_32.dbf'  SIZE 34351349760   AUTOEXTEND OFF;

SQL> show parameter standby

NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
standby_archive_dest     string ?/dbs/arch
standby_file_management     string AUTO

SQL> show parameter convert

NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert     string misdbdg, misdb
log_file_name_convert     string /arch/arch1/misdbdg, /arch/arc
h1/misdb
备库 ALERT 日志中的报错如下:

Tue Feb 09 17:52:30 2016
Errors in file /u01/app/oracle/diag/rdbms/misdbdg/misdb/trace/misdb_dbw0_16033.trc:
ORA-01186: file 43 failed verification tests
ORA-01157: cannot identify/lock data file 43 - see DBWR trace file
ORA-01111: name for data file 43 is unknown - rename to correct file
ORA-01110: data file 43: '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00043'
File 43 not verified due to error ORA-01157
MRP0: Background Media Recovery terminated with error 1111
Errors in file /u01/app/oracle/diag/rdbms/misdbdg/misdb/trace/misdb_pr00_26503.trc:
ORA-01111: name for data file 43 is unknown - rename to correct file
ORA-01110: data file 43: '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00043'
ORA-01157: cannot identify/lock data file 43 - see DBWR trace file
ORA-01111: name for data file 43 is unknown - rename to correct file
ORA-01110: data file 43: '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00043'
Managed Standby Recovery not using Real Time Apply
Slave exiting with ORA-1111 exception

检查备库文件系统的权限,发现新挂载的盘没有授权,给指定目录授权

chown -R oracle.dba oradata1

授权后,在备库进行日志应用,但依旧报错

ORA-01111: name for data file 43 is unknown - rename to correct file
ORA-01110: data file 43: '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00043'
ORA-01157: cannot identify/lock data file 43 - see DBWR trace file
ORA-01111: name for data file 43 is unknown - rename to correct file
ORA-01110: data file 43: '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00043'
Managed Standby Recovery not using Real Time Apply
Slave exiting with ORA-1111 exception

使用 ALTER DATABASE CREATE DATAFILE 命令将报错的数据文件改为正确的数据文件

在备库中执行如下命令:

alter database create datafile  '/u01/app/oracle/product/11.2.0/db_1/dbs/UNNAMED00043'  as  '/oradata1/misdbdg/TS_MIS_DATA_31.dbf';

CREATE DATAFILE 命令的含义是根据控制文件创建一个新的数据文件,来代替原来的数据文件,之后再通过应用日志来对这个数据文件进行介质恢复。

--实时日志应用

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

错误被修复,ALERT 日志中的内容如下:

Media Recovery Log /arch/arch1/misdbdg/1_17845_827421642.dbf
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION
Recovery deleting file #43:'/oradata1/misdbdg/TS_MIS_DATA_31.dbf' from controlfile.
Recovery created file /oradata1/misdbdg/TS_MIS_DATA_31.dbf
Successfully added datafile 43 to media recovery

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29108064/viewspace-2153754/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-08-15

  • 博文量
    120
  • 访问量
    747590