Category: Dataguard

  • Data Guard switchover Pre & Post Steps

    Pre-Steps for Data Guard Switchover:

    Verify Managed Recovery: Ensure that Managed Recovery is running on the standby database. This ensures that the standby database is synchronized with the primary database.

    Show lag for Data Guard configuration

    DGMGRL> show configuration lag;

    Show configuration for database role change
    [This will be useful with multiple standby databases]

    DGMGRL> show configuration when primary is TEST_SBY;

    Validate database spfile (don’t use OS authentication)

    DGMGRL> connect sys
    Password:
    Connected to "TEST_SBY"
    Connected as SYSDBA.
    
    DGMGRL>  validate database verbose TEST_SBY spfile;

    Validate DGConnectIdentifier

    DGMGRL> connect sys
    Password:
    Connected to "TEST_SBY"
    Connected as SYSDBA.
    
    VALIDATE DGConnectIdentifier <connect identfier>;
    
    VALIDATE DGConnectIdentifier TEST;
    VALIDATE DGConnectIdentifier TEST_SBY;

    Validate static connect identifier

    Confirm SPFILE Usage: Verify that the primary and standby databases are using the SPFILE (Server Parameter File). This ensures that the database configurations are consistent.

    DGMGRL> connect sys
    Password:
    Connected to "TEST_SBY"
    Connected as SYSDBA.
    
    DGMGRL> validate static connect identifier for all;

    Validate network configuration

    DGMGRL> connect sys
    Password:
    Connected to "TEST_SBY"
    Connected as SYSDBA.
    
    DGMGRL> validate network configuration for all;
    

    Validate Primary and Standby databases

    DGMGRL> connect sys
    Password:
    Connected to "TEST_SBY"
    Connected as SYSDBA.
    
    DGMGRL> validate database "TEST"
    DGMGRL> validate database "TEST_SBY"

    Switchover Steps:

    Connect to DGMGRL: Start the Data Guard Broker Command-Line Interface (DGMGRL) and connect to the primary database. Use the DGMGRL command to initiate the switchover process.

    Perform Switchover

    DGMGRL> connect sys
    Password:
    Connected to "TEST_SBY"
    Connected as SYSDBA.
    
    DGMGRL> SWITCHOVER TO "TEST_SBY"

    Initiate Switchover: Use the DGMGRL command to initiate the switchover process. This command will change the roles between the primary and standby databases.

    Monitor Switchover Progress: Monitor the switchover progress using DGMGRL or other monitoring tools. This allows you to track the status of the switchover and ensure that it completes successfully.

    Post-Steps for Data Guard Switchover:

    Verify Switchover Completion: Confirm that the switchover process has completed successfully. Use the v$database view to check the new database roles.

    DGMGRL> show configuration lag
    DGMGRL> show configuration

    After Switchback check BCT

    set lines 300
    col STATUS for a10
    col FILENAME for a80
    select * from v$block_change_tracking;