On this activity we are going to setup Dataguard at PDB level.
Here both DB’s are running on the same host but on different ORACLE_HOME.
This was first introduced on 21c and we are going to follow the Oracle documentation from here.
First DB (as SOURCE DB):
INST HOST INST_NAME STATUS DB_ROLE OPEN_MODE STARTUP_TIME
---- ------------------ ---------- ---------- ----------------- --------------------- --------------------
*1 ol8_23ai db23ai OPEN PRIMARY READ WRITE 10-SEP-2024 12:39:23
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DB23AIPDB1 READ WRITE NO
4 DB23AIPDB2 READ WRITE NO
SQL>
Second DB (as TARGET DB):
INST HOST INST_NAME STATUS DB_ROLE OPEN_MODE STARTUP_TIME
---- ------------------ ---------- ---------- ----------------- --------------------- --------------------
*1 ol8_23ai db23aistb OPEN PRIMARY READ WRITE 10-SEP-2024 12:43:43
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DB23STBPDB1 READ WRITE NO
4 DB23STBPDB2 READ WRITE NO
SQL>
1:- Both DB’s need to have force logging and flashback
SQL> ALTER DATABASE FORCE LOGGING;
Database altered.
SQL> ALTER DATABASE FLASHBACK ON;
Database altered.
SQL> alter system set dg_broker_start=TRUE;
2:- We need to create a wallet for each of the DB’s:
db23ai:
[oracle@ol8_23ai ~]$ . oraenv
ORACLE_SID = [db23ai] ? db23ai
[oracle@ol8_23ai ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/23ai/db_home1
[oracle@ol8_23ai ~]$ mkdir -p $ORACLE_HOME/dbs/wallets
[oracle@ol8_23ai ~]$ chmod -R 700 $ORACLE_HOME/dbs/wallets
[oracle@ol8_23ai ~]$ mkstore -wrl $ORACLE_HOME/dbs/wallets/dgpdb -create
Oracle Secret Store Tool Release 23.0.0.0.0 - Production
Version 23.0.0.0.0
Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
Enter password:
Enter password again:
[oracle@ol8_23ai ~]$
[oracle@ol8_23ai ~]$ mkstore -wrl $ORACLE_HOME/dbs/wallets/dgpdb -createCredential db23ai 'sys'
Oracle Secret Store Tool Release 23.0.0.0.0 - Production
Version 23.0.0.0.0
Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
Your secret/Password is missing in the command line
Enter your secret/Password: <<----- "SYS PASSWORD"
Re-enter your secret/Password:
Enter wallet password:
[oracle@ol8_23ai ~]$
[oracle@ol8_23ai ~]$ mkstore -wrl $ORACLE_HOME/dbs/wallets/dgpdb -createCredential db23aistb 'sys'
Oracle Secret Store Tool Release 23.0.0.0.0 - Production
Version 23.0.0.0.0
Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
Your secret/Password is missing in the command line
Enter your secret/Password:
Re-enter your secret/Password:
Enter wallet password:
[oracle@ol8_23ai ~]$
[oracle@ol8_23ai ~]$ ls -tlr $ORACLE_HOME/dbs/wallets/dgpdb
total 8
-rw-------. 1 oracle oinstall 0 Sep 10 22:37 ewallet.p12.lck
-rw-------. 1 oracle oinstall 0 Sep 10 22:37 cwallet.sso.lck
-rw-------. 1 oracle oinstall 974 Sep 10 23:07 ewallet.p12
-rw-------. 1 oracle oinstall 1019 Sep 10 23:07 cwallet.sso
[oracle@ol8_23ai ~]$
db23aistb:
[oracle@ol8_23ai ~]$ . oraenv
ORACLE_SID = [db23aistb] ? db23aistb
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@ol8_23ai ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/23ai/db_home2
[oracle@ol8_23ai ~]$ mkdir -p $ORACLE_HOME/dbs/wallets
[oracle@ol8_23ai ~]$ chmod -R 700 $ORACLE_HOME/dbs/wallets
[oracle@ol8_23ai ~]$ mkstore -wrl $ORACLE_HOME/dbs/wallets/dgpdb -create
Oracle Secret Store Tool Release 23.0.0.0.0 - Production
Version 23.0.0.0.0
Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
Enter password:
Enter password again:
[oracle@ol8_23ai ~]$
[oracle@ol8_23ai ~]$ mkstore -wrl $ORACLE_HOME/dbs/wallets/dgpdb -createCredential db23aistb 'sys'
Oracle Secret Store Tool Release 23.0.0.0.0 - Production
Version 23.0.0.0.0
Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
Your secret/Password is missing in the command line
Enter your secret/Password: <<----- "SYS PASSWORD"
Re-enter your secret/Password:
Enter wallet password:
[oracle@ol8_23ai ~]$
[oracle@ol8_23ai ~]$ mkstore -wrl $ORACLE_HOME/dbs/wallets/dgpdb -createCredential db23ai 'sys'
Oracle Secret Store Tool Release 23.0.0.0.0 - Production
Version 23.0.0.0.0
Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
Your secret/Password is missing in the command line
Enter your secret/Password:
Re-enter your secret/Password:
Enter wallet password:
[oracle@ol8_23ai ~]$
[oracle@ol8_23ai ~]$ ls -tlr $ORACLE_HOME/dbs/wallets/dgpdb
total 8
-rw-------. 1 oracle oinstall 0 Sep 10 22:40 ewallet.p12.lck
-rw-------. 1 oracle oinstall 0 Sep 10 22:40 cwallet.sso.lck
-rw-------. 1 oracle oinstall 606 Sep 10 22:40 ewallet.p12
-rw-------. 1 oracle oinstall 651 Sep 10 22:40 cwallet.sso
[oracle@ol8_23ai ~]$
3:- Edit sqlnet.ora’s:
[oracle@ol8_23ai ~]$ cat /u01/app/oracle/product/23ai/db_home1/network/admin/sqlnet.ora
# sqlnet.ora Network Configuration File: /u01/app/oracle/product/23ai/db_home1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = /u01/app/oracle/product/23ai/db_home1/dbs/wallets/dgpdb)
)
)
SQLNET.WALLET_OVERRIDE = TRUE
[oracle@ol8_23ai ~]$
[oracle@ol8_23ai ~]$ cat /u01/app/oracle/product/23ai/db_home2/network/admin/sqlnet.ora
# sqlnet.ora Network Configuration File: /u01/app/oracle/product/23ai/db_home2/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = /u01/app/oracle/product/23ai/db_home2/dbs/wallets/dgpdb)
)
)
SQLNET.WALLET_OVERRIDE = TRUE
[oracle@ol8_23ai ~]$
4:- Restart Databases.
5:- Create configuration for SOURCE DB:
[oracle@ol8_23ai ~]$ . oraenv
ORACLE_SID = [db23ai] ?
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@ol8_23ai ~]$ dgmgrl /@db23ai
DGMGRL for Linux: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Tue Sep 10 22:58:04 2024
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "db23ai"
Connected as SYSDBA.
DGMGRL>
DGMGRL> CREATE CONFIGURATION 'db23ai' AS CONNECT IDENTIFIER IS db23ai;
Connected to "db23ai"
Configuration "db23ai" created with primary database "db23ai"
DGMGRL> show configuration
Configuration - db23ai
Protection Mode: MaxPerformance
Members:
db23ai - Primary database
Fast-Start Failover: Disabled
Configuration Status:
DISABLED
DGMGRL>
6:- Create configuration for TARGET DB:
[oracle@ol8_23ai ~]$ . oraenv
ORACLE_SID = [db23aistb] ? db23aistb
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@ol8_23ai ~]$ dgmgrl /@db23aistb
DGMGRL for Linux: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Tue Sep 10 23:01:44 2024
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle and/or its affiliates. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected to "db23aistb"
Connected as SYSDBA.
DGMGRL>
DGMGRL> CREATE CONFIGURATION 'db23aistb' AS CONNECT IDENTIFIER IS db23aistb;
Connected to "db23aistb"
Configuration "db23aistb" created with primary database "db23aistb"
DGMGRL> show configuration
Configuration - db23aistb
Protection Mode: MaxPerformance
Members:
db23aistb - Primary database
Fast-Start Failover: Disabled
Configuration Status:
DISABLED
DGMGRL>
7:- Link both connections.
[oracle@ol8_23ai ~]$ dgmgrl /@db23ai
....
Connected to "db23ai"
Connected as SYSDBA.
DGMGRL> ADD CONFIGURATION 'db23aistb' CONNECT IDENTIFIER IS db23aistb;
Configuration db23aistb added.
DGMGRL> show configuration
Configuration - db23ai
Protection Mode: MaxPerformance
Members:
db23ai - Primary database
db23aistb - Primary database in db23aistb configuration
Fast-Start Failover: Disabled
Configuration Status:
DISABLED
DGMGRL>
Confirm the other DB see the same:
[oracle@ol8_23ai ~]$ dgmgrl /@db23aistb
....
Connected to "db23aistb"
Connected as SYSDBA.
DGMGRL> show configuration
Configuration - db23aistb
Protection Mode: MaxPerformance
Members:
db23aistb - Primary database
db23ai - Primary database in db23ai configuration
Fast-Start Failover: Disabled
Configuration Status:
DISABLED
DGMGRL>
8:- Enable configuration.
DGMGRL> ENABLE CONFIGURATION ALL;
Enabled.
DGMGRL>
9:- Prepare DB’s for Dataguard PDB ( DG PDB):
1:- make sure all pdb's are OPEN.
2:- [oracle@ol8_23ai ~]$ dgmgrl /@db23ai
...
Connected to "db23ai"
Connected as SYSDBA.
DGMGRL> EDIT CONFIGURATION PREPARE DGPDB;
Enter password for DGPDB_INT account at db23ai:
Enter password for DGPDB_INT account at db23aistb:
Prepared Data Guard for Pluggable Database at db23aistb.
Prepared Data Guard for Pluggable Database at db23ai.
DGMGRL>
** this creates the user DGPDB_INT on both containers.
10:- Add PDB to dataguard:
*** NOTE: the standby PDB, must not exist already, otherwise you will recieve this error:
DGMGRL> ADD PLUGGABLE DATABASE 'DB23STBPDB1' AT db23aistb SOURCE is 'DB23AIPDB1' AT db23ai PDBFileNameConvert is "'/DB23AI/db23aipdb1','/DB23AISTB/db23stbpdb1'";
DGM-17432: Pluggable database 'DB23STBPDB1' already exists(*) in container database 'db23aistb'
(*) - in primary role
Failed.
DGMGRL>
Here we are creating the new PDB "DB23PDB1_DR" which is goign to be the standby for PDB DB23AIPDB1:
DGMGRL> ADD PLUGGABLE DATABASE 'DB23PDB1_DR' AT db23aistb SOURCE is 'DB23AIPDB1' AT db23ai PDBFileNameConvert is "'/DB23AI/db23aipdb1','/DB23AISTB/db23pdb1_dr'";
Pluggable Database "DB23PDB1_DR" added
DGMGRL>
11:- Create backup of SOURCE PBD DB23AIPDB1:
1:- Connect to source PDB and "BEGIN BACKUP":
SQL> show parameter instance_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string db23ai
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DB23AIPDB1 READ WRITE NO
4 DB23AIPDB2 READ WRITE NO
SQL>
SQL> ALTER SESSION SET CONTAINER=DB23AIPDB1;
Session altered.
SQL> ALTER DATABASE BEGIN BACKUP;
Database altered.
SQL>
2:- Create directory for the standby pdb and copy PDB datafiles
[oracle@ol8_23ai ~]$ mkdir /u02/database/DB23AISTB/db23pdb1_dr
[oracle@ol8_23ai ~]$ cp -p /u02/database/DB23AI/db23aipdb1/* /u02/database/DB23AISTB/db23pdb1_dr/
3:- End backup:
SQL> ALTER DATABASE END BACKUP;
Database altered.
12: Create Standby redo logs on PDB DB23PDB1_DR:
SQL> ALTER SESSION SET CONTAINER=DB23PDB1_DR;
Session altered.
SQL> ALTER DATABASE ADD STANDBY LOGFILE thread 1 group 4 ('/u02/database/DB23AISTB/standy_redo_pdb_01') size 200M;
Database altered.
SQL> ALTER DATABASE ADD STANDBY LOGFILE thread 1 group 5 ('/u02/database/DB23AISTB/standy_redo_pdb_02') size 200M;
Database altered.
SQL> ALTER DATABASE ADD STANDBY LOGFILE thread 1 group 6 ('/u02/database/DB23AISTB/standy_redo_pdb_03') size 200M;
Database altered.
SQL> ALTER DATABASE ADD STANDBY LOGFILE thread 1 group 7 ('/u02/database/DB23AISTB/standy_redo_pdb_04') size 200M;
Database altered.
SQL>
13:- Enable APPLY:
DGMGRL> validate pluggable database db23pdb1_dr at db23aistb;
Ready for Switchover: NO
Data Guard Role: Physical Standby
Apply State: Not Running
Standby Redo Log Files: 4
Source: DB23AIPDB1 (con_id 3) at db23ai
DGMGRL>
DGMGRL> edit pluggable database db23pdb1_dr at db23aistb set state='apply-on';
Succeeded.
14: -Force log switch on SOURCE and check state again:
SQL> show parameter instance_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string db23ai
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL> alter system archive log current;
System altered.
SQL> alter system archive log current;
System altered.
SQL>
[oracle@ol8_23ai ~]$ dgmgrl /@db23ai
DGMGRL> show pluggable database db23pdb1_dr at db23aistb;
Pluggable database - DB23PDB1_DR at db23aistb
Data Guard Role: Physical Standby
Con_ID: 5
Source: con_id 3 at db23ai
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: 0 seconds (computed 1 second ago)
Intended State: APPLY-ON
Apply State: Running
Apply Instance: db23aistb
Average Apply Rate: 286 KByte/s
Real Time Query: OFF
Pluggable Database Status:
SUCCESS
DGMGRL>
DGMGRL> show pluggable database db23aipdb1 at db23ai;
Pluggable database - DB23AIPDB1 at db23ai
Data Guard Role: Primary
Con_ID: 3
Active Target: con_id 5 at db23aistb
Pluggable Database Status:
SUCCESS
DGMGRL>
15:- Switchover PDB:
DGMGRL> validate pluggable database db23pdb1_dr at db23aistb;
Ready for Switchover: YES <<--------------
Data Guard Role: Physical Standby
Apply State: Running
Standby Redo Log Files: 4
Source: DB23AIPDB1 (con_id 3) at db23ai
DGMGRL> validate pluggable database db23aipdb1 at db23ai;
Ready for Switchover: YES <<--------------
Data Guard Role: Primary
Transport Status: Running
Active Target: DB23PDB1_DR (con_id 5) at db23aistb
DGMGRL>
DGMGRL> switchover to pluggable database db23pdb1_dr at db23aistb;
Performing switchover NOW, please wait...
Switchover succeeded, new primary is "db23pdb1_dr"
DGMGRL>
DGMGRL> show pluggable database db23pdb1_dr at db23aistb;
Pluggable database - DB23PDB1_DR at db23aistb
Data Guard Role: Primary
Con_ID: 5
Active Target: con_id 3 at db23ai
Pluggable Database Status:
SUCCESS
DGMGRL>
DGMGRL> show pluggable database db23pdb1_dr at db23aistb;
Pluggable database - DB23PDB1_DR at db23aistb
Data Guard Role: Primary
Con_ID: 5
Active Target: con_id 3 at db23ai
Pluggable Database Status:
SUCCESS
DGMGRL> show pluggable database db23aipdb1 at db23ai;
Pluggable database - DB23AIPDB1 at db23ai
Data Guard Role: Physical Standby
Con_ID: 3
Source: con_id 5 at db23aistb
Transport Lag: 3 minutes 58 seconds (computed 64 seconds ago)
Apply Lag: 3 minutes 58 seconds (computed 64 seconds ago)
Intended State: APPLY-ON
Apply State: Running
Apply Instance: db23ai
Average Apply Rate: 20 KByte/s
Real Time Query: OFF
Pluggable Database Status:
SUCCESS
DGMGRL>
*** Notice the "Transport lag"? this is because new stanby pdb does not have standby redo logs, so let's create them.
Before you ask... why where not created on step 12? Because PBD needs to be in Standby Role to be able to add standby redo logs.
16:- Create Standby Redo logs on New standby:
DGMGRL> EDIT PLUGGABLE DATABASE db23aipdb1 AT db23ai SET STATE='APPLY-OFF';
Succeeded.
INST HOST INST_NAME STATUS DB_ROLE OPEN_MODE STARTUP_TIME
---- ------------------ ---------- ---------- ----------------- --------------------- --------------------
*1 ol8_23ai db23ai OPEN PRIMARY READ WRITE 10-SEP-2024 22:48:56
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DB23AIPDB1 MOUNTED
4 DB23AIPDB2 READ WRITE NO
SQL>
SQL> alter session set container=db23aipdb1;
Session altered.
SQL> ALTER DATABASE ADD STANDBY LOGFILE thread 1 group 4 ('/u02/database/DB23AI/standy_redo_pdb_01') size 200M;
Database altered.
SQL> ALTER DATABASE ADD STANDBY LOGFILE thread 1 group 5 ('/u02/database/DB23AI/standy_redo_pdb_02') size 200M;
Database altered.
SQL> ALTER DATABASE ADD STANDBY LOGFILE thread 1 group 6 ('/u02/database/DB23AI/standy_redo_pdb_03') size 200M;
Database altered.
SQL> ALTER DATABASE ADD STANDBY LOGFILE thread 1 group 7 ('/u02/database/DB23AI/standy_redo_pdb_04') size 200M;
Database altered.
SQL>
DGMGRL> EDIT PLUGGABLE DATABASE db23aipdb1 AT db23ai SET STATE='APPLY-ON';
Succeeded.
DGMGRL>
SQL> alter system archive log current;
System altered.
SQL> alter system archive log current;
System altered.
SQL>
DGMGRL> show pluggable database db23aipdb1 at db23ai;
Pluggable database - DB23AIPDB1 at db23ai
Data Guard Role: Physical Standby
Con_ID: 3
Source: con_id 5 at db23aistb
Transport Lag: 0 seconds (computed 2 seconds ago)
Apply Lag: 0 seconds (computed 2 seconds ago)
Intended State: APPLY-ON
Apply State: Running
Apply Instance: db23ai
Average Apply Rate: 433 KByte/s
Real Time Query: OFF
Pluggable Database Status:
SUCCESS
DGMGRL>
17:- Switchback:
DGMGRL> validate pluggable database db23pdb1_dr at db23aistb;
Ready for Switchover: YES <<---------------
Data Guard Role: Primary
Transport Status: Running
Active Target: DB23AIPDB1 (con_id 3) at db23ai
DGMGRL> validate pluggable database db23aipdb1 at db23ai;
Ready for Switchover: YES <<---------------
Data Guard Role: Physical Standby
Apply State: Running
Standby Redo Log Files: 4
Source: DB23PDB1_DR (con_id 5) at db23aistb
DGMGRL>
DGMGRL> switchover to pluggable database db23aipdb1 at db23ai;
Performing switchover NOW, please wait...
Switchover succeeded, new primary is "db23aipdb1"
DGMGRL>
DGMGRL> show pluggable database db23aipdb1 at db23ai;
Pluggable database - DB23AIPDB1 at db23ai
Data Guard Role: Primary
Con_ID: 3
Active Target: con_id 5 at db23aistb
Pluggable Database Status:
SUCCESS
DGMGRL> show pluggable database db23pdb1_dr at db23aistb;
Pluggable database - DB23PDB1_DR at db23aistb
Data Guard Role: Physical Standby
Con_ID: 5
Source: con_id 3 at db23ai
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: 0 seconds (computed 1 second ago)
Intended State: APPLY-ON
Apply State: Running
Apply Instance: db23aistb
Average Apply Rate: 5 KByte/s
Real Time Query: OFF
Pluggable Database Status:
SUCCESS
DGMGRL>
18:- How to Monitor Standby PDB:?
1:- from DG Broker:
DGMGRL> show all pluggable database at db23ai
PDB Name PDB ID Data Guard Role Data Guard Partner
DB23AIPDB1 3 Primary DB23PDB1_DR (con_id 5) at db23aistb
DB23AIPDB2 4 None None
DGMGRL>
DGMGRL> show all pluggable database at db23aistb
PDB Name PDB ID Data Guard Role Data Guard Partner
DB23STBPDB1 3 None None
DB23STBPDB2 4 None None
DB23PDB1_DR 5 Physical Standby DB23AIPDB1 (con_id 3) at db23ai
DGMGRL>
DGMGRL> show pluggable database db23pdb1_dr at db23aistb;
Pluggable database - DB23PDB1_DR at db23aistb
Data Guard Role: Physical Standby
Con_ID: 5
Source: con_id 3 at db23ai
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: 0 seconds (computed 1 second ago)
Intended State: APPLY-ON
Apply State: Running
Apply Instance: db23aistb
Average Apply Rate: 5 KByte/s
Real Time Query: OFF
Pluggable Database Status:
SUCCESS
DGMGRL>
2:- From SQL
INST HOST INST_NAME STATUS DB_ROLE OPEN_MODE STARTUP_TIME
---- ------------------ ---------- ---------- ----------------- --------------------- --------------------
*1 ol8_23ai db23ai OPEN PRIMARY READ WRITE 10-SEP-2024 22:48:56
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DB23AIPDB1 READ WRITE NO <<--- primary
4 DB23AIPDB2 READ WRITE NO
INST HOST INST_NAME STATUS DB_ROLE OPEN_MODE STARTUP_TIME
---- ------------------ ---------- ---------- ----------------- --------------------- --------------------
*1 ol8_23ai db23aistb OPEN PRIMARY READ WRITE 10-SEP-2024 22:48:51
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DB23STBPDB1 READ WRITE NO
4 DB23STBPDB2 READ WRITE NO
5 DB23PDB1_DR MOUNTED <<--- standby pdb
SQL>
SQL> alter session set container=DB23PDB1_DR;
Session altered.
col name format a30
col value format a20
set linesize 120
SELECT NAME, VALUE, DATUM_TIME FROM V$DATAGUARD_STATS;
NAME VALUE DATUM_TIME
------------------------------ -------------------- ------------------------------
transport lag +00 00:00:00 09/11/2024 10:21:45
apply lag +00 00:00:00 09/11/2024 10:21:45
col CLIENT_PID format a20
col MRP_stat format a13
select inst_id, process, status MRP_stat, thread#, sequence#, block#
from gv$managed_standby
where process like 'MRP%' or process like 'RFS%' and status != 'IDLE'
order by inst_id,process,thread# ;
INST_ID PROCESS MRP_STAT THREAD# SEQUENCE# BLOCK#
---------- --------- ------------- ---------- ---------- ----------
1 MRP0 APPLYING_LOG 1 12 10463
SQL> /
INST_ID PROCESS MRP_STAT THREAD# SEQUENCE# BLOCK#
---------- --------- ------------- ---------- ---------- ----------
1 MRP0 APPLYING_LOG 1 12 10465
SQL>
That’s it! DG PDB tested on 23ai now….
Comments