暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

记一次 | oracle 配置ADG

chkl 2025-03-05
27

环境

主备库DB版本均为19c、db_name主备库均为PRODDG、db_unique_name 主备库分别为PRODDG01(主机为host01)、PRODDG02(主机为host02)

一、通过冷备方式把数据库PRODDG同步到host02

1、先把PRODDG启用归档后关库,并创建pfile文件

SYS@PRODDG>STARTUP MOUNT;
ORACLE instance started.

Total System Global Area 3154113400 bytes
Fixed Size		    8901496 bytes
Variable Size		 1728053248 bytes
Database Buffers	 1409286144 bytes
Redo Buffers		    7872512 bytes
Database mounted.
SYS@PRODDG>ALTER DATABASE ARCHIVELOG;

Database altered.

SYS@PRODDG> ALTER DATABASE OPEN;

Database altered.
SYS@PRODDG>select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/PRODDG/system01.dbf
/u01/app/oracle/oradata/PRODDG/sysaux01.dbf
/u01/app/oracle/oradata/PRODDG/undotbs01.dbf
/u01/app/oracle/oradata/PRODDG/users01.dbf

SYS@PRODDG>select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/PRODDG/redo03.log
/u01/app/oracle/oradata/PRODDG/redo02.log
/u01/app/oracle/oradata/PRODDG/redo01.log

SYS@PRODDG>SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@PRODDG>CREATE PFILE FROM SPFILE;
复制

2、复制pfile、pwfile到表空间文件夹,打包后发送到备库

数据文件、控制文件、日志文件、密码文件、pfile打包后传到备库中解压,并把密码文件和pfile放回到dbs目录下

[oracle@host01 dbs]$ cp orapwPRODDG initPRODDG.ora  /u01/app//oracle/oradata/PRODDG/
[oracle@host01 oradata]$ tar -zcvf pg_cold.tar.gz PRODDG/
[oracle@host02 oradata]$ tar -zxvf pg_cold.tar.gz 
[oracle@host02 PRODDG]$ cp initPRODDG.ora orapwPRODDG $ORACLE_HOME/dbs
复制

二、修改pfile配置,启动主备库模式

1、主库编辑pfile

[oracle@host02 PRODDG]$ vi initPRODDG.ora 
##修改*.local_listener='' 置空
##添加:
DB_UNIQUE_NAME=PRODDG01
LOG_ARCHIVE_CONFIG='DG_CONFIG=(PRODDG01,PRODDG02)'
DB_FILE_NAME_CONVERT='/PRODDG02/','/PRODDG01/'
LOG_FILE_NAME_CONVERT='/PRODDG02/','/PRODDG01/'
LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc
LOG_ARCHIVE_DEST_1=
 'LOCATION=USE_DB_RECOVERY_FILE_DEST
  VALID_FOR=(ALL_LOGFILES,ALL_ROLES) 
  DB_UNIQUE_NAME=PRODDG01'
LOG_ARCHIVE_DEST_2=
 'SERVICE=PRODDG02 ASYNC
  VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) 
  DB_UNIQUE_NAME=PRODDG02'
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
STANDBY_FILE_MANAGEMENT=AUTO
FAL_SERVER=PRODDG02
复制

2、备库编辑pfile

[oracle@host02 PRODDG]$ vi initPRODDG.ora 
##修改*.local_listener='' 置空
##添加:
DB_UNIQUE_NAME=PRODDG02
LOG_ARCHIVE_CONFIG='DG_CONFIG=(PRODDG02,PRODDG01)'
DB_FILE_NAME_CONVERT='PRODDG01','PRODDG02'
LOG_FILE_NAME_CONVERT='RODDG02','PRODDG02'
LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc
LOG_ARCHIVE_DEST_1=
 'LOCATION=USE_DB_RECOVERY_FILE_DEST
  VALID_FOR=(ALL_LOGFILES,ALL_ROLES) 
  DB_UNIQUE_NAME=PRODDG02'
LOG_ARCHIVE_DEST_2=
 'SERVICE=PRODDG01 ASYNC
  VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) 
  DB_UNIQUE_NAME=PRODDG01'
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
STANDBY_FILE_MANAGEMENT=AUTO
FAL_SERVER=PRODDG01
复制

3、根据pfile启动主库、启动强制日志、添加备库日志、创建备库控制文件

SYS@PRODDG>CREATE SPFILE FROM PFILE ;

File created.

SYS@PRODDG>startup
ORACLE instance started.

Total System Global Area 3154113400 bytes
Fixed Size		    8901496 bytes
Variable Size		 1728053248 bytes
Database Buffers	 1409286144 bytes
Redo Buffers		    7872512 bytes
Database mounted.
Database opened.
SYS@PRODDG>ALTER DATABASE FORCE LOGGING;
Database altered.

SYS@PRODDG>ALTER DATABASE flashback on;

Database altered.
SYS@PRODDG>select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/PRODDG/redo03.log
/u01/app/oracle/oradata/PRODDG/redo02.log
/u01/app/oracle/oradata/PRODDG/redo01.log

SYS@PRODDG>ALTER DATABASE ADD STANDBY LOGFILE ('/u01/app/oracle/oradata/PRODDG/std_redo01.log') SIZE 200M;

Database altered.

SYS@PRODDG>ALTER DATABASE ADD STANDBY LOGFILE ('/u01/app/oracle/oradata/PRODDG/std_redo02.log') SIZE 200M;
ALTER DATABASE ADD STANDBY LOGFILE ('/u01/app/oracle/oradata/PRODDG/std_redo03.log') SIZE 200M;
ALTER DATABASE ADD STANDBY LOGFILE ('/u01/app/oracle/oradata/PRODDG/std_redo04.log') SIZE 200M;
SYS@PRODDG>

Database altered.

SYS@PRODDG>
Database altered.
SYS@PRODDG>select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/PRODDG/redo03.log
/u01/app/oracle/oradata/PRODDG/redo02.log
/u01/app/oracle/oradata/PRODDG/redo01.log
/u01/app/oracle/oradata/PRODDG/std_redo01.log
/u01/app/oracle/oradata/PRODDG/std_redo02.log
/u01/app/oracle/oradata/PRODDG/std_redo03.log
/u01/app/oracle/oradata/PRODDG/std_redo04.log

SYS@PRODDG>ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/u01/app/oracle/pg_stand.ctl';

Database altered.

SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on from v$database;

DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON
------------------
PRODDG01		       PRIMARY		READ WRITE
YES
复制

4、根据pfile启动备库到mount状态,使用rman根据备库控制文件恢复

[oracle@host02 oradata]$ sql

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Mar 5 14:10:06 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Connected to an idle instance.

SYS@PRODDG>startup mount
ORACLE instance started.

Total System Global Area 3154113400 bytes
Fixed Size		    8901496 bytes
Variable Size		 1728053248 bytes
Database Buffers	 1409286144 bytes
Redo Buffers		    7872512 bytes
ORA-00205: error in identifying control file, check alert log for more info
[oracle@host02 dbs]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Mar 5 14:12:58 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: PRODDG (not mounted)

RMAN>  restore controlfile from '/u01/app/oracle/pg_stand.ctl';

Starting restore at 05-MAR-25
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=390 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=/u01/app/oracle/oradata/PRODDG/control01.ctl
output file name=/u01/app/oracle/fast_recovery_area/PRODDG/control02.ctl
Finished restore at 05-MAR-25

RMAN> alter database mount;
SYS@PRODDG> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

Database altered.

SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on from v$database;

DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON
------------------
PRODDG02		       PHYSICAL STANDBY MOUNTED
NO
SYS@PRODDG>shu immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SYS@PRODDG>startup 
ORACLE instance started.

