Data Guard Broker

 Data Guard properties more details:



$ dgmgrl [-silent | -echo] [username/password[@connect_identifier] [dgmgrl_command]]
$ dgmgrl  /
$ dgmgrl sys/pwd
$ dgmgrl sys/pwd@oltp
$ dgmgrl sys/test@dgprimary "show database 'prod'"

$ dgmgrl -logfile observer.log / "stop observer"
$ dgmgrl -silent sys/test@dgprimary "show configuration verbose"
$ dgmgrl  / "show configuration verbose"

=============
ADD - Adds a standby database to the broker configuration.
DGMGRL> ADD DATABASE db_name [AS CONNECT IDENTIFIER IS conn_identifier] [MAINTAINED AS {PHYSICAL|LOGICAL}];
DGMGRL> ADD DATABASE 'testdb' AS CONNECT IDENTIFIER IS testdb MAINTAINED AS PHYSICAL;
DGMGRL> ADD DATABASE 'logdb' AS CONNECT IDENTIFIER IS logdb MAINTAINED AS LOGICAL;
DGMGRL> ADD DATABASE 'devdb' AS CONNECT IDENTIFIER IS devdb.foo.com;

=============
CONNECT - Connects to an Oracle database instance.
DGMGRL> CONNECT username/password[@connect_identifier]
DGMGRL> CONNECT /
DGMGRL> CONNECT sys;
DGMGRL> CONNECT sys@test;
DGMGRL> CONNECT sys/pwd;
DGMGRL> CONNECT sys/pwd@dwh;
DGMGRL> CONNECT /@dwh;
$dgmgrl connect sys

=============
CONVERT - Converts a database from one type to another (from Oracle 11g).
DGMGRL> CONVERT DATABASE database_name TO {SNAPSHOT STANDBY|PHYSICAL STANDBY};
DGMGRL> CONVERT DATABASE 'devdb' to SNAPSHOT STANDBY;
DGMGRL> CONVERT DATABASE 'devdb' to PHYSICAL STANDBY;

=============
CREATE - Creates a broker configuration.
DGMGRL> CREATE CONFIGURATION config_name AS PRIMARY DATABASE IS db_name CONNECT IDENTIFIER IS conn_ident;
DGMGRL> CREATE CONFIGURATION 'dg' AS PRIMARY DATABASE IS 'prod' CONNECT IDENTIFIER IS prod.foo.com;
DGMGRL> CREATE CONFIGURATION 'dg_test' AS PRIMARY DATABASE IS 'test' CONNECT IDENTIFIER IS test;

=============
DISABLE - Disables a configuration, a database, or fast-start failover (FSFO).
DGMGRL> DISABLE CONFIGURATION;
DGMGRL> DISABLE CONFIGURATION;



DGMGRL> DISABLE DATABASE database_name;
DGMGRL> DISABLE DATABASE 'devdb';



DGMGRL> DISABLE FAST_START FAILOVER [FORCE | CONDITION condition];
DGMGRL> DISABLE FAST_START FAILOVER;
DGMGRL> DISABLE FAST_START FAILOVER FORCE;
DGMGRL> DISABLE FAST_START FAILOVER CONDITION '1578';

=============
EDIT - Edits a configuration, database, or instance.
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS {MaxProtection|MaxAvailability|MaxPerformance};
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXPROTECTION;
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXPERFORMANCE;


DGMGRL> EDIT CONFIGURATION SET PROPERTY property_name = value;
DGMGRL> EDIT CONFIGURATION SET PROPERTY FastStartFailoverThreshold = 45;
DGMGRL> EDIT CONFIGURATION SET PROPERTY FastStartFailoverAutoReinstate = FALSE;
DGMGRL> EDIT CONFIGURATION SET PROPERTY FastStartFailoverAutoReinstate = TRUE;
DGMGRL> EDIT CONFIGURATION SET PROPERTY BYSTANDERSFOLLOWROLECHANGE= 'NONE';


DGMGRL> EDIT DATABASE database_name SET PROPERTY property_name = value;
DGMGRL> EDIT DATABASE devdb SET PROPERTY 'LogArchiveFormat'='log_%t_%s_%r_%d.arc';
DGMGRL> EDIT DATABASE prodb SET PROPERTY LogXptMode=SYNC;
DGMGRL> EDIT DATABASE prodb SET PROPERTY LogXptMode=ASYNC;
DGMGRL> EDIT DATABASE prodb SET PROPERTY LogXptMode=ARCH;
DGMGRL> EDIT DATABASE devdb SET PROPERTY LogShipping=OFF;
DGMGRL> EDIT DATABASE devdb SET PROPERTY LogShipping=ON;
DGMGRL> EDIT DATABASE prodb SET PROPERTY LogArchiveTrace=8;
DGMGRL> EDIT DATABASE prodb SET PROPERTY NetTimeout=60;
DGMGRL> EDIT DATABASE devdb SET PROPERTY 'ReopenSecs'=300;
DGMGRL> EDIT DATABASE prodb SET PROPERTY ArchiveLagTarget=1200;
DGMGRL> EDIT DATABASE prodb SET PROPERTY FastStartFailoverTarget='standby_name';
DGMGRL> EDIT DATABASE devdb SET PROPERTY 'StandbyArchiveLocation'='/oradata/archive/';
DGMGRL> EDIT DATABASE devdb SET PROPERTY 'DbFileNameConvert' = '/u01/od01/datafile/, /oradisk/od01/datafile/';
DGMGRL> EDIT DATABASE testdb SET PROPERTY DelayMins='720';
DGMGRL> EDIT DATABASE prodb SET PROPERTY RedoCompression ='ENABLE'
DGMGRL> EDIT DATABASE prodb SET PROPERTY RedoCompression ='DISABLE'
DGMGRL> EDIT DATABASE testdb SET PROPERTY LogArchiveMinSucceedDest =1


