Warning: session_start(): open(/tmp/sess_rp9lfgm6is5tcilk0o7t0qlvm3, O_RDWR) failed: No space left on device (28) in /razi/eraazi/darbari/mercy/index.php on line 15
EraAzi | Useful DGMGRL commands in oracle dataguard Useful DGMGRL commands in oracle dataguard
 

This articles contains useful dgmgrl commands to manage the dataguard environments.

1. Setup DG broker in the standby setup.(Run on both primary and standby)

- For standalone db  :

ALTER SYSTEM SET dg_broker_config_file1 = '\U01\oradata\dr1node.dat' scope=both sid='*';
ALTER SYSTEM SET dg_broker_config_file2 = '\U01\oradata\dr2node.dat' scope=both sid='*';

-- For oracle RAC/ASM file system;

ALTER SYSTEM SET dg_broker_config_file1 = '+DATA/broker/dr1node.dat' scope=both sid='*';
ALTER SYSTEM SET dg_broker_config_file2 = '+DATA/broker/dr2node.dat' scope=both sid='*';


ALTER SYSTEM SET DG_BROKER_START=TRUE scope=both sid='*'; 

2. Create configuration in dgbroker:

-- on primary
$dgmgl

DGMGRL> CONNECT sys/;
Connected.

-- create configuration with primary db_unique_name and its service name .

DGMGRL> CREATE CONFIGURATION 'PROD_DG' AS PRIMARY DATABASE IS 'PRIMDB' CONNECT IDENTIFIER IS PRIMDB;

Configuration "PRIMDB" created with primary database "PRIMDB"

--- Add standby in the configuration:

DGMGRL> ADD DATABASE 'STYDB' AS CONNECT IDENTIFIER IS STYDB MAINTAINED AS PHYSICAL;

Database "STYDB" added

3. Enable the configuration

DGMGRL> ENABLE CONFIGURATION;
Enabled.

At this stage our dg broker setup is completed.

4. View configuration of dgbroker:

DGMGRL> show configuration
 
DGMGRL> show configuration verbose 

5. view database informations:

-- Here PRIMDB and STYDB are db_unique_name of primary and standby db 


DGMGRL> show database 'PRIMDB'
DGMGRL > show database 'STYDB'
DGMGRL> show database verbose 'PRIMDB'


6. View statusreport of databases

-- Here PRIMDB and STYDB are db_unique_name of primary and standby db 

show database PRIMDB statusreport

7. View database inconsistent properties

-- Here PRIMDB and STYDB are db_unique_name of primary and standby db 

show database PRIMDB InconsistentProperties
show database PRIMDB InconsistentLogXptProps

show database STYDB InconsistentProperties
show database STYDB InconsistentLogXptProps

8. Check whether all logfiles are archived or not( on primary)

show database PRIMDB sendQentries


PRIMARY_SEND_QUEUE
        STANDBY_NAME       STATUS     RESETLOGS_ID           THREAD              LOG_SEQ       TIME_GENERATED       TIME_COMPLETED    FIRST_CHANGE#     NEXT_CHANGE#       SIZE (KBs)
                          CURRENT       1022762318                1                  294  10/30/2019 11:09:26                        12298130044308                            274219

9. Check information of received log sequence(not applied) ( Run for standby)

DGMGRL>show database STYDB recvqentries

STANDBY_RECEIVE_QUEUE
              STATUS     RESETLOGS_ID           THREAD              LOG_SEQ       TIME_GENERATED       TIME_COMPLETED    FIRST_CHANGE#     NEXT_CHANGE#       SIZE (KBs)
         NOT_APPLIED       1022762318                1                  293  10/30/2019 10:03:06  10/30/2019 11:09:26   12298109948824   12298130044308          3487164

10. Check database wait events:

DGMGRL>show database PRIMDB topwaitevents

11.Validate database information:

dgmgrl> validate database verbose 'PRIMDB'

dgmgrl> validate database 'PRIMDB'

dgmgrl> validate database 'STYDB'


12. Enable tracing for troubleshooting:

-- For standalone:

DGMGRL> edit configuration set property tracelevel=support;
DGMGRL> edit database PRIMDB set property LogArchiveTrace=8191;
DGMGRL> edit database STYDB set property LogArchiveTrace=8191;


-- For RAC:

DGMGRL> EDIT INSTANCE * ON DATABASE 'PRIMDB' SET PROPERTY LogArchiveTrace=8191;


13. Disable tracing:

DGMGRL> edit configuration reset property tracelevel ;
DGMGRL> edit database PRIMDB reset property logarchivetrace;
DGMGRL> edit database STYDB reset property logarchivetrace;


14. Switchover using dgmgrl:

DGMGRL> connect sys/oracle
Password:
Connected as sys.



DGMGRL> switchover to STYDB
Performing switchover NOW, please wait...
Operation requires a connection to instance "STYDB1" on database "STYDB"
Connecting to instance "STYDB1"...
Connected as SYSDBA.
New primary database "STYDB" is opening...
Oracle Clusterware is restarting database "PRIMDB" ...
Switchover succeeded, new primary is "STYDB"


15. Convert physical standby to snapshot standby

DGMGRL> convert database 'STYDB' to snapshot standby;

16. Convert snapshot to physical standby db

DGMGRL> CONVERT DATABASE 'STYDB' to PHYSICAL STANDBY;
dataguarddgmgrl DATAGUARD


Related Topics

How to disable enable log shipping in standby using dgmgrl
Standby redologs in oracle dataguard
How to setup dataguard broker configuration (DG broker) in 12c
How to recreate physical standby controlfile
Flashback primary database in dataguard environment
How to use expdp to export data from physical standby database
How to add a tempfile in primary database in dataguard
Useful DGMGRL commands in oracle dataguard
How to enable active dataguard in physical standby database

You May Also Like

Display sql_id of the sql, using set feedback in oracle 18C - New feature
Query clause in oracle datapump expdp
How to generate ADDM report
How to move controlfile to a new location in oracle
How to use oratop tool for oracle database monitoring
sec_case_sensitive_logon parameter in oracle
ORA-20101: TABLESPACE is not a ASSM (Automatic Segment Space Management) tablespace
Schema replication using oracle goldengate
Shell script for monitoring blocking sessions
SKIP_CONSTRAINT_ERRORS as DATA_OPTION in impdp

From This Website

How to generate AWR report in RAC
How to install trace file analyzer( TFACTL)
Tablespace monitoring shell script
Steps To Set Up Master Slave Replication in MySQL
Perform Flashback in pluggable database(PDB) in oracle 12.2
Add database as target oracle 12c cloud control
ERROR: permission denied for schema in postgres
How to get tablespace quota details of an user in oracle
How to create user in MySQL Database
How to change sysman password for oracle 12c cloud control