Total System Global Area 3154113400 bytes
Fixed Size		    8901496 bytes
Variable Size		 1728053248 bytes
Database Buffers	 1409286144 bytes
Redo Buffers		    7872512 bytes
Database mounted.
Database opened.
SYS@PRODDG>alter database flashback on;

Database altered.
SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on from v$database;


DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON
------------------
PRODDG02		       PHYSICAL STANDBY READ ONLY
YES


复制

5、测试

host01创建表

SYS@PRODDG>create table t1(a number);

Table created.

SYS@PRODDG>insert into t1 values(1);

1 row created.

SYS@PRODDG>commit; 

Commit complete.

SYS@PRODDG>select * from t1;

	 A
----------
	 1
复制

host02查询表

SYS@PRODDG>select * from t1;
select * from t1
              *
ERROR at line 1:
ORA-00942: table or view does not exist

SYS@PRODDG>aLTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;

Database altered.

SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on from v$database;

DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON
------------------
PRODDG02		       PHYSICAL STANDBY READ ONLY WITH APPLY
YES


SYS@PRODDG>select * from t1;

	 A
----------
	 1
复制

三、snapshot测试

host02中测试

1、由standby切换到snapshot

SYS@PRODDG> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

Database altered.

SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on from v$database;


DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON
------------------
PRODDG02		       PHYSICAL STANDBY READ ONLY
YES
SYS@PRODDG> ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;

Database altered.

SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on from v$database;

DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON
------------------
PRODDG02		       SNAPSHOT STANDBY MOUNTED
YES
SYS@PRODDG>ALTER DATABASE OPEN READ WRITE;

Database altered.

SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on from v$database;

DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON
------------------
PRODDG02		       SNAPSHOT STANDBY READ WRITE
YES
SYS@PRODDG>create table t2(b number);

Table created.

SYS@PRODDG>insert into t2 values(2);

1 row created.

SYS@PRODDG>commit; 

Commit complete.

SYS@PRODDG>select * from t2;

	 B
----------
	 2
复制

2、由snapshot切换到standby

SYS@PRODDG>shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@PRODDG>startup mount
ORACLE instance started.

Total System Global Area 3154113400 bytes
Fixed Size		    8901496 bytes
Variable Size		 1728053248 bytes
Database Buffers	 1409286144 bytes
Redo Buffers		    7872512 bytes
Database mounted.
SYS@PRODDG>ALTER DATABASE CONVERT TO PHYSICAL STANDBY;

Database altered.

SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on from v$database;


DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON
------------------
PRODDG02		       PHYSICAL STANDBY MOUNTED
YES

SYS@PRODDG>ALTER DATABASE OPEN;

Database altered.

SYS@PRODDG> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;

Database altered.

SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on from v$database;

DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON
------------------
PRODDG02		       PHYSICAL STANDBY READ ONLY WITH APPLY
YES
复制

四、切换主备库

1、host01中先验证后切换。

## 验证
SYS@PRODDG> ALTER DATABASE SWITCHOVER TO PRODDG02 VERIFY;

Database altered.

SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on,SWITCHOVER_STATUS from v$database;

DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON	   SWITCHOVER_STATUS
------------------ --------------------
PRODDG01		       PRIMARY		READ WRITE
YES		   TO STANDBY
SYS@PRODDG> ALTER DATABASE SWITCHOVER TO PRODDG02;

Database altered.


SYS@PRODDG>conn / as sysdba
Connected to an idle instance.
SYS@PRODDG>startup 
ORACLE instance started.

Total System Global Area 3154113400 bytes
Fixed Size		    8901496 bytes
Variable Size		 1728053248 bytes
Database Buffers	 1409286144 bytes
Redo Buffers		    7872512 bytes
Database mounted.
Database altered.

SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on,SWITCHOVER_STATUS from v$database;


DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON	   SWITCHOVER_STATUS
------------------ --------------------
PRODDG01		       PHYSICAL STANDBY READ ONLY
YES		   RECOVERY NEEDED

复制

2、host02验证 测试


SYS@PRODDG>conn / as sysdba
Connected.
SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on,SWITCHOVER_STATUS from v$database;

DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON	   SWITCHOVER_STATUS
------------------ --------------------
PRODDG02		       PRIMARY		READ WRITE
YES		   TO STANDBY
SYS@PRODDG>insert into t1 values(5);

1 row created.

SYS@PRODDG>commit;

Commit complete.
复制

3、host01查询

SYS@PRODDG>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;

Database altered.

SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on,SWITCHOVER_STATUS from v$database;

DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON	   SWITCHOVER_STATUS
------------------ --------------------
PRODDG01		       PHYSICAL STANDBY READ ONLY WITH APPLY
YES		   NOT ALLOWED
SYS@PRODDG>select * from t1;

	 A
----------
	 1
	 3
	 5
复制

五、开启borker,配置dgmgrl

1、主备库均需开启borker,重置archive,并重启数据库使生效

SYS@PRODDG>ALTER SYSTEM SET DG_BROKER_START=TRUE;

System altered.

SYS@PRODDG>ALTER SYSTEM SET temp_undo_enabled=true;

System altered.

SYS@PRODDG>ALTER SYSTEM  reset log_archive_dest_2 ;


SYS@PRODDG>ALTER SYSTEM  reset log_archive_dest_1;

System altered.

SYS@PRODDG>
SYS@PRODDG>shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@PRODDG>startup
ORACLE instance started.

复制

2、配置dgmgrl

[oracle@host01 oradata]$ export ORACLE_SID=PRODDG
[oracle@host01 oradata]$ dgmgrl 
DGMGRL for Linux: Release 19.0.0.0.0 - Production on Thu Mar 6 08:36:58 2025
Version 19.17.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL>  connect sys/oracle
Connected to "PRODDG01"
Connected as SYSDBA.
DGMGRL> CREATE CONFIGURATION 'OPG' AS  PRIMARY DATABASE IS 'PRODDG01'  CONNECT IDENTIFIER IS PRODDG01 ;
Configuration "OPG" created with primary database "PRODDG01"
DGMGRL> ADD DATABASE 'PRODDG02' AS CONNECT IDENTIFIER IS PRODDG02;
Database "PRODDG02" added
DGMGRL>  ENABLE CONFIGURATION;
Enabled.
DGMGRL>  ENABLE DATABASE 'PRODDG02';
Enabled.
DGMGRL> EDIT DATABASE 'PRODDG01' SET PROPERTY 'ApplyLagThreshold'=15;
Property "ApplyLagThreshold" updated
DGMGRL> EDIT DATABASE 'PRODDG02' SET PROPERTY 'ApplyLagThreshold'=15;
Property "ApplyLagThreshold" updated
DGMGRL> EDIT DATABASE 'PRODDG01' SET PROPERTY LogXptMode='SYNC';
Property "logxptmode" updated
DGMGRL> EDIT DATABASE 'PRODDG02' SET PROPERTY LogXptMode='SYNC';
Property "logxptmode" updated
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Succeeded.
DGMGRL> show configuration

Configuration - OPG

  Protection Mode: MaxAvailability
  Members:
  PRODDG01 - Primary database
    PRODDG02 - Physical standby database 

Fast-Start Failover:  Disabled

Configuration Status:
SUCCESS   (status updated 15 seconds ago)
复制

2、启动fast_start failover

host02

