主库添加了数据文件,备库没有同步过来。
备库报错内容:
Errors in file /u01/app/oracle/diag/rdbms/sdb/orcl/trace/orcl_pr00_43170.trc:
ORA-01119: error in creating database file '+DATA'
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15001: diskgroup "DATA" does not exist or is not mounted
ORA-15077: could not locate ASM instance serving a required diskgroup
ORA-29701: unable to connect to Cluster Synchronization Service
File #203 added to control file as 'UNNAMED00203'.
Originally created as:
'+DATA/orcl/datafile/e3_01_data.6320.1107647713'
Recovery was unable to create the file as a new OMF file.
Errors with log /u01/archivelog/1_5731_1100992899.dbf
MRP0: Background Media Recovery terminated with error 1274
Errors in file /u01/app/oracle/diag/rdbms/sdb/orcl/trace/orcl_pr00_43170.trc:
ORA-01274: cannot add datafile '+DATA/orcl/datafile/e3_01_data.6320.1107647713' - file could not be created
Thu Jun 23 05:52:14 2022
RFS[1]: Selected log 14 for thread 2 sequence 4665 dbid 1628773632 branch 1100992899
Thu Jun 23 05:52:23 2022
Recovery interrupted!
Thu Jun 23 05:52:29 2022
Archived Log entry 8332 added for thread 2 sequence 4664 ID 0x611508fd dest 1:
Recovery stopped due to failure in applying recovery marker (opcode 17.30).
1、在备库排查db_file_name_convert及log_file_name_convert参数设置正确。
SQL> show parameter convert
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string +DATA/orcl/datafile/, /u01/app
/oracle/oradata/orcl/, +DATA/o
rcl/TEMPFILE/, /u01/app/oracle
/oradata/orcl/
log_file_name_convert string +DATA/orcl/onlinelog, /u01/app
/oracle/oradata/orcl
1)设置db_file_name_convert参数
SQL> alter system set db_file_name_convert='+DATA/orcl/datafile/','/u01/app/oracle/oradata/orcl/' scope=spfile;
2)设置log_file_name_convert参数
SQL> alter system set log_file_name_convert='+DATA/orcl/onlinelog','/u01/app/oracle/oradata/orcl' scope=spfile;
3)设置STANDBY_FILE_MANAGEMENT调整为MANUAL
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=MANUAL;
4)备库创建数据文件修改为正确路径。
查询出错的数据文件路径
SQL> select FILE#, name from v$datafile
where FILE# = '203'
203 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00203
5)修改正确路径datafile
alter database create datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00203' as '/u01/app/oracle/oradata/orcl/e3_01_data.6320.1107647713';
6)STANDBY_FILE_MANAGEMENT调整为AUTO
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO;
7)开启DG同步
alter database recover managed standby database disconnect from session;
8)开启ADG同步
#取消DG同步
alter database recover managed standby database cancel;
#启动到只读模式
alter database open read only;
#启用ADG同步
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
9)查询归档延时
select value from v$dataguard_stats where name='apply lag';