Pythian Blog: Technical Track

Let DataGuard Broker Do ALL The Work

What's the reason for implementing DataGuard Broker? It does all the work. For example, our test system had been shutdown and upon startup, encountered an error as shown.

Startup Error:
[oracle@ol7-121-dg2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Tue Feb 11 16:15:41 2020

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

Connected to an idle instance.

SQL> startup;

ORACLE instance started.

Total System Global Area 1610612736 bytes

Fixed Size 2924928 bytes

Variable Size 520097408 bytes

Database Buffers 1073741824 bytes

Redo Buffers 13848576 bytes

Database mounted.

ORA-10458: standby database requires recovery

ORA-01196: file 1 is inconsistent due to a failed media recovery session

ORA-01110: data file 1: '/u01/oradata/CDB1_STBY/datafile/o1_mf_system_h1x6ofd1_.dbf'

SQL>

Shutdown Database and Startup Mount:

SQL> shutdown immediate;

ORA-01109: database not open

Database dismounted.

ORACLE instance shut down.

SQL> startup mount;

ORACLE instance started.

Total System Global Area 1610612736 bytes

Fixed Size 2924928 bytes

Variable Size 520097408 bytes

Database Buffers 1073741824 bytes

Redo Buffers 13848576 bytes

Database mounted.

SQL> exit

Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

Check DataGuard status using dgmgrl. Note: standby recovery was automatically started.

[oracle@ol7-121-dg2 ~]$ dgmgrl /


DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production

Copyright (c) 2000, 2013, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.

Connected as SYSDG.

DGMGRL> show configuration

Configuration - my_dg_config

Protection Mode: MaxPerformance

Members:

cdb1 - Primary database

cdb1_stby - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status: SUCCESS (status updated 34 seconds ago)

DGMGRL> show database cdb1_stby

Database - cdb1_stby

Role: PHYSICAL STANDBY

Intended State: APPLY-ON

Transport Lag: 0 seconds (computed 0 seconds ago)

Apply Lag: (unknown)

Average Apply Rate: (unknown)

Real Time Query: OFF

Instance(s): cdb1

Database Status: SUCCESS

DGMGRL> exit

Enable Active DataGuard:

[oracle@ol7-121-dg2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Tue Feb 11 16:21:41 2020
Copyright (c) 1982, 2014, Oracle. All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> alter database open read only;
Database altered.
SQL> exit

Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

Check DataGuard Status Using dgmgrl Again:

[oracle@ol7-121-dg2 ~]$ dgmgrl /
DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production
Copyright (c) 2000, 2013, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected as SYSDG.
DGMGRL> show database cdb1_stby
Database - cdb1_stby
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Average Apply Rate: 301.00 KByte/s
Real Time Query: ON
Instance(s): cdb1
Database Status: SUCCESS

DGMGRL> exit
[oracle@ol7-121-dg2 ~]$

In conclusion, when implementing DataGuard, it might be advantageous to consider and implement DataGuard Broker.

No Comments Yet

Let us know what you think

Subscribe by email