[oracle@host02 admin]$ dgmgrl sys/oracle "START OBSERVER" &
[1] 16821
[oracle@host02 admin]$ DGMGRL for Linux: Release 19.0.0.0.0 - Production on Thu Mar 6 11:06:22 2025
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected to "PRODDG02"
Connected as SYSDBA.
[W000 2025-03-06T11:06:23.298+08:00] FSFO target standby is (empty)
Observer 'host02' started
[W000 2025-03-06T11:06:23.374+08:00] Observer trace level is set to USER
[W000 2025-03-06T11:06:23.382+08:00] Fast-Start Failover is not enabled or can't be checked. Retry after 30 seconds.
[W000 2025-03-06T11:08:26.414+08:00] Try to connect to the primary.
[W000 2025-03-06T11:08:26.414+08:00] Try to connect to the primary proddg01.
[W000 2025-03-06T11:08:26.427+08:00] The standby PRODDG02 is ready to be a FSFO target
[W000 2025-03-06T11:08:27.427+08:00] Connection to the primary restored!
2025-03-06T11:08:29.429+08:00
Observer 'host02' stopped
复制

host01

DGMGRL> ENABLE FAST_START FAILOVER;
Enabled in Zero Data Loss Mode.
DGMGRL> show configuration

Configuration - OPG

  Protection Mode: MaxAvailability
  Members:
  PRODDG01 - Primary database
    PRODDG02 - (*) Physical standby database 

Fast-Start Failover: Enabled in Zero Data Loss Mode

Configuration Status:
SUCCESS   (status updated 56 seconds ago)
DGMGRL> show OBSERVER

Configuration - OPG

  Primary:            PRODDG01
  Active Target:      PRODDG02

Observer "host02"(19.3.0.0.0) - Master

  Host Name:                    host02
  Last Ping to Primary:         88 seconds ago
  Last Ping to Target:          89 seconds ago

复制

3、switchover测试

DGMGRL> SWITCHOVER TO 'PRODDG02';
Performing switchover NOW, please wait...
Operation requires a connection to database "PRODDG02"
Connecting ...
Connected to "PRODDG02"
Connected as SYSDBA.
New primary database "PRODDG02" is opening...
Operation requires start up of instance "PRODDG" on database "PRODDG01"
Starting instance "PRODDG"...
Connected to an idle instance.
ORACLE instance started.
Connected to "PRODDG01"
Database mounted.
Database opened.
Switchover succeeded, new primary is "PRODDG02"
复制

host02 alter日志

2025-03-06T11:14:43.688418+08:00
SWITCHOVER VERIFY BEGIN
SWITCHOVER VERIFY COMPLETE
2025-03-06T11:14:43.912835+08:00
SWITCHOVER VERIFY BEGIN
SWITCHOVER VERIFY COMPLETE
2025-03-06T11:14:43.953764+08:00
ALTER SYSTEM SET fal_server='proddg01' SCOPE=BOTH;
2025-03-06T11:14:45.178054+08:00
 rfs (PID:15482): Possible network disconnect with primary database
2025-03-06T11:14:46.228999+08:00
 rfs (PID:19275): Selected LNO:4 for T-1.S-29 dbid 1034241150 branch 1144678208
2025-03-06T11:14:46.274210+08:00
ARC2 (PID:3850): Archived Log entry 21 added for T-1.S-29 ID 0x40a43ec6 LAD:1
2025-03-06T11:14:46.350743+08:00
PR00 (PID:23931): Resetting standby activation ID 1084505798 (0x40a43ec6)
2025-03-06T11:14:46.354742+08:00
Media Recovery End-Of-Redo indicator encountered
2025-03-06T11:14:46.354817+08:00
Media Recovery Continuing
PR00 (PID:23931): Media Recovery Waiting for T-1.S-30
2025-03-06T11:14:47.403981+08:00
.... (PID:19282): The Time Management Interface (TMI) is being enabled for role transition
.... (PID:19282): information.  This will result in messages beingoutput to the alert log
.... (PID:19282): file with the prefix 'TMI: '.  This is being enabled to make the timing of
.... (PID:19282): the various stages of the role transition available for diagnostic purposes.
.... (PID:19282): This output will end when the role transition is complete.
SWITCHOVER: received request 'ALTER DATABASE COMMIT TO SWITCHOVER  TO PRIMARY' from primary database.
2025-03-06T11:14:47.406793+08:00
ALTER DATABASE SWITCHOVER TO PRIMARY (PRODDG)
Maximum wait for role transition is 15 minutes.
TMI: kcv_commit_to_so_to_primary wait for MRP to finish BEGIN 2025-03-06 11:14:47.407974
Switchover: Media recovery is still active
 rmi (PID:19282): Role Change: Canceling MRP - no more redo to apply
2025-03-06T11:14:47.418214+08:00
PR00 (PID:23931): MRP0: Background Media Recovery cancelled with status 16037
2025-03-06T11:14:47.419088+08:00
Errors in file /u01/app/oracle/diag/rdbms/proddg02/PRODDG/trace/PRODDG_pr00_23931.trc:
ORA-16037: user requested cancel of managed recovery operation
PR00 (PID:23931): Managed Standby Recovery not using Real Time Apply
Recovery interrupted!
stopping change tracking
2025-03-06T11:14:47.522269+08:00
Errors in file /u01/app/oracle/diag/rdbms/proddg02/PRODDG/trace/PRODDG_pr00_23931.trc:
ORA-16037: user requested cancel of managed recovery operation
2025-03-06T11:14:48.698644+08:00
Background Media Recovery process shutdown (PRODDG)
2025-03-06T11:14:49.410809+08:00
 rmi (PID:19282): Role Change: Canceled MRP
TMI: kcv_commit_to_so_to_primary wait for MRP to finish END 2025-03-06 11:14:49.410941
TMI: kcv_commit_to_so_to_primary Switchover from physical BEGIN 2025-03-06 11:14:49.411137
 rmi (PID:19282): Killing 2 processes (PIDS:19268,15486) (all RFS) in order to disallow current and future RFS connections. Requested by OS process 19282
2025-03-06T11:14:49.412558+08:00
Process termination requested for pid 15486 [source = rdbms], [info = 2] [request issued by pid: 19282, uid: 54321]
2025-03-06T11:14:49.412728+08:00
Process termination requested for pid 19268 [source = rdbms], [info = 2] [request issued by pid: 19282, uid: 54321]
2025-03-06T11:14:52.479367+08:00
Stopping background process MMNL
2025-03-06T11:14:53.502333+08:00
Stopping background process MMON
2025-03-06T11:14:54.527170+08:00
Stopping Emon pool
Dispatchers and shared servers shutdown
CLOSE: killing server sessions.
2025-03-06T11:14:54.617095+08:00
Process termination requested for pid 3914 [source = rdbms], [info = 2] [request issued by pid: 19282, uid: 54321]
2025-03-06T11:14:54.618111+08:00
Process termination requested for pid 3846 [source = rdbms], [info = 2] [request issued by pid: 19282, uid: 54321]
2025-03-06T11:14:54.620348+08:00
Process termination requested for pid 3895 [source = rdbms], [info = 2] [request issued by pid: 19282, uid: 54321]
2025-03-06T11:14:54.622252+08:00
Process termination requested for pid 3906 [source = rdbms], [info = 2] [request issued by pid: 19282, uid: 54321]
2025-03-06T11:14:54.622498+08:00
Process termination requested for pid 3912 [source = rdbms], [info = 2] [request issued by pid: 19282, uid: 54321]
2025-03-06T11:14:54.624953+08:00
Process termination requested for pid 3893 [source = rdbms], [info = 2] [request issued by pid: 19282, uid: 54321]
2025-03-06T11:14:54.625423+08:00
Process termination requested for pid 3901 [source = rdbms], [info = 2] [request issued by pid: 19282, uid: 54321]
2025-03-06T11:14:54.628811+08:00
Process termination requested for pid 3899 [source = rdbms], [info = 2] [request issued by pid: 19282, uid: 54321]
2025-03-06T11:14:54.633283+08:00
Process termination requested for pid 3910 [source = rdbms], [info = 2] [request issued by pid: 19282, uid: 54321]
2025-03-06T11:14:54.656047+08:00
Active process 3787 user 'oracle' program 'oracle@host02 (W001)', waiting for 'Space Manager: slave idle wait'