DGMGRL> EDIT DATABASE database_name RENAME TO new database_name;
DGMGRL> EDIT DATABASE 'devdbb' RENAME TO 'devdb';


DGMGRL> EDIT DATABASE database_name SET STATE = state [WITH APPLY INSTANCE = instance_name];
DGMGRL> EDIT DATABASE devdb SET STATE='READ-ONLY';
DGMGRL> EDIT DATABASE devdb SET STATE='OFFLINE';
DGMGRL> EDIT DATABASE devdb SET STATE='APPLY-OFF';
DGMGRL> EDIT DATABASE devdb SET STATE='APPLY-ON';
DGMGRL> EDIT DATABASE devdb SET STATE='TRANSPORT-OFF';
DGMGRL> EDIT DATABASE devdb SET STATE='TRANSPORT-ON';
DGMGRL> EDIT DATABASE prodb SET STATE='LOG-TRANSPORT-OFF';
DGMGRL> EDIT DATABASE devdb SET STATE='ONLINE' WITH APPLY INSTANCE=devdb2;


DGMGRL> EDIT INSTANCE instance_name [ON DATABASE database_name] SET AUTO PFILE [={init_file_path|OFF}];
DGMGRL> EDIT INSTANCE 'devdb1' ON DATABASE 'devdb' SET AUTO PFILE='initdevdb1.ora';

DGMGRL> EDIT INSTANCE instance_name [ON DATABASE database_name] SET PROPERTY property_name = value;
DGMGRL> EDIT INSTANCE * ON DATABASE database_name SET PROPERTY property_name = value;
DGMGRL> EDIT INSTANCE 'proddb' ON DATABASE 'proddb' SET PROPERTY 'StandbyArchiveLocation'='/oradata/arch/';

=============
ENABLE - Enables a configuration, a database, or fast-start failover (FSFO).
DGMGRL> ENABLE CONFIGURATION;
DGMGRL> ENABLE CONFIGURATION;



DGMGRL> ENABLE DATABASE database_name;
DGMGRL> ENABLE DATABASE 'devdb';



DGMGRL> ENABLE FAST_START FAILOVER [CONDITION condition];
DGMGRL> ENABLE FAST_START FAILOVER;
DGMGRL> ENABLE FAST_START FAILOVER CONDITION '1578';
DGMGRL> ENABLE FAST_START FAILOVER CONDITION "Stuck Archiver";
DGMGRL> ENABLE FAST_START FAILOVER CONDITION 'Corrupted Controlfile';
DGMGRL> ENABLE FAST_START FAILOVER CONDITION 'Corrupted Dictionary';
DGMGRL> ENABLE FAST_START FAILOVER CONDITION 'Inaccessible Logfile';

=============
EXIT - Exits the program.
DGMGRL> EXIT;

=============
FAILOVER - Changes a standby database to be the primary database.
DGMGRL> FAILOVER TO standby_database_name [IMMEDIATE]
DGMGRL> FAILOVER TO "testdb";
DGMGRL> FAILOVER TO "snapdb" IMMEDIATE;

=============
HELP - Displays description and syntax for a command.
DGMGRL> HELP [command];
DGMGRL> HELP REINSTATE
DGMGRL> HELP EDIT

=============
QUIT - Exits the program.
DGMGRL> QUIT;

=============
REINSTATE - Changes a database marked for reinstatement into a viable standby.
DGMGRL> REINSTATE DATABASE database_name;
DGMGRL> REINSTATE DATABASE prim1;

=============
REM - Comment to be ignored by DGMGRL.
DGMGRL> REM [comment];

=============
REMOVE - Removes a configuration, Oracle database, or instance.
DGMGRL> REMOVE CONFIGURATION [PRESERVE DESTINATIONS];
DGMGRL> REMOVE CONFIGURATION;
DGMGRL> REMOVE CONFIGURATION PRESERVE DESTINATIONS;


DGMGRL> REMOVE DATABASE database_name [PRESERVE DESTINATIONS];
DGMGRL> REMOVE DATABASE devdb;
DGMGRL> REMOVE DATABASE standby PRESERVE DESTINATIONS;



