Friday , July 21 2017
Home / Oracle DBA / Add Standby Redo Log Groups to Primary Database

Add Standby Redo Log Groups to Primary Database

# Add Standby Redo Log Groups to Primary Database

Create standby log file groups on the primary database for switch overs (start with next group number; create one more group than current number of groups):
$ sql plus “/ as sys dba”
SQL> select max(group#) max group from v$ log file;
SQL> select max(bytes) / 1024 “size (K)” from v$log;
SQL> alter database add standby log file group 4 (‘/or cl/o r a data/PROD/st by_log_PROD_4A.r do’, ‘/or cl/o r a data/PROD/st by_log_PROD_4B.r do’) size 4096K; … etc …
SQL> column member format a55
SQL> select vs.group#,vs.bytes,v l.member from v$standby_log vs, v$ log file v l where vs.group# = v l.group# order by vs.group#,v l.member;
# Switch To Maximum Availability Protection Mode
Switch to the desired “maximum availability” protection mode on the primary database (from the default “maximum performance”):
SQL> select value from v$parameter where name = ‘log_archive_ dest_2′;  — must show LG W R SYNC
SQL> shutdown normal
SQL> startup mount
SQL> alter database set standby database to maximize availability;
SQL> alter database open;
SQL> select protection_mode from v$database;
# Shutdown and Startup for Standby Database
To shut down a standby database:
If in read-only access, switch back to managed recovery (after terminating any other active sessions):
SQL> alter database recover managed standby database disconnect from session;
Cancel managed recovery and shutdown:
SQL> alter database recover managed standby database cancel;
SQL> shutdown immediate
# To start up a standby database:
SQL> startup no mount
SQL> alter database mount standby database;
SQL> alter database recover managed standby database disconnect from session;
# Switchover – Swapping Primary and Standby
End all activities on the primary and standby database.
On the primary (switch over status should show “TO STANDBY”):
SQL> select database_role,switch over_status from v$database;
SQL> alter database commit to switch over to physical standby;
SQL> shutdown immediate
SQL> startup no mount
SQL> alter database mount standby database;
On the standby (switch over status should show “SWITCH OVER PENDING”):
SQL> select database_role,switch over_status from v$database;
SQL> alter database commit to switch over to primary;
SQL> shutdown normal
SQL> startup
On the primary:
SQL> alter database recover managed standby database disconnect from session;
On the standby:
SQL> alter system archive log current;
Change tns names.ora entry on all servers to swap the connect strings (my server_prod and my server_prod2).
View More:
Brief Description of Oracle DATAGUARD
Oracle FLASHBACK DATABASE
FLASHBACK TRANSACTION QUERY

Comments

comments

Check Also

DATA BASE LINKS

DATABASE LINKS: What are the db links? create a link from one database to another …

Leave a Reply

Your email address will not be published. Required fields are marked *