Active process 3846 user 'oracle' program 'oracle@host02 (TNS V1-V3)', waiting for 'SQL*Net message from client'

Active process 6809 user 'oracle' program 'oracle@host02 (W005)', waiting for 'Space Manager: slave idle wait'

Active process 3946 user 'oracle' program 'oracle@host02 (W003)', waiting for 'Space Manager: slave idle wait'

Active process 6821 user 'oracle' program 'oracle@host02 (W006)', waiting for 'Space Manager: slave idle wait'

Active process 3783 user 'oracle' program 'oracle@host02 (W000)', waiting for 'Space Manager: slave idle wait'

Active process 6834 user 'oracle' program 'oracle@host02 (W007)', waiting for 'Space Manager: slave idle wait'

Active process 3759 user 'oracle' program 'oracle@host02 (SVCB)', waiting for 'wait for unread message on broadcast channel'

Active process 3934 user 'oracle' program 'oracle@host02 (W002)', waiting for 'Space Manager: slave idle wait'

Active process 3961 user 'oracle' program 'oracle@host02 (W004)', waiting for 'Space Manager: slave idle wait'

Active process 3787 user 'oracle' program 'oracle@host02 (W001)', waiting for 'Space Manager: slave idle wait'

Active process 3846 user 'oracle' program 'oracle@host02 (TNS V1-V3)', waiting for 'SQL*Net message from client'

Active process 6809 user 'oracle' program 'oracle@host02 (W005)', waiting for 'Space Manager: slave idle wait'

Active process 3946 user 'oracle' program 'oracle@host02 (W003)', waiting for 'Space Manager: slave idle wait'

Active process 6821 user 'oracle' program 'oracle@host02 (W006)', waiting for 'Space Manager: slave idle wait'

Active process 3783 user 'oracle' program 'oracle@host02 (W000)', waiting for 'Space Manager: slave idle wait'

Active process 6834 user 'oracle' program 'oracle@host02 (W007)', waiting for 'Space Manager: slave idle wait'

Active process 3759 user 'oracle' program 'oracle@host02 (SVCB)', waiting for 'wait for unread message on broadcast channel'

Active process 3934 user 'oracle' program 'oracle@host02 (W002)', waiting for 'Space Manager: slave idle wait'

Active process 3961 user 'oracle' program 'oracle@host02 (W004)', waiting for 'Space Manager: slave idle wait'

2025-03-06T11:14:56.685734+08:00
CLOSE: all sessions shutdown successfully.
2025-03-06T11:14:57.689957+08:00

IM on ADG: Start of Empty Journal 

IM on ADG: End of Empty Journal 
Stopping Emon pool
Backup controlfile written to trace file /u01/app/oracle/diag/rdbms/proddg02/PRODDG/trace/PRODDG_rmi_19282.trc
SwitchOver after complete recovery through change 2706526
 rmi (PID:19282): ORL pre-clearing operation disabled by switchover
Online log /u01/app/oracle/oradata/PRODDG/redo01.log: Thread 1 Group 1 was previously cleared
Online log /u01/app/oracle/oradata/PRODDG/redo02.log: Thread 1 Group 2 was previously cleared
Online log /u01/app/oracle/oradata/PRODDG/redo03.log: Thread 1 Group 3 was previously cleared
Standby became primary SCN: 2706524
Buffer Cache invalidation for all PDBs started
Buffer Cache invalidation for all PDBs complete
 rmi (PID:19282): RT: Role transition work is not done
 rmi (PID:19282): The Time Management Interface (TMI) is being enabled for role transition
 rmi (PID:19282): information.  This will result in messages beingoutput to the alert log
 rmi (PID:19282): file with the prefix 'TMI: '.  This is being enabled to make the timing of
 rmi (PID:19282): the various stages of the role transition available for diagnostic purposes.
 rmi (PID:19282): This output will end when the role transition is complete.
 rmi (PID:19282): Redo network throttle feature is disabled at mount time
AUDIT_TRAIL initialization parameter is changed back to its original value as specified in the parameter file.
2025-03-06T11:14:58.234023+08:00
 rmi (PID:19282): Database role cleared from PHYSICAL STANDBY [kcvs.c:1030]
Switchover: Complete - Database mounted as primary
TMI: kcv_commit_to_so_to_primary Switchover from physical END 2025-03-06 11:14:58.234359
SWITCHOVER: completed request from primary database.
2025-03-06T11:15:00.338529+08:00
Starting background process NSV1
2025-03-06T11:15:00.352198+08:00
NSV1 started with pid=24, OS id=19384 
2025-03-06T11:15:03.653956+08:00
ALTER SYSTEM SET fal_server='' SCOPE=BOTH;
2025-03-06T11:15:04.490864+08:00
RSM0 (PID:20150): Using STANDBY_ARCHIVE_DEST parameter default value as USE_DB_RECOVERY_FILE_DEST [krsd.c:18157]
2025-03-06T11:15:04.491603+08:00
ARC0 (PID:3841): Becoming the 'no SRL' ARCH
2025-03-06T11:15:04.495740+08:00
ALTER SYSTEM SET log_archive_dest_2='service="proddg01"','SYNC AFFIRM delay=0 optional compression=disable max_failure=0 reopen=300 db_unique_name="PRODDG01" net_timeout=30','valid_for=(online_logfile,all_roles)' SCOPE=BOTH;
2025-03-06T11:15:04.510311+08:00
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;
ALTER DATABASE OPEN
2025-03-06T11:15:04.512074+08:00
TMI: adbdrv open database BEGIN 2025-03-06 11:15:04.511989
Data Guard Broker initializing...
Buffer Cache invalidation for all PDBs started
Buffer Cache invalidation for all PDBs complete
2025-03-06T11:15:04.538305+08:00
Ping without log force is disabled:
  instance mounted in exclusive mode.
2025-03-06T11:15:04.539000+08:00
idle dispatcher 'D000' terminated, pid = (33, 1)
2025-03-06T11:15:04.563024+08:00
Assigning activation ID 1084569433 (0x40a53759)
LGWR (PID:3767): Primary database is in MAXIMUM AVAILABILITY mode
2025-03-06T11:15:04.571586+08:00
LGWR (PID:3767): LAD:2 is UNSYNCHRONIZED
LGWR (PID:3767): LAD:1 is not serviced by LGWR
2025-03-06T11:15:04.606666+08:00
Thread 1 advanced to log sequence 31 (thread open)
Redo log for group 2, sequence 31 is not located on DAX storage
Thread 1 opened at log sequence 31
  Current log# 2 seq# 31 mem# 0: /u01/app/oracle/oradata/PRODDG/redo02.log