DGMGRL> REMOVE INSTANCE instance_name [ON DATABASE database_name];
DGMGRL> REMOVE INSTANCE inst1 ON DATABASE racdb;

=============
SHOW - Displays information about a configuration, database, instance or FSFO.
DGMGRL> SHOW CONFIGURATION [VERBOSE];
DGMGRL> SHOW CONFIGURATION;
DGMGRL> SHOW CONFIGURATION VERBOSE;


DGMGRL> SHOW DATABASE [VERBOSE] db_name [property_name];
DGMGRL> SHOW DATABASE 'devdb';
DGMGRL> SHOW DATABASE VERBOSE 'test';
DGMGRL> SHOW DATABASE 'dwhdb' 'StatusReport';
DGMGRL> SHOW DATABASE 'proddb' 'LogXptStatus';
DGMGRL> SHOW DATABASE 'proddb' 'InconsistentProperties';
DGMGRL> SHOW DATABASE 'proddb' 'InconsistentLogXptProps';
DGMGRL> SHOW DATABASE 'testdb' 'ArchiveLagTarget';
DGMGRL> SHOW DATABASE 'testdb' 'LogShipping';
DGMGRL> SHOW DATABASE 'testdb' 'PreferredApplyInstance';
DGMGRL> SHOW DATABASE 'proddb' 'StatusReport';
DGMGRL> SHOW DATABASE 'testdb' 'RecvQEntries';
DGMGRL> SHOW DATABASE 'proddb' 'SendQEntries';


DGMGRL> SHOW INSTANCE [VERBOSE] instance_name [property_name] [ON DATABASE db_name];
DGMGRL> SHOW INSTANCE inst1;
DGMGRL> SHOW INSTANCE VERBOSE inst3;
DGMGRL> SHOW INSTANCE testdb 'TopWaitEvents';


DGMGRL> SHOW FAST_START FAILOVER;
DGMGRL> SHOW FAST_START FAILOVER;

From 18c Oracle Database, SHOW ALL command shows the values of DGMGRL command line utility properties.
DGMGRL> SHOW ALL;
   debug ON
   echo OFF
   time OFF
   observerconfigfile = observer.ora

=============
SHUTDOWN - Shuts down a currently running Oracle instance.
DGMGRL> SHUTDOWN [NORMAL
 | IMMEDIATE | ABORT];
DGMGRL> SHUTDOWN;
DGMGRL> SHUTDOWN NORMAL;
DGMGRL> SHUT IMMEDIATE;
DGMGRL> SHUT ABORT;

=============
SQL - Executes a SQL statement
DGMGRL> SQL "sql_statement";


=============
START - Starts the fast-start failover(FSFO) observer.
DGMGRL> START OBSERVER [FILE=observer_configuration_file];
DGMGRL> START OBSERVER;

=============
STARTUP - Starts an Oracle database instance.
DGMGRL> STARTUP [RESTRICT] [FORCE] [PFILE=filespec]
[NOMOUNT  |  MOUNT | OPEN
 [READ ONLY|READ WRITE]];
DGMGRL> STARTUP;
DGMGRL> STARTUP NOMOUNT;
DGMGRL> STARTUP MOUNT;
DGMGRL> STARTUP OPEN;

DGMGRL> STARTUP FORCE;
DGMGRL> STARTUP FORCE RESTRICT NOMOUNT;
DGMGRL> STARTUP PFILE=initdwh.ora NOMOUNT;

=============
STOP - Stops the fast-start failover(FSFO) observer.
DGMGRL> STOP OBSERVER;

=============
SWITCHOVER - Switches roles between a primary and standby database.
DGMGRL> SWITCHOVER TO standby_database_name;
DGMGRL> SWITCHOVER TO "standby";

=============
VALIDATE - command to checks whether the database is ready for a role transition or not.

DGMGRL> VALIDATE DATABASE 'DB_NAME';    -- From Oracle Database 12c


From Oracle Database 18c,
DGMGRL> VALIDATE DATABASE standby-database-name SPFILE;

DGMGRL> VALIDATE NETWORK CONFIGURATION FOR { ALL | member name };
DGMGRL> VALIDATE NETWORK CONFIGURATION FOR stdby;

DGMGRL> VALIDATE STATIC CONNECT IDENTIFIER FOR { ALL | database name };
DGMGRL> VALIDATE STATIC CONNECT IDENTIFIER FOR stdby;



$BDUMP/drc*.log
$ORACLE_HOME/rdbms/log/drc*.log

alter system set dg_broker_start=false;
alter system set dg_broker_start=false sid='*';
alter system set dg_broker_start=FALSE SCOPE=spfile SID='*';
alter system set dg_broker_start=true;
alter system set dg_broker_start=true sid='*';
alter system set dg_broker_start=TRUE SCOPE=spfile SID='*';

