Oracle DG主库创建redo备库不会同步创建

前提:

db_file_name_convert  对方在前自己在后,设置正确
log_file_name_convert 对方在前自己在后,设置正确
standby_file_management 设置为AUTO

一.验证在主库创建日志文件备库是否会同步创建:

主库创建redo日志组以及standby redo日志组:

SQL> alter database add logfile group 21 '+DATA/racdb/redo21.log' size 50m;
Database altered.
SQL>alter database add logfile group 22 '+DATA/racdb/sty_redo22.log' size 50m
Database altered.

SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.

查看主库警告日志:

alter database add logfile group 21 '+DATA/racdb/redo21.log' size 50m
Expanded controlfile section 3 from 16 to 40 records
The number of logical blocks in section 3 remains the same
Completed:  alter database add logfile group 21 '+DATA/racdb/redo21.log' size 50m
alter database add logfile group 22 '+DATA/racdb/sty_redo22.log' size 50m
Completed: alter database add logfile group 22 '+DATA/racdb/sty_redo22.log' size 50m
Tue Sep 15 20:57:22 2020
Thread 1 advanced to log sequence 189 (LGWR switch)
Current log# 21 seq# 189 mem# 0: +DATA/racdb/redo21.log
Tue Sep 15 20:57:22 2020
LNS: Standby redo logfile selected for thread 1 sequence 189 for destination LOG_ARCHIVE_DEST_3
Tue Sep 15 20:57:22 2020
Archived Log entry 167 added for thread 1 sequence 188 ID 0x1b99d507 dest 1:
Thread 1 advanced to log sequence 190 (LGWR switch)
  Current log# 2 seq# 190 mem# 0: +DATA/racdb/redo02.log
LNS: Standby redo logfile selected for thread 1 sequence 190 for destination LOG_ARCHIVE_DEST_3
Tue Sep 15 20:57:30 2020
Archived Log entry 169 added for thread 1 sequence 189 ID 0x1b99d507 dest 1:

查看主库日志组信息:

SQL> select member from v$logfile where group#=21;
MEMBER
--------------------------------------------------------------------------------
+DATA/racdb/redo21.log

查看备库警告日志:

RFS[2]: Selected log 5 for thread 1 sequence 189 dbid 457994418 branch 1046156085
Wed Sep 16 04:49:25 2020
Archived Log entry 412 added for thread 1 sequence 188 ID 0x1b99d507 dest 1:
Wed Sep 16 04:49:26 2020
Media Recovery Log /oracle/app/arch/proddg2/1_188_1046156085.dbf
Media Recovery Waiting for thread 1 sequence 189 (in transit)
Wed Sep 16 04:49:33 2020
Archived Log entry 413 added for thread 1 sequence 189 ID 0x1b99d507 dest 1:
RFS[2]: Selected log 4 for thread 1 sequence 190 dbid 457994418 branch 1046156085
Wed Sep 16 04:49:36 2020
Media Recovery Log /oracle/app/arch/proddg2/1_189_1046156085.dbf
Media Recovery Waiting for thread 1 sequence 190 (in transit)

查看备库日志组信息:

SQL> select member from v$logfile where group#=21;
no rows selected

结论:根据跟踪备库警告日志,发现备库redo日志组以及standby redo日志组并没有自动创建。

二.验证在主库创建数据文件备库是否会同步创建:
主库创建表空间:

SQL> create tablespace test01 datafile '+DATA/racdb/test01.dbf'  size 50m

SQL> alter system switch logfile;
System altered.

查看主库警告日志:

create tablespace test01 datafile '+DATA/racdb/test01.dbf'  size 50m
Completed: create tablespace test01 datafile '+DATA/racdb/test01.dbf'  size 50m

查看备库警告日志:

Media Recovery Log /oracle/app/arch/proddg2/1_192_1046156085.dbf
Recovery created file /oracle/app/oradata/proddg2/test01.dbf
Successfully added datafile 7 to media recovery
Datafile #7: '/oracle/app/oradata/proddg2/test01.dbf'
Media Recovery Waiting for thread 1 sequence 193 (in transit)

备库查看表空间信息:

SQL>  select name from v$tablespace where name='TEST01';
NAME
------------------------------
TEST01

结论:根据跟踪备库警告日志,发现数据文件可以自动创建同步

你可能感兴趣的:(oracle,linux,运维,DG,数据库)