Successful open of redo thread 1
2025-03-06T11:15:04.713023+08:00
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
stopping change tracking
2025-03-06T11:15:04.718093+08:00
ARC2 (PID:3850): Archived Log entry 22 added for T-1.S-30 ID 0x40a53759 LAD:1
2025-03-06T11:15:04.726847+08:00
TT03 (PID:19413): Sleep 5 seconds and then try to clear SRLs in 2 time(s)
2025-03-06T11:15:04.785099+08:00
Undo initialization recovery: err:0 start: 526594876 end: 526594935 diff: 59 ms (0.1 seconds)
[20150] Successfully onlined Undo Tablespace 2.
Undo initialization online undo segments: err:0 start: 526594935 end: 526595067 diff: 132 ms (0.1 seconds)
Undo initialization finished serial:0 start:526594876 end:526595071 diff:195 ms (0.2 seconds)
Dictionary check beginning
Dictionary check complete
Control autobackup written to DISK device

handle '/u01/app/oracle/fast_recovery_area/PRODDG02/autobackup/2025_03_06/o1_mf_s_1195038904_mwl4ss1l_.bkp'

Verifying minimum file header compatibility for tablespace encryption..
Verifying file header compatibility for tablespace encryption completed for pdb 0
Database Characterset is AL32UTF8
2025-03-06T11:15:05.133392+08:00
Starting background process SMCO
2025-03-06T11:15:05.147959+08:00
SMCO started with pid=15, OS id=19416 
No Resource Manager plan active
Starting background process SVCB
2025-03-06T11:15:05.435834+08:00
SVCB started with pid=36, OS id=19423 
joxcsys_required_dirobj_exists: directory object exists with required path /u01/app/oracle/product/19.3.0/dbhome_1/javavm/admin/, pid 20150 cid 0
2025-03-06T11:15:06.086032+08:00
LOGSTDBY: Validating controlfile with logical metadata
LOGSTDBY: Validation complete
Starting background process AQPC
2025-03-06T11:15:06.159001+08:00
AQPC started with pid=53, OS id=19445 
2025-03-06T11:15:06.357298+08:00
TT00 (PID:3843): Error 1034 received logging on to the standby
Starting background process MMNL
2025-03-06T11:15:06.605733+08:00
MMNL started with pid=54, OS id=19448 
Starting background process MMON
2025-03-06T11:15:06.620528+08:00
MMON started with pid=55, OS id=19450 
2025-03-06T11:15:07.029909+08:00
TMI: adbdrv open database END 2025-03-06 11:15:07.029751
Starting background process CJQ0
2025-03-06T11:15:07.080546+08:00
CJQ0 started with pid=56, OS id=19453 
2025-03-06T11:15:07.082014+08:00
Completed: ALTER DATABASE OPEN
2025-03-06T11:15:07.144759+08:00
ALTER SYSTEM SET fal_server='' SCOPE=BOTH;
2025-03-06T11:15:07.173698+08:00
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;
2025-03-06T11:15:07.175232+08:00
ALTER SYSTEM ARCHIVE LOG
2025-03-06T11:15:07.205143+08:00
Starting background process NSS2
2025-03-06T11:15:07.269691+08:00
NSS2 started with pid=57, OS id=19458 
2025-03-06T11:15:07.299693+08:00
TT00 (PID:3843): Error 1034 received logging on to the standby
2025-03-06T11:15:07.300745+08:00
Errors in file /u01/app/oracle/diag/rdbms/proddg02/PRODDG/trace/PRODDG_tt00_3843.trc:
ORA-01034: ORACLE not available
TT00 (PID:3843): krsg_check_connection: Error 1034 connecting to standby 'proddg01'
2025-03-06T11:15:10.481086+08:00
NSS2 (PID:19458): Error 1034 received logging on to the standby
2025-03-06T11:15:10.505801+08:00
Errors in file /u01/app/oracle/diag/rdbms/proddg02/PRODDG/trace/PRODDG_lgwr_3767.trc:
ORA-01034: ORACLE not available
2025-03-06T11:15:10.506507+08:00
LGWR (PID:3767): Error 1034 for LNO:3 to 'proddg01'
LGWR (PID:3767): Failed to archive LNO:3 T-1.S-32, error=1034
2025-03-06T11:15:10.521938+08:00
Thread 1 advanced to log sequence 32 (LGWR switch)
  Current log# 3 seq# 32 mem# 0: /u01/app/oracle/oradata/PRODDG/redo03.log
2025-03-06T11:15:10.832116+08:00
RSM0 (PID:20150): Archived Log entry 23 added for T-1.S-31 ID 0x40a53759 LAD:1
2025-03-06T11:15:11.448135+08:00
PL/SQL package SYS.DBMS_RCVMAN version 19.17.00.00 is too new
Oracle must be upgraded to version 08.00.04.00 to work with this package
2025-03-06T11:15:13.071651+08:00
PL/SQL package SYS.DBMS_RCVMAN version 19.17.00.00 is too new
Oracle must be upgraded to version 08.00.04.00 to work with this package
2025-03-06T11:15:13.325313+08:00
Starting background process FSFP
2025-03-06T11:15:13.441670+08:00
FSFP started with pid=68, OS id=19535 
2025-03-06T11:16:14.400615+08:00
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=MEMORY SID='*';
2025-03-06T11:16:15.512510+08:00
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;
2025-03-06T11:16:17.129154+08:00
LGWR (PID:3767): SRL selected to archive T-1.S-33
LGWR (PID:3767): SRL selected for T-1.S-33 for LAD:2
2025-03-06T11:16:17.165019+08:00
Thread 1 advanced to log sequence 33 (LGWR switch)
  Current log# 1 seq# 33 mem# 0: /u01/app/oracle/oradata/PRODDG/redo01.log
2025-03-06T11:16:17.198414+08:00
ARC1 (PID:3848): Archived Log entry 26 added for T-1.S-32 ID 0x40a53759 LAD:1
2025-03-06T11:16:17.724861+08:00
ARC2 (PID:3850): SRL selected for T-1.S-32 for LAD:2
2025-03-06T11:16:19.699617+08:00
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;
2025-03-06T11:16:19.699816+08:00
ALTER SYSTEM ARCHIVE LOG
2025-03-06T11:16:19.705840+08:00
Thread 1 cannot allocate new log, sequence 34
Checkpoint not complete
  Current log# 1 seq# 33 mem# 0: /u01/app/oracle/oradata/PRODDG/redo01.log
2025-03-06T11:16:22.710222+08:00
LGWR (PID:3767): LAD:2 is SYNCHRONIZED
LGWR (PID:3767): SRL selected to archive T-1.S-34
LGWR (PID:3767): SRL selected for T-1.S-34 for LAD:2
2025-03-06T11:16:22.779814+08:00
Thread 1 advanced to log sequence 34 (LGWR switch)
  Current log# 2 seq# 34 mem# 0: /u01/app/oracle/oradata/PRODDG/redo02.log
2025-03-06T11:16:22.796298+08:00
Expanded controlfile section 11 from 28 to 223 records
Requested to grow by 195 records; added 7 blocks of records
2025-03-06T11:16:22.796625+08:00
RSM0 (PID:20150): Archived Log entry 29 added for T-1.S-33 ID 0x4
复制

host01 alter日志

