在主库添加数据文件后,主从同步突然中断,从库alter日志出现以下报错:
ORA-10879: error signaled in parallel recovery slave
ORA-00283: recovery session canceled due to errors
ORA-01111: name for data file 6 is unknown - rename to correct file
ORA-01110: data file 6: '/data/uat/oracle/12.1.0.2/test/dbs/UNNAMED00006'
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01111: name for data file 6 is unknown - rename to correct file
ORA-01110: data file 6: '/data/uat/oracle/12.1.0.2/test/dbs/UNNAMED00006'
ksvp2penabled: ep->flg = 0, rpr->slv_flg = 0
ksvp2penabled: ep = 0x7f0883d231e8, rpr = 0x184be0730
DDE: Problem Key 'ORA 1110' was flood controlled (0x1) (no incident)
ORA-01110: data file 6: '/data/uat/oracle/12.1.0.2/test/dbs/UNNAMED00006'
ORA-10458: standby database requires recovery
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01111: name for data file 6 is unknown - rename to correct file
ORA-01110: data file 6: '/data/uat/oracle/12.1.0.2/test/dbs/UNNAMED00006'
报错原因:
查询文档发现是主库standby_file_management没设为AUTO,在添加数据文件后从库无法识别,就会导致上面的报错
解决方法:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=manual;
ALTER DATABASE CREATE DATAFILE '/data/uat/oracle/12.1.0.2/test/dbs/UNNAMED00006' AS '/data/uat/oracle/12.1.0.2/test/dbs/test01.dbf';
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
参考:
How to resolve ORA-01111 ORA-01110 ORA-01157 in a physical standby database (文档 ID 1416554.1)
http://yunlongzheng.blog.51cto.com/blog/788996/1091944