Wednesday, 18 August 2021

DR Maintenance Steps sequence

Pre-steps in all db and apps servers

=======================

Take Backup of below things

1. df -hP o/p of all app and db servers

2. cp -rp /etc/resolv.conf      /etc/resolv.conf_bkp

3.

service iptables status

service ip6tables status

4.    comment cron if needed

5. date


DR STOP pre-steps:

=================

1. select max( sequence#)  from v$archived_log where applied='YES'; -- From primary

2. select max( sequence#)  from v$archived_log where applied='YES'; -- From DR

Make sure both match same number 

3. Take o/of below from DR

ps -ef| grep tns

sho parameter db_name, db_unique, local, archive log list

4. Take backup of parameter file

show parameter pfile, spfile

create pfile='?dbs/init_pfile.ora_bkp' from spfile;

ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=DEFER scope=both; -   from PRIMARY

On Standby:

No RFS Process showing when query below:

SELECT PROCESS,  STATUS, SEQUENCE#  FROM V$MANAGED_STANDBY;

5. Stop listener On standby server:

ps -ef| grep tns

lsnrctl stop listername

6. Cancel Managed Recovery from standbyb

ps -ef| grep mrp

SQL> alter database recover managed standby database cancel;

verify its not running -  ps -ef| grep mrp

7. Comment cron in DB -- Take backup before - Standby only

8. - Shutdown the Standby Database

connect to Primary - check status

STANDBY -   SQL> shutdown immediate

ps -ef| grep mrp

ps -ef| gep tns

DR start:

======

In  all app server:

Validate the mount points as below.

Restore the /etc/resolv.conf file from resolv.conf_25aug20 backup.

          cp -p /etc/resolv.conf_25aug20 /etc/resolv.conf

Disable firewall running on all 3 servers as per below command:

         service iptables save

         service iptables stop

         service ip6tables stop

         chkconfig iptables off

 IN DR:

1. Uncomment Cron

2. Start db 

SQL> startup mount;

SQL> alter database recover managed standby database disconnect from session;

3. Start Database Listener

    lsnrct start listemer - STANDBY

4. Set log transport state to ENABLE status:

ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE scope=both;

5. select open_mode, database_role, name from v$database;

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE scope=both;

6. SELECT PROCESS,  STATUS, SEQUENCE#  FROM V$MANAGED_STANDBY;

7. @gap

8. select max( sequence#)  from v$archived_log where applied='YES'; -- From primary

 select max( sequence#)  from v$archived_log where applied='YES'; -- From DR

9. archive log list, check db_name. unique, spfile, alert logs

10. dgmgrl / , show configuration, -- primary side

show database verbose 'db_name_primary', 

show database verbose 'db_name_DR'

No comments:

Post a Comment