tail -f alert_PRODDG.log 
2025-03-06T11:15:55.495976+08:00
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
2025-03-06T11:15:55.531290+08:00
Initial number of CPU is 4
Capability Type : Network 
capabilities requested : 7 detected : 0 Simulated : 0
Capability Type : Runtime Environment 
capabilities requested : 400000FF detected : 40000000 Simulated : 0
Capability Type : Engineered Systems 
capabilities requested : F detected : 0 Simulated : 0
Capability Type : Database Test 
capabilities requested : 3 detected : 0 Simulated : 0
Capability Type : Database Editions 
capabilities requested : 1CC detected : 8 Simulated : 0
Using LOG_ARCHIVE_DEST_1 parameter default value as USE_DB_RECOVERY_FILE_DEST
.... (PID:): Fewer destinations available than specifiedby LOG_ARCHIVE_MIN_SUCCEED_DEST init.ora parameter
.... (PID:): Enable RFS client [kcrlc.c:601]
Autotune of undo retention is turned on. 
IMODE=BR
ILAT =55
LICENSE_MAX_USERS = 0
SYS auditing is enabled
NOTE: remote asm mode is local (mode 0x1; from cluster type)
NOTE: Using default ASM root directory ASM
NOTE: remote asm mode is local (mode 0x1; from cluster type)
NOTE: Cluster configuration type = NONE [2]
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.17.0.0.0.
ORACLE_HOME:    /u01/app/oracle/product/19.3.0/dbhome_1
System name:	Linux
Node name:	host01.example.com
Release:	2.6.32-431.el6.x86_64
Version:	#1 SMP Wed Nov 20 23:56:07 PST 2013
Machine:	x86_64
Using parameter settings in server-side spfile /u01/app/oracle/product/19.3.0/dbhome_1/dbs/spfilePRODDG.ora
System parameters with non-default values:
  processes                = 320
  standby_db_preserve_states= "BUFFER"
  nls_language             = "AMERICAN"
  nls_territory            = "AMERICA"
  memory_target            = 3008M
  control_files            = "/u01/app/oracle/oradata/PRODDG/control01.ctl"
  control_files            = "/u01/app/oracle/fast_recovery_area/PRODDG/control02.ctl"
  db_file_name_convert     = "/PRODDG02/"
  db_file_name_convert     = "/PRODDG01/"
  log_file_name_convert    = "/PRODDG02/"
  log_file_name_convert    = "/PRODDG01/"
  db_block_size            = 8192
  compatible               = "19.0.0"
  log_archive_dest_2       = "service="proddg02""
  log_archive_dest_2       = "SYNC AFFIRM delay=0 optional compression=disable max_failure=0 reopen=300 db_unique_name="PRODDG02" net_timeout=30"
  log_archive_dest_2       = "valid_for=(online_logfile,all_roles)"
  log_archive_dest_state_2 = "ENABLE"
  fal_server               = ""
  log_archive_config       = "dg_config=(PRODDG01,PRODDG02)"
  log_archive_format       = "log%t_%s_%r.arc"
  db_recovery_file_dest    = "/u01/app/oracle/fast_recovery_area"
  db_recovery_file_dest_size= 8256M
  standby_file_management  = "AUTO"
  temp_undo_enabled        = TRUE
  undo_tablespace          = "UNDOTBS1"
  remote_login_passwordfile= "EXCLUSIVE"
  db_domain                = "example.com"
  dispatchers              = "(PROTOCOL=TCP) (SERVICE=PRODDGXDB)"
  local_listener           = ""
  audit_file_dest          = "/u01/app/oracle/admin/PRODDG/adump"
  audit_trail              = "DB"
  db_name                  = "PRODDG"
  db_unique_name           = "PRODDG01"
  open_cursors             = 300
  dg_broker_start          = TRUE
  diagnostic_dest          = "/u01/app/oracle"
2025-03-06T11:15:55.891284+08:00
============================================================
NOTE: PatchLevel of this instance 0
============================================================
2025-03-06T11:15:56.611583+08:00
Starting background process PMON
2025-03-06T11:15:56.661199+08:00
PMON started with pid=2, OS id=118232 
Starting background process CLMN
2025-03-06T11:15:56.727211+08:00
CLMN started with pid=3, OS id=118236 
Starting background process PSP0
Starting background process VKTM
2025-03-06T11:15:56.793811+08:00
PSP0 started with pid=4, OS id=118240 
2025-03-06T11:15:57.879528+08:00
VKTM started with pid=5, OS id=118244 at elevated (RT) priority
2025-03-06T11:15:57.879854+08:00
Starting background process GEN0
2025-03-06T11:15:57.891895+08:00
VKTM reset to run at normal priority
VKTM running at (100ms) precision 
Starting background process MMAN
2025-03-06T11:15:57.942446+08:00
GEN0 started with pid=6, OS id=118250 
2025-03-06T11:15:58.011100+08:00
MMAN started with pid=7, OS id=118256 
Starting background process GEN1
Starting background process DIAG
2025-03-06T11:15:58.170976+08:00
GEN1 started with pid=9, OS id=118262_118263 
Starting background process OFSD
2025-03-06T11:15:58.220587+08:00
DIAG started with pid=11, OS id=118265 
Starting background process DBRM
2025-03-06T11:15:58.314259+08:00
OFSD started with pid=12, OS id=118267_118268 
2025-03-06T11:15:58.322638+08:00
Oracle running with ofslib:'Oracle File Server Library' version=2 inc=1
Starting background process VKRM
2025-03-06T11:15:58.370226+08:00
DBRM started with pid=14, OS id=118270 
Starting background process SVCB
2025-03-06T11:15:58.428605+08:00
VKRM started with pid=15, OS id=118274 
Starting background process PMAN
2025-03-06T11:15:58.475255+08:00
SVCB started with pid=16, OS id=118276 
2025-03-06T11:15:58.535751+08:00
PMAN started with pid=8, OS id=118278 
Starting background process DIA0
Starting background process DBW0
2025-03-06T11:15:58.572970+08:00
DIA0 started with pid=17, OS id=118282 
Starting background process LGWR
2025-03-06T11:15:58.648471+08:00
DBW0 started with pid=18, OS id=118284 
2025-03-06T11:15:58.711536+08:00
LGWR started with pid=19, OS id=118288 
Starting background process CKPT
2025-03-06T11:15:58.780810+08:00
CKPT started with pid=20, OS id=118292 
Starting background process SMON
2025-03-06T11:15:58.852619+08:00
LGWR slave LG00 created with pid=21, OS pid=118296
2025-03-06T11:15:58.921428+08:00
SMON started with pid=22, OS id=118298 
2025-03-06T11:15:58.978460+08:00
Starting background process SMCO
LGWR slave LG01 created with pid=23, OS pid=118302
2025-03-06T11:15:59.045966+08:00
SMCO started with pid=24, OS id=118304 
Starting background process RECO
2025-03-06T11:15:59.108559+08:00
RECO started with pid=25, OS id=118306 
Starting background process LREG
2025-03-06T11:15:59.225244+08:00
LREG started with pid=27, OS id=118310 
Starting background process PXMN
2025-03-06T11:15:59.330942+08:00
PXMN started with pid=29, OS id=118316 
Starting background process DMON
Starting background process FENC
2025-03-06T11:15:59.392699+08:00
DMON started with pid=30, OS id=118318 
2025-03-06T11:15:59.450812+08:00
FENC started with pid=31, OS id=118320 
Starting background process MMON
Starting background process MMNL
2025-03-06T11:15:59.499294+08:00
MMON started with pid=32, OS id=118324 
2025-03-06T11:15:59.543953+08:00
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
2025-03-06T11:15:59.544006+08:00
MMNL started with pid=31, OS id=118326 
starting up 1 shared server(s) ...
Starting background process TMON
2025-03-06T11:15:59.711854+08:00
TMON started with pid=35, OS id=118332 
ORACLE_BASE from environment = /u01/app/oracle
2025-03-06T11:15:59.829361+08:00
alter database mount
2025-03-06T11:16:01.379328+08:00
Using default pga_aggregate_limit of 3008 MB
2025-03-06T11:16:03.868475+08:00
.... (PID:118334): RT: Role transition work is not done
.... (PID:118334): Redo network throttle feature is disabled at mount time
Starting background process NSS2
2025-03-06T11:16:03.923238+08:00
NSS2 started with pid=39, OS id=118344 
2025-03-06T11:16:03.937805+08:00
Successful mount of redo thread 1, with mount id 1084578863
2025-03-06T11:16:03.940033+08:00
Allocating 15937344 bytes in shared pool for flashback generation buffer.
Allocated 15937344 bytes in shared pool for flashback generation buffer
Starting background process RVWR
2025-03-06T11:16:04.015053+08:00
RVWR started with pid=40, OS id=118346 
.... (PID:118334): Database role set to PHYSICAL STANDBY [kcvfdb.c:9459]
Physical Standby Database mounted.
.... (PID:118334): STARTING ARCH PROCESSES
2025-03-06T11:16:04.184606+08:00
TT00 (PID:118350): Gap Manager starting
Starting background process ARC0
2025-03-06T11:16:04.246960+08:00
ARC0 started with pid=42, OS id=118352 
2025-03-06T11:16:04.257272+08:00
.... (PID:118334): ARC0: Archival started
.... (PID:118334): STARTING ARCH PROCESSES COMPLETE
2025-03-06T11:16:04.257855+08:00
ARC0 (PID:118352): Becoming a 'no FAL' ARCH
2025-03-06T11:16:04.258958+08:00
In-memory operation on ADG is currently only supported on Engineered systems and PaaS.
inmemory_adg_enabled is turned off automatically.
Please contact our support team for EXADATA solutions
Lost write protection disabled
.... (PID:118334): Using STANDBY_ARCHIVE_DEST parameter default value as USE_DB_RECOVERY_FILE_DEST [krsd.c:18237]
2025-03-06T11:16:04.326157+08:00
TMON (PID:118332): STARTING ARCH PROCESSES
Starting background process ARC1
Starting background process ARC2
2025-03-06T11:16:04.401818+08:00
ARC1 started with pid=44, OS id=118356 
2025-03-06T11:16:04.436977+08:00
Archiving previously deferred ORLs (PRODDG)
2025-03-06T11:16:04.438958+08:00
NET  (PID:118334): End-Of-Redo Branch archival of T-1.S-29
Starting background process ARC3
2025-03-06T11:16:04.464870+08:00
ARC2 started with pid=45, OS id=118358 
2025-03-06T11:16:04.526748+08:00
TMON (PID:118332): ARC1: Archival started
TMON (PID:118332): ARC2: Archival started
2025-03-06T11:16:04.527584+08:00
ARC3 started with pid=46, OS id=118360 
TMON (PID:118332): ARC3: Archival started
TMON (PID:118332): STARTING ARCH PROCESSES COMPLETE
2025-03-06T11:16:04.559100+08:00
NET  (PID:118334): Archived Log entry 38 added for T-1.S-29 ID 0x40a43ec6 LAD:1
Completed: alter database mount
alter database open
Data Guard Broker initializing...
2025-03-06T11:16:07.394253+08:00
Starting Data Guard Broker (DMON)
Starting background process INSV
2025-03-06T11:16:07.430289+08:00
INSV started with pid=47, OS id=118362 
2025-03-06T11:16:11.492944+08:00
ALTER SYSTEM SET fal_server='proddg02' SCOPE=BOTH;
Starting background process NSV0
2025-03-06T11:16:11.553264+08:00
NSV0 started with pid=48, OS id=118364 
2025-03-06T11:16:11.585126+08:00
Data Guard Broker initialization complete
AUDIT_TRAIL initialization parameter is changed to OS, as DB is NOT compatible for database opened with read-only access
Smart fusion block transfer is disabled:
  instance mounted in exclusive mode.