alter system set dg_broker_config_file1='/u01/dg_broker_config_files/dr1TESTP.dat' sid='*';
alter system set dg_broker_config_file2='/u01/dg_broker_config_files/dr2TESTP.dat' sid='*';

dgmgrl at a glance

$ dgmgrl  /
$ dgmgrl sys/pwd
$ dgmgrl sys/pwd@oltp
$ dgmgrl sys/test@dgprimary “show database ‘prod'”
$ dgmgrl -logfile observer.log / “stop observer”
$ dgmgrl -silent sys/test@dgprimary “show configuration verbose”
$ dgmgrl  / “show configuration verbose”

ADD – Adds a standby database to the broker configuration.DGMGRL> ADD DATABASE db_name [AS CONNECT IDENTIFIER IS conn_identifier] [MAINTAINED AS {PHYSICAL|LOGICAL}];DGMGRL> ADD DATABASE ‘testdb’ AS CONNECT IDENTIFIER IS testdb MAINTAINED AS PHYSICAL;
DGMGRL> ADD DATABASE ‘logdb’ AS CONNECT IDENTIFIER IS logdb MAINTAINED AS LOGICAL;DGMGRL> ADD DATABASE ‘devdb’ AS CONNECT IDENTIFIER IS devdb.foo.com;

CONNECT – Connects to an Oracle database instance.DGMGRL> CONNECT username/password[@connect_identifier]DGMGRL> CONNECT /
DGMGRL> CONNECT sys;DGMGRL> CONNECT sys@test;DGMGRL> CONNECT sys/pwd;DGMGRL> CONNECT sys/pwd@dwh;
DGMGRL> CONNECT /@dwh;
$dgmgrl connect sys

CONVERT – Converts a database from one type to another (from Oracle 11g).DGMGRL> CONVERT DATABASE database_name TO {SNAPSHOT STANDBY|PHYSICAL STANDBY};DGMGRL> CONVERT DATABASE ‘devdb’ to SNAPSHOT STANDBY;DGMGRL> CONVERT DATABASE ‘devdb’ to PHYSICAL STANDBY;

CREATE – Creates a broker configuration.
DGMGRL> CREATE CONFIGURATION config_name AS PRIMARY DATABASE IS db_name CONNECT IDENTIFIER IS conn_ident;DGMGRL> CREATE CONFIGURATION ‘dg’ AS PRIMARY DATABASE IS ‘prod’ CONNECT IDENTIFIER IS prod.foo.com;DGMGRL> CREATE CONFIGURATION ‘dg_test’ AS PRIMARY DATABASE IS ‘test’ CONNECT IDENTIFIER IS test;

DISABLE – Disables a configuration, a database, or fast-start failover (FSFO).DGMGRL> DISABLE CONFIGURATION;DGMGRL> DISABLE CONFIGURATION;

DGMGRL> DISABLE DATABASE database_name;DGMGRL> DISABLE DATABASE ‘devdb’;

DGMGRL> DISABLE FAST_START FAILOVER [FORCE | CONDITION condition];DGMGRL> DISABLE FAST_START FAILOVER;DGMGRL> DISABLE FAST_START FAILOVER FORCE;
DGMGRL> DISABLE FAST_START FAILOVER CONDITION ‘1578’;

EDIT – Edits a configuration, database, or instance.DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS {MaxProtection|MaxAvailability|MaxPerformance};DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXPROTECTION;DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXPERFORMANCE;

DGMGRL> EDIT CONFIGURATION SET PROPERTY property_name = value;DGMGRL> EDIT CONFIGURATION SET PROPERTY FastStartFailoverThreshold = 45;
DGMGRL> EDIT CONFIGURATION SET PROPERTY FastStartFailoverAutoReinstate = FALSE;
DGMGRL> EDIT CONFIGURATION SET PROPERTY FastStartFailoverAutoReinstate = TRUE;
DGMGRL> EDIT CONFIGURATION SET PROPERTY BYSTANDERSFOLLOWROLECHANGE= ‘NONE’;
DGMGRL> EDIT DATABASE database_name SET PROPERTY property_name = value;
DGMGRL> EDIT DATABASE devdb SET PROPERTY ‘LogArchiveFormat’=’log_%t_%s_%r_%d.arc’;
DGMGRL> EDIT DATABASE prodb SET PROPERTY LogXptMode=SYNC;DGMGRL> EDIT DATABASE prodb SET PROPERTY LogXptMode=ASYNC;
DGMGRL> EDIT DATABASE prodb SET PROPERTY LogXptMode=ARCH;
DGMGRL> EDIT DATABASE devdb SET PROPERTY LogShipping=OFF;
DGMGRL> EDIT DATABASE devdb SET PROPERTY LogShipping=ON;
DGMGRL> EDIT DATABASE prodb SET PROPERTY LogArchiveTrace=8;
DGMGRL> EDIT DATABASE prodb SET PROPERTY NetTimeout=60;
DGMGRL> EDIT DATABASE devdb SET PROPERTY ‘ReopenSecs’=300;
DGMGRL> EDIT DATABASE prodb SET PROPERTY ArchiveLagTarget=1200;
DGMGRL> EDIT DATABASE prodb SET PROPERTY FastStartFailoverTarget=’standby_name’;
DGMGRL> EDIT DATABASE devdb SET PROPERTY ‘StandbyArchiveLocation’=’/oradata/archive/’;
DGMGRL> EDIT DATABASE devdb SET PROPERTY ‘DbFileNameConvert’ = ‘/u01/od01/datafile/, /oradisk/od01/datafile/’;DGMGRL> EDIT DATABASE testdb SET PROPERTY DelayMins=’720′;
DGMGRL> EDIT DATABASE prodb SET PROPERTY RedoCompression =’ENABLE’
DGMGRL> EDIT DATABASE prodb SET PROPERTY RedoCompression =’DISABLE’
DGMGRL> EDIT DATABASE testdb SET PROPERTY LogArchiveMinSucceedDest =1

