环境
备库standby_file_management参数为MANUAL
主库创建数据文件时备库应用失败
主库
SQL> create tablespace test datafile '+DATA/dgpri/datafile/test01.dbf' size 50m;
备库开启实时应用
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
查看日志
Archived Log entry 19 added for thread 1 sequence 30 rlc 1015097842 ID 0x3b7defac dest 2: RFS[6]: No standby redo logfiles available for thread 1 RFS[6]: Opened log for thread 1 sequence 31 dbid 998109615 branch 1015097842 Thu Aug 01 01:20:03 2019 Media Recovery Log /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_30_1015097842.dbf File #6 added to control file as 'UNNAMED00006' because the parameter STANDBY_FILE_MANAGEMENT is set to MANUAL The file should be manually created to continue. Errors with log /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_30_1015097842.dbf MRP0: Background Media Recovery terminated with error 1274 Errors in file /u01/app/oracle/diag/rdbms/dgphy/dgphy/trace/dgphy_pr00_74382.trc: ORA-01274: cannot add datafile '+DATA/dgpri/datafile/test01.dbf' - file could not be created .... Managed Standby Recovery starting Real Time Apply Thu Aug 01 01:22:10 2019 Errors in file /u01/app/oracle/diag/rdbms/dgphy/dgphy/trace/dgphy_dbw0_74012.trc: ORA-01186: file 6 failed verification tests 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: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00006' File 6 not verified due to error ORA-01157 MRP0: Background Media Recovery terminated with error 1111 Errors in file /u01/app/oracle/diag/rdbms/dgphy/dgphy/trace/dgphy_pr00_82248.trc: ORA-01111: name for data file 6 is unknown - rename to correct file ORA-01110: data file 6: '/u01/app/oracle/product/11.2.0/dbhome_1/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: '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00006' Managed Standby Recovery not using Real Time Apply
此时备库执行
SQL> alter database create datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00006' as '+DATA/dgphy/datafile/test01.dbf'; Database altered.
再开启实时应用
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION; Database altered.
查看日志
ALTER SYSTEM SET standby_file_management='MANUAL' SCOPE=BOTH; alter database create datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00006' as '+DATA/dgphy/datafile/test01.dbf' Completed: alter database create datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00006' as '+DATA/dgphy/datafile/test01.dbf' Thu Aug 01 01:23:04 2019 ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION Attempt to start background Managed Standby Recovery process (dgphy) Thu Aug 01 01:23:04 2019 MRP0 started with pid=24, OS id=82426 MRP0: Background Managed Standby Recovery process started (dgphy) started logmerger process Thu Aug 01 01:23:10 2019 Managed Standby Recovery starting Real Time Apply Parallel Media Recovery started with 2 slaves Waiting for all non-current ORLs to be archived... All non-current ORLs have been archived. Thu Aug 01 01:23:10 2019 Archiver process freed from errors. No longer stopped Media Recovery Log /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_30_1015097842.dbf Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION Media Recovery Log /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_31_1015097842.dbf Media Recovery Waiting for thread 1 sequence 32 (in transit)
此时实时应用已经成功完成
查看进程
SQL> ! ps -ef|grep mrp oracle 74365 1 0 00:43 ? 00:00:00 ora_mrp0_dgphy oracle 81797 80300 0 01:19 pts/14 00:00:00 /bin/bash -c ps -ef|grep mrp oracle 81799 81797 0 01:19 pts/14 00:00:00 grep mrp
查看数据文件
SQL> select name from v$datafile; NAME -------------------------------------------------------------------------------- +DATA/dgphy/datafile/system.277.1015099429 +DATA/dgphy/datafile/sysaux.278.1015099475 +DATA/dgphy/datafile/undotbs1.280.1015099527 +DATA/dgphy/datafile/users.281.1015099533 +DATA/dgphy/datafile/example.279.1015099511 +DATA/dgphy/datafile/test01.dbf 6 rows selected.
发现问题已经解决了,最后
alter system set standby_file_management='AUTO';
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。