2025-03-06T11:16:11.611983+08:00
Beginning Standby Crash Recovery.
 Started logmerger process
2025-03-06T11:16:11.755162+08:00
PR00 (PID:118368): Managed Standby Recovery starting Real Time Apply
2025-03-06T11:16:11.968314+08:00
Parallel Media Recovery started with 4 slaves
2025-03-06T11:16:12.099125+08:00
Stopping change tracking
2025-03-06T11:16:12.211369+08:00
Media Recovery Log /u01/app/oracle/fast_recovery_area/PRODDG01/archivelog/2025_03_06/o1_mf_1_29_mwl4vnjb_.arc
2025-03-06T11:16:12.361303+08:00
PR00 (PID:118368): Resetting standby activation ID 0 (0x0)
2025-03-06T11:16:12.362758+08:00
Incomplete Recovery applied until change 2706526 time 03/06/2025 11:14:46
Stopping change tracking
2025-03-06T11:16:12.484746+08:00
Completed Standby Crash Recovery.
Endian type of dictionary set to little
2025-03-06T11:16:12.704298+08:00
Undo initialization finished serial:0 start:337978054 end:337978054 diff:0 ms (0.0 seconds)
Dictionary check beginning
Dictionary check complete
Database Characterset is AL32UTF8
No Resource Manager plan active
NET  (PID:118334): Disable RFS client [kcrlc.c:620]
2025-03-06T11:16:13.606695+08:00
replication_dependency_tracking turned off (no async multimaster replication found)
2025-03-06T11:16:14.026742+08:00
Physical standby database opened for read only access.
2025-03-06T11:16:14.048057+08:00
Unable to obtain current patch information as the database or pluggable database was opened for read-only access.
===========================================================
Dumping current patch information
===========================================================
Unable to obtain current patch information due to error: 16000
===========================================================
Completed: alter database open
2025-03-06T11:16:14.553513+08:00
 rfs (PID:118406): krsr_rfs_atc: Identified database type as 'PHYSICAL STANDBY': Client is Foreground (PID:3843)
 rfs (PID:118406): Enable RFS client [krsr.c:5709]
2025-03-06T11:16:14.835966+08:00
 rfs (PID:118410): krsr_rfs_atc: Identified database type as 'PHYSICAL STANDBY': Client is FAL (PID:3852)
2025-03-06T11:16:14.846767+08:00
 rfs (PID:118412): krsr_rfs_atc: Identified database type as 'PHYSICAL STANDBY': Client is FAL (PID:3848)
2025-03-06T11:16:14.966993+08:00
 rfs (PID:118410): Opened log for T-1.S-30 dbid 1034241150 branch 1144678208
2025-03-06T11:16:14.974659+08:00
 rfs (PID:118412): Opened log for T-1.S-31 dbid 1034241150 branch 1144678208
2025-03-06T11:16:15.062037+08:00
db_recovery_file_dest_size of 8256 MB is 7.48% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
2025-03-06T11:16:15.101725+08:00
 rfs (PID:118410): Archived Log entry 39 added for B-1144678208.T-1.S-30 ID 0x40a53759 LAD:1
2025-03-06T11:16:15.109805+08:00
 rfs (PID:118412): Archived Log entry 40 added for B-1144678208.T-1.S-31 ID 0x40a53759 LAD:1
2025-03-06T11:16:15.620686+08:00
Starting background process RSM0
2025-03-06T11:16:15.736647+08:00
RSM0 started with pid=62, OS id=118414 
2025-03-06T11:16:17.118177+08:00
 rfs (PID:118416): krsr_rfs_atc: Identified database type as 'PHYSICAL STANDBY': Client is SYNC (PID:3767)
 rfs (PID:118416): Primary database is in MAXIMUM AVAILABILITY mode
 rfs (PID:118416): Changing standby controlfile to RESYNCHRONIZATION level
 rfs (PID:118416): Standby controlfile consistent with primary
2025-03-06T11:16:17.178259+08:00
 rfs (PID:118416): Selected LNO:4 for T-1.S-33 dbid 1034241150 branch 1144678208
2025-03-06T11:16:17.396815+08:00
 rfs (PID:118418): krsr_rfs_atc: Identified database type as 'PHYSICAL STANDBY': Client is FAL (PID:3850)