DGMGRL> EDIT DATABASE database_name RENAME TO new database_name;
DGMGRL> EDIT DATABASE ‘devdbb’ RENAME TO ‘devdb’;

DGMGRL> EDIT DATABASE database_name SET STATE = state [WITH APPLY INSTANCE = instance_name];DGMGRL> EDIT DATABASE devdb SET STATE=’READ-ONLY’;DGMGRL> EDIT DATABASE devdb SET STATE=’OFFLINE’;DGMGRL> EDIT DATABASE devdb SET STATE=’APPLY-OFF’;
DGMGRL> EDIT DATABASE devdb SET STATE=’APPLY-ON’;DGMGRL> EDIT DATABASE devdb SET STATE=’TRANSPORT-OFF’;DGMGRL> EDIT DATABASE devdb SET STATE=’TRANSPORT-ON’;DGMGRL> EDIT DATABASE prodb SET STATE=’LOG-TRANSPORT-OFF’;
DGMGRL> EDIT DATABASE devdb SET STATE=’ONLINE’ WITH APPLY INSTANCE=devdb2;

DGMGRL> EDIT INSTANCE instance_name [ON DATABASE database_name] SET AUTO PFILE [={init_file_path|OFF}];DGMGRL> EDIT INSTANCE ‘devdb1’ ON DATABASE ‘devdb’ SET AUTO PFILE=’initdevdb1.ora’;

DGMGRL> EDIT INSTANCE instance_name [ON DATABASE database_name] SET PROPERTY property_name = value;DGMGRL> EDIT INSTANCE * ON DATABASE database_name SET PROPERTY property_name = value;DGMGRL> EDIT INSTANCE ‘proddb’ ON DATABASE ‘proddb’ SET PROPERTY ‘StandbyArchiveLocation’=’/oradata/arch/’;

ENABLE – Enables a configuration, a database, or fast-start failover (FSFO).
DGMGRL> ENABLE CONFIGURATION;DGMGRL> ENABLE CONFIGURATION;

DGMGRL> ENABLE DATABASE database_name;DGMGRL> ENABLE DATABASE ‘devdb’;

DGMGRL> ENABLE FAST_START FAILOVER [CONDITION condition];DGMGRL> ENABLE FAST_START FAILOVER;DGMGRL> ENABLE FAST_START FAILOVER CONDITION ‘1578’;
DGMGRL> ENABLE FAST_START FAILOVER CONDITION “Stuck Archiver”;
DGMGRL> ENABLE FAST_START FAILOVER CONDITION ‘Corrupted Controlfile’;
DGMGRL> ENABLE FAST_START FAILOVER CONDITION ‘Corrupted Dictionary’;
DGMGRL> ENABLE FAST_START FAILOVER CONDITION ‘Inaccessible Logfile’;

EXIT – Exits the program.DGMGRL> EXIT;

FAILOVER – Changes a standby database to be the primary database.DGMGRL> FAILOVER TO standby_database_name [IMMEDIATE]DGMGRL> FAILOVER TO “testdb”;
DGMGRL> FAILOVER TO “snapdb” IMMEDIATE;

HELP – Displays description and syntax for a command.DGMGRL> HELP [command];DGMGRL> HELP REINSTATE
DGMGRL> HELP EDIT

QUIT – Exits the program.DGMGRL> QUIT;

REINSTATE – Changes a database marked for reinstatement into a viable standby.DGMGRL> REINSTATE DATABASE database_name;DGMGRL> REINSTATE DATABASE prim1;

REM – Comment to be ignored by DGMGRL.DGMGRL> REM [comment];

REMOVE – Removes a configuration, Oracle database, or instance.DGMGRL> REMOVE CONFIGURATION [PRESERVE DESTINATIONS];DGMGRL> REMOVE CONFIGURATION;
DGMGRL> REMOVE CONFIGURATION PRESERVE DESTINATIONS;

DGMGRL> REMOVE DATABASE database_name [PRESERVE DESTINATIONS];DGMGRL> REMOVE DATABASE devdb;
DGMGRL> REMOVE DATABASE standby PRESERVE DESTINATIONS;

DGMGRL> REMOVE INSTANCE instance_name [ON DATABASE database_name];DGMGRL> REMOVE INSTANCE inst1 ON DATABASE racdb;

SHOW – Displays information about a configuration, database, instance or FSFO.DGMGRL> SHOW CONFIGURATION [VERBOSE];
DGMGRL> SHOW CONFIGURATION;DGMGRL> SHOW CONFIGURATION VERBOSE;

DGMGRL> SHOW DATABASE [VERBOSE] db_name [property_name];
DGMGRL> SHOW DATABASE ‘devdb’;DGMGRL> SHOW DATABASE VERBOSE ‘test’;
DGMGRL> SHOW DATABASE ‘dwhdb’ ‘StatusReport’;DGMGRL> SHOW DATABASE ‘proddb’ ‘LogXptStatus’;DGMGRL> SHOW DATABASE ‘proddb’ ‘InconsistentProperties’;
DGMGRL> SHOW DATABASE ‘proddb’ ‘InconsistentLogXptProps’;
DGMGRL> SHOW DATABASE ‘testdb’ ‘ArchiveLagTarget’;
DGMGRL> SHOW DATABASE ‘testdb’ ‘LogShipping’;
DGMGRL> SHOW DATABASE ‘testdb’ ‘PreferredApplyInstance’;
DGMGRL> SHOW DATABASE ‘proddb’ ‘StatusReport’;
DGMGRL> SHOW DATABASE ‘testdb’ ‘RecvQEntries’;
DGMGRL> SHOW DATABASE ‘proddb’ ‘SendQEntries’;

DGMGRL> SHOW INSTANCE [VERBOSE] instance_name [property_name] [ON DATABASE db_name];
DGMGRL> SHOW INSTANCE inst1;DGMGRL> SHOW INSTANCE VERBOSE inst3;
DGMGRL> SHOW INSTANCE testdb ‘TopWaitEvents’;

DGMGRL> SHOW FAST_START FAILOVER;
DGMGRL> SHOW FAST_START FAILOVER;

From 18c Oracle Database, SHOW ALL command shows the values of DGMGRL command line utility properties.
DGMGRL> SHOW ALL;
   debug ON
   echo OFF
   time OFF
   observerconfigfile = observer.ora

SHUTDOWN – Shuts down a currently running Oracle instance.DGMGRL> SHUTDOWN [NORMAL | IMMEDIATE | ABORT];DGMGRL> SHUTDOWN;
DGMGRL> SHUTDOWN NORMAL;
DGMGRL> SHUT IMMEDIATE;
DGMGRL> SHUT ABORT;

SQL – Executes a SQL statement
DGMGRL> SQL “sql_statement”;

START – Starts the fast-start failover(FSFO) observer.DGMGRL> START OBSERVER [FILE=observer_configuration_file];DGMGRL> START OBSERVER;

STARTUP – Starts an Oracle database instance.DGMGRL> STARTUP [RESTRICT] [FORCE] [PFILE=filespec]
[NOMOUNT  |  MOUNT | OPEN [READ ONLY|READ WRITE]];DGMGRL> STARTUP;
DGMGRL> STARTUP NOMOUNT;
DGMGRL> STARTUP MOUNT;
DGMGRL> STARTUP OPEN;
DGMGRL> STARTUP FORCE;
DGMGRL> STARTUP FORCE RESTRICT NOMOUNT;
DGMGRL> STARTUP PFILE=initdwh.ora NOMOUNT;

STOP – Stops the fast-start failover(FSFO) observer.DGMGRL> STOP OBSERVER;

SWITCHOVER – Switches roles between a primary and standby database.DGMGRL> SWITCHOVER TO standby_database_name;DGMGRL> SWITCHOVER TO “standby”;


VALIDATE – command to checks whether the database is ready for a role transition or not.

DGMGRL> VALIDATE DATABASE …;    — From Oracle Database 12c

From Oracle Database 18c,
DGMGRL> VALIDATE DATABASE standby-database-name SPFILE;

DGMGRL> VALIDATE NETWORK CONFIGURATION FOR { ALL | member name };
DGMGRL> VALIDATE NETWORK CONFIGURATION FOR stdby;

DGMGRL> VALIDATE STATIC CONNECT IDENTIFIER FOR { ALL | database name };DGMGRL> VALIDATE STATIC CONNECT IDENTIFIER FOR stdby;

$BDUMP/drc*.log
$ORACLE_HOME/rdbms/log/drc*.log

alter system set dg_broker_start=false;
alter system set dg_broker_start=false sid=’*’;
alter system set dg_broker_start=FALSE SCOPE=spfile SID=’*’;
alter system set dg_broker_start=true;
alter system set dg_broker_start=true sid=’*’;
alter system set dg_broker_start=TRUE SCOPE=spfile SID=’*’;

alter system set dg_broker_config_file1=’/u01/dg_broker_config_files/dr1TESTP.dat’ sid=’*’;
alter system set dg_broker_config_file2=’/u01/dg_broker_config_files/dr2TESTP.dat’ sid=’*’;

Jenkins installation steps

How to install Jenkins in linux.

  1. Make sure Java’s latest version is installed or install the one.
  2. Download the Jenkins (
  3. Install the jenkins ( sudo
  4. Start the Jenkins (
  5. Make sure port 8080 (default) is open:
  6. Extract the ip address allocated to server:
  7. Access the Jenkins in url: ip:8080
  8. Install the necessary plugins.

Install the necessary plugins

Plugin installation in progress.


Once you will provide the admin/pwd and email etc. and click ‘Continue as admin’ Jenkins will be ready for use.

Jenkins plugins at a glance.

Important Git commands

  1. To see on which branch git is and the status of the branch changes.
git status

2. To push the changes to staging area from the working directory after the changes to it.

git add "file_name"

3. After add command to push the changes to local repository, use commit command as below to push the changes from staging area to local repository.

git commit -m "commimt message    or git commit

Note: If you will use command “git commit” command only, then the default text editor like Notepad++ will open. Where we can give the commit message.

We can use this way when we need to give long commit message.

4. To push the changes to remote repository(Here Github.com) from local reposiitory.

git push origin master

5. To check which remote repository account we are logged in.

cat ~/.gitconfig

6. To set up Notepad++ as defauklt editor in Git.

git config --global core.editor "Notepadd++.exe --multiInst --nosession"

7. To edit the config file.

git config --global -e

8. To crete a fresh repository in Git.

git init repository_name

9. Rebase: 10. Revert or undo:  It undo the changes made in previous commit.

  • New commit is created without the changes made in the other.
  • Old commit still resides in the history.

11. Reset: Can be used to undo the changes at different levels.

  • Note: –hard, –soft and –mixed (modifiers to decide the reset degree).
git reset v1.5

All important commands for cloning from Github remote repository

The first step to start with Git is to connect to a remote repository. It can be Gitlab, Github or any other. Here we will use Github.

So please follow below three commands to configure Github.

  1. To check if Git is installed or the Git version we are using.
git vesion

2. Next step is to give the User name.

git config --global user.name "Username"

3. Then give the registered email id.

git config --global user.email "user@email.com"

4. Use below command to see if User name and email are correctly given.

git config --global --list

5. Now login to Github.com where your repositories are placed and go to the repository you want to clone. There go to the Clone or Download button as shown in the screenshot below and first select use https and copy the HTTPs Link.

6. Now go to Git bash client and use next command as below.

Note: Change the https link.

git clone "https://github.com/1StopBuyers/Pilot.git"

7. Now give the usename and Password of the Github account for which the details are given above. And you will get the cloning successful message as below.

Please do comment in case of any doubt. Thank you.

Git GUI launching and options

Once you have installed git, can launch GUI just using simple command.

$ git gui

Below GUI will pop-up in few seconds and you can do everything what can be done from CLI of git. You can see the list of ‘Unstaged Changes’. There files were already available.

Options under ‘Repository’

Options under ‘Edit’

Primary and standby status

We can run following queries to check all are fine with Standby db.

       @Primary

set lines 500
column destination format a35 wrap
column process format a7
column archiver format a8
column ID format 99

select dest_id “ID”,destination,status,target,archiver,schedule,process,mountid from v$archive_dest;

Output (Status should return valid for standby destination)

ID DESTINATION STATUS TARGET ARCHIVER SCHEDULE PROCESS MOUNTID


1 /podaai/arch/PODAAI1/ VALID PRIMARY ARCH ACTIVE ARCH 0
2 podaai1_rmdc VALID STANDBY ARCH ACTIVE ARCH 0
3 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
4 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
5 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
6 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
7 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
8 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
9 INACTIVE PRIMARY ARCH INACTIVE ARCH 0
10 INACTIVE PRIMARY ARCH INACTIVE ARCH 0

column error format a55 tru
select dest_id,status,error from v$archive_dest;

Output (Should not return any error messages)

DEST_ID STATUS ERROR


     1 VALID
     2 VALID
     3 INACTIVE
     4 INACTIVE
     5 INACTIVE
     6 INACTIVE
     7 INACTIVE
     8 INACTIVE
     9 INACTIVE
    10 INACTIVE

column message format a80
select message, timestamp from v$dataguard_status where severity in (‘Error’,’Fatal’) order by timestamp;

Output (Should not return any rows)

SCP SYNTAX

scp PGEORI_2_23362*.arc rmohsgeor36.oracleoutsourcing.com:/pgeori/arch/PGEORI1

$ scp PCFITI_1_57371_604994162.arc rmohscfit03.oracleoutsourcing.com:/pcfiti/arch/
PCFITI_1_57371_604994162.arc

                               @Standby

select process,status,client_process,sequence#,block#,active_agents,known_agents from v$managed_standby;

Output (Should show MRP process up and running)

PROCESS STATUS CLIENT_P SEQUENCE# BLOCK# ACTIVE_AGENTS KNOWN_AGENTS


ARCH CONNECTED ARCH 0 0 0 0
ARCH CONNECTED ARCH 0 0 0 0
ARCH CONNECTED ARCH 0 0 0 0
ARCH CONNECTED ARCH 0 0 0 0
RFS RECEIVING UNKNOWN 13491 36819 0 0
RFS RECEIVING UNKNOWN 13364 1810 0 0
RFS RECEIVING UNKNOWN 13493 38735 0 0
RFS RECEIVING UNKNOWN 13363 156 0 0
RFS ATTACHED UNKNOWN 13494 36989 0 0
RFS RECEIVING UNKNOWN 0 0 0 0
RFS RECEIVING UNKNOWN 13362 327 0 0

PROCESS STATUS CLIENT_P SEQUENCE# BLOCK# ACTIVE_AGENTS KNOWN_AGENTS


RFS ATTACHED UNKNOWN 13365 165 0 0
RFS RECEIVING UNKNOWN 13492 36686 0 0
MRP0 WAIT_FOR_LOG N/A 13493 0 0 0

column message format a80
select message, timestamp from v$dataguard_status where severity in (‘Error’,’Fatal’) order by timestamp;

Output (Should not return any rows)

Note: If we gets results as shown above, we can close the standby alerts as TFALSE.

Pls correct/ add comments if required.

To determine if there is an archive gap on your physical standby database, query
the as shown in the following example:

break on report
compute sum of GAP on report
select to_char(sysdate,’DD.MM.RR HH24:MI:SS’) time, a.thread#, (select
max(sequence#) from v$archived_log where archived’YES’ and thread#a.thread#)
archived, max(a.sequence#) applied, (select max(sequence#) from v$archived_log
where archived’YES’ and thread#a.thread#)-max(a.sequence#) gap from
v$archived_log a where a.applied’YES’ group by a.thread#;

To verify the log application status.

On primary DB

SELECT THREAD#, MAX(SEQUENCE#) AS “LAST_GENERATED_LOG” FROM V$LOG_HISTORY GROUP BY THREAD#;

Standby DB

SELECT THREAD#, MAX(SEQUENCE#) AS “LAST_APPLIED_LOG” FROM V$LOG_HISTORY GROUP BY THREAD#;

To see the max seq applied.

select THREAD#,max(SEQUENCE#) from v$archived_log where APPLIED’YES’ group by THREAD#;

To stop the MRP.

alter database recover managed standby database cancel;

To start the MRP.

recover managed standby database disconnect from session;

To recover standby manually.

SQL> recover automatic standby database;

SQL> recover managed standby database parallel

a. no. of cpu…
b. no. of thread possible on each cpu…

total threads a*b -1

To enable the in one commmand.

SQL> ALTER SYSTEM SET log_archive_dest_state_2enable scopeboth SID’*’ ;

To start the standby and put in MRP

SQL> startup nomount;

SQL> alter database mount standby database;

recover managed standby database disconnect from session ;

To find the missing logs @ standby

./autofs/cmd_ctr/database/missing_seq.sh
missing_seq.sh Parameter missing: missing_seq.sh low_seq high_seq thread#_if_rac
In case of Non Rac: missing_seq.sh 200 220 No need to give thread#
for Non Rac: missing_seq.sh 200 220 3 Here 3 is the thread#

set pagesize 10000
SELECT A., Round(A.Count#B.AVG#/1024/1024) Daily_Avg_Mb
FROM
(
SELECT thread#,
To_Char(First_Time,’YYYY-MM-DD’) DAY,
Count(1) Count#,
Min(RECID) Min#,
Max(RECID) Max#
FROM
gv$log_history
GROUP BY
thread#, To_Char(First_Time,’YYYY-MM-DD’)
ORDER
BY 2 DESC
) A,
(
SELECT Thread#,
Avg(BYTES) AVG#,
Count(1) Count#,
Max(BYTES) Max_Bytes,
Min(BYTES) Min_Bytes
FROM
gv$log group by thread#
) B where a.thread#b.thread#;

THREAD# DAY COUNT# MIN# MAX# DAILY_AVG_MB


     1 2010-03-24        113     133452     133564        14238
     1 2010-03-23        174     133278     133451        21924
     1 2010-03-22        182     133096     133277        22932
     1 2010-03-21        112     132984     133095        14112
     1 2010-03-20        145     132839     132983        18270
     1 2010-03-19        176     132663     132838        22176
     1 2010-03-18        200     132463     132662        25200
     1 2010-03-17        154     132309     132462        19404
     1 2010-03-16        164     132145     132308        20664
     1 2010-03-15         40     132105     132144         5040
Scroll Up