After configuring Data Guard for p_deeds_pd1, use the following SQL*Plus queries to verify the PDB role, open mode, redo apply, and synchronization status.
1 Verify the Current Container and PDB
Run on both source and target CDBs:
SHOW CON_NAME;SELECT name, open_mode, database_roleFROM v$database;SELECT con_id, name, open_mode, recovery_statusFROM v$pdbsWHERE UPPER(name) = 'P_DEEDS_PD1';
2 Verify PDB-Level Data Guard Role Using DGMGRL
Use Data Guard Broker for the authoritative PDB-level role and apply-state view:
DGMGRL> SHOW PLUGGABLE DATABASE p_deeds_pd1 AT aicdb;DGMGRL> SHOW PLUGGABLE DATABASE p_deeds_pd1 AT aicdrdb;
Run on the target CDB:
SET LINESIZE 200SET PAGESIZE 100COLUMN name FORMAT A20COLUMN open_mode FORMAT A20COLUMN recovery_status FORMAT A20SELECT con_id, name, open_mode, recovery_statusFROM v$pdbsWHERE UPPER(name) = 'P_DEEDS_PD1';
This confirms the target PDB’s current open and recovery status. Use the broker output to confirm the PDB’s Data Guard role.
3 Check Redo Apply Processes
Run on the target CDB:
COLUMN process FORMAT A12COLUMN status FORMAT A20COLUMN client_process FORMAT A15SELECT process, status, client_process, thread#, sequence#FROM v$managed_standbyORDER BY process;
On releases where V$MANAGED_STANDBY is deprecated, use the supported replacement views, such as V$DATAGUARD_PROCESS, for process-level monitoring.
4 Check Data Guard Lag
Run on the target CDB:
COLUMN name FORMAT A30COLUMN value FORMAT A30COLUMN unit FORMAT A25COLUMN time_computed FORMAT A30COLUMN datum_time FORMAT A30SELECT name, value, unit, time_computed, datum_timeFROM v$dataguard_statsWHERE name IN ('transport lag', 'apply lag', 'apply finish time');
Interpretation:
- Transport lag: Delay between redo generation and receipt.
- Apply lag: Delay between redo receipt and recovery application.
- Apply finish time: Estimated time to apply outstanding redo, when available.
A zero lag is desirable but not guaranteed during active workloads. Check DATUM_TIME and TIME_COMPUTED to ensure the measurements are current.
5 Verify PDB Data Files
Run on the target CDB:
COLUMN name FORMAT A20COLUMN file_name FORMAT A100SELECT p.name, df.file#, df.status, df.recover, df.name AS file_nameFROM v$datafile dfJOIN v$pdbs p ON p.con_id = df.con_idWHERE UPPER(p.name) = 'P_DEEDS_PD1'ORDER BY df.file#;
This verifies that data files belonging to the protected PDB are visible in the target CDB. File visibility alone does not prove that redo apply is healthy.
6 Final Health Check
Run the following on the target CDB to check the PDB and recent Data Guard errors:
SET LINESIZE 220SET PAGESIZE 100SELECT name, open_mode, recovery_statusFROM v$pdbsWHERE UPPER(name) = 'P_DEEDS_PD1';SELECT timestamp, severity, error_code, messageFROM v$dataguard_statusWHERE timestamp > SYSDATE - 1ORDER BY timestamp DESC;
Important: Execute the SQL queries in the appropriate CDB context. V$DATAGUARD_STATS and redo process views report database-level recovery information; use DGMGRL SHOW PLUGGABLE DATABASE to verify the individual PDB’s Data Guard role and status.
Leave a Reply