2025-03-06T11:16:17.550454+08:00
 rfs (PID:118418): Selected LNO:5 for T-1.S-32 dbid 1034241150 branch 1144678208
2025-03-06T11:16:18.050137+08:00
ARC3 (PID:118360): Archived Log entry 41 added for T-1.S-32 ID 0x40a53759 LAD:1
2025-03-06T11:16:19.770778+08:00
RSM0 (PID:118414): Using STANDBY_ARCHIVE_DEST parameter default value as USE_DB_RECOVERY_FILE_DEST [krsd.c:18237]
2025-03-06T11:16:19.777237+08:00
ALTER SYSTEM SET log_archive_dest_2='' SCOPE=BOTH;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT  NODELAY
2025-03-06T11:16:19.798507+08:00
Attempt to start background Managed Standby Recovery process (PRODDG)
Starting background process MRP0
2025-03-06T11:16:19.849217+08:00
MRP0 started with pid=67, OS id=118424 
2025-03-06T11:16:19.852243+08:00
Background Managed Standby Recovery process started (PRODDG)
2025-03-06T11:16:22.767778+08:00
 rfs (PID:118416): Changing standby controlfile to MAXIMUM AVAILABILITY level
2025-03-06T11:16:22.782789+08:00
 rfs (PID:118416): Selected LNO:5 for T-1.S-34 dbid 1034241150 branch 1144678208
2025-03-06T11:16:22.824548+08:00
ARC1 (PID:118356): Archived Log entry 42 added for T-1.S-33 ID 0x40a53759 LAD:1
2025-03-06T11:16:24.888853+08:00
 Started logmerger process
2025-03-06T11:16:24.897631+08:00

IM on ADG: Start of Empty Journal 

IM on ADG: End of Empty Journal 
PR00 (PID:118430): Managed Standby Recovery starting Real Time Apply
2025-03-06T11:16:25.135279+08:00
Parallel Media Recovery started with 4 slaves
2025-03-06T11:16:25.176262+08:00
Stopping change tracking
2025-03-06T11:16:25.217218+08:00
TT02 (PID:118440): Waiting for all non-current ORLs to be archived
2025-03-06T11:16:25.217699+08:00
TT02 (PID:118440): All non-current ORLs have been archived
TT02 (PID:118440): Clearing ORL LNO:1 /u01/app/oracle/oradata/PRODDG/redo01.log
Clearing online log 1 of thread 1 sequence number 28
2025-03-06T11:16:25.261739+08:00
PR00 (PID:118430): Media Recovery Log /u01/app/oracle/fast_recovery_area/PRODDG01/archivelog/2025_03_06/o1_mf_1_30_mwl4vyxv_.arc
2025-03-06T11:16:25.372795+08:00
PR00 (PID:118430): Media Recovery Log /u01/app/oracle/fast_recovery_area/PRODDG01/archivelog/2025_03_06/o1_mf_1_31_mwl4vyy9_.arc
2025-03-06T11:16:25.613879+08:00
PR00 (PID:118430): Media Recovery Log /u01/app/oracle/fast_recovery_area/PRODDG01/archivelog/2025_03_06/o1_mf_1_32_mwl4w20q_.arc
2025-03-06T11:16:25.742656+08:00
PR00 (PID:118430): Media Recovery Log /u01/app/oracle/fast_recovery_area/PRODDG01/archivelog/2025_03_06/o1_mf_1_33_mwl4w6rv_.arc
PR00 (PID:118430): Media Recovery Waiting for T-1.S-34 (in transit)
2025-03-06T11:16:25.841172+08:00
Recovery of Online Redo Log: Thread 1 Group 5 Seq 34 Reading mem 0
  Mem# 0: /u01/app/oracle/oradata/PRODDG/std_redo03.log
2025-03-06T11:16:25.858214+08:00
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT  NODELAY
2025-03-06T11:16:28.095160+08:00
TT02 (PID:118440): Clearing ORL LNO:1 complete
TT02 (PID:118440): Clearing ORL LNO:2 /u01/app/oracle/oradata/PRODDG/redo02.log
Clearing online log 2 of thread 1 sequence number 29
2025-03-06T11:16:31.556104+08:00
TT02 (PID:118440): Clearing ORL LNO:2 complete
TT02 (PID:118440): Clearing ORL LNO:3 /u01/app/oracle/oradata/PRODDG/redo03.log
Clearing online log 3 of thread 1 sequence number 27
2025-03-06T11:16:40.263118+08:00
TT02 (PID:118440): Clearing ORL LNO:3 complete
2025-03-06T11:16:45.268675+08:00
TT02 (PID:118440): Waiting for all non-current ORLs to be archived
2025-03-06T11:16:45.269083+08:00
TT02 (PID:118440): All non-current ORLs have been archived
复制

host01

SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on,SWITCHOVER_STATUS from v$database;

DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON	   SWITCHOVER_STATUS
------------------ --------------------
PRODDG01		       PRIMARY		READ WRITE
YES		   TO STANDBY


SYS@PRODDG>conn / as sysdba
Connected.
SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on,SWITCHOVER_STATUS from v$database;

DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON	   SWITCHOVER_STATUS
------------------ --------------------
PRODDG01		       PHYSICAL STANDBY READ ONLY WITH APPLY
YES		   NOT ALLOWED

复制

host02

SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on,SWITCHOVER_STATUS from v$database;

DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON	   SWITCHOVER_STATUS
------------------ --------------------
PRODDG02		       PHYSICAL STANDBY READ ONLY WITH APPLY
YES		   NOT ALLOWED


SYS@PRODDG>conn / as sysdba
ERROR:
ORA-03113: end-of-file on communication channel
Process ID: 0
Session ID: 10 Serial number: 55328


Connected.
SYS@PRODDG>select db_unique_name,database_role,open_mode,flashback_on,SWITCHOVER_STATUS from v$database;

DB_UNIQUE_NAME		       DATABASE_ROLE	OPEN_MODE
------------------------------ ---------------- --------------------
FLASHBACK_ON	   SWITCHOVER_STATUS
------------------ --------------------
PRODDG02		       PRIMARY		READ WRITE
YES		   TO STANDBY
SYS@PRODDG>insert into t1 values(10);

1 row created.

SYS@PRODDG>commit;

Commit complete.
SYS@PRODDG>select * from t1;

	 A
----------
	 1
	 3
	 5
	10

复制

host01

SYS@PRODDG>select * from t1;

	 A
----------
	 1
	 3
	 5
	10
复制
最后修改时间:2025-03-06 11:27:11
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

目录
  • 环境
  • 一、通过冷备方式把数据库PRODDG同步到host02
    • 1、先把PRODDG启用归档后关库,并创建pfile文件
    • 2、复制pfile、pwfile到表空间文件夹,打包后发送到备库
  • 二、修改pfile配置,启动主备库模式
    • 1、主库编辑pfile
    • 2、备库编辑pfile
    • 3、根据pfile启动主库、启动强制日志、添加备库日志、创建备库控制文件
    • 4、根据pfile启动备库到mount状态,使用rman根据备库控制文件恢复
    • 5、测试
  • 三、snapshot测试
    • 1、由standby切换到snapshot
    • 2、由snapshot切换到standby
  • 四、切换主备库
    • 1、host01中先验证后切换。
    • 2、host02验证 测试
    • 3、host01查询
  • 五、开启borker,配置dgmgrl
    • 1、主备库均需开启borker,重置archive,并重启数据库使生效
    • 2、配置dgmgrl
    • 2、启动fast_start failover
    • 3、switchover测试