Skip to main content

Posts

Showing posts with the label DATAGUARD

HIGH LEVEL STEPS TO SETUP A STANDBY DATABASE IN ORACLE

1) The database has to be archive log mode 2) Force Logging should be enabled. 3) The DBNAME will be the same in Primary and standby but DB unique name will be different. 4) Need to alter => ALTER SYSTEM SET LOG_ARCHIVE_CONFIG='DG_CONFIG=(DB11G,DB11G_STBY)'; 5) Need to alter log_archive_dest_2 and enable it 6) REMOTE_LOGIN_PASSWORDFILE = { shared | exclusive | none } should exclusive 7) ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO; 8) add entries in tnsnames.ora file in primary and standby side. 9) backup primary database. 10) create a standby control file => ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/db11g_stby.ctl'; 11) CREATE PFILE='/tmp/initDB11G_stby.ora' FROM SPFILE; 12) Amend the PFILE making the entries relevant for the standby database *.db_unique_name='DB11G_STBY' *.fal_server='DB11G' *.log_archive_dest_2='SERVICE=db11g ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DB11G' 13) Create the necessary d...

Explain Snap Shot StandBy database and the use of it

Explain Snap Shot StandBy database and the use of it? Able to open standby database in read-write. This is very useful to turn our standby database into application testing / development purposes. This is achieved through snapshot standby database. In order to create snapshot standby database: 1. Standby database must be a physical standby database 2. Flashback logging must be enabled on both primary and standby database 3. After enabling flashback mode, connect to dgmgrl utility in the primary database: 4. DGMGRL> CONVERT DATABASE STDBY TO SNAPSHOT STANDBY; SQL> alter database convert to snapshot standby; NOTE: Snap Shot StandBy – Is recommended if we have more than one standby database to the primary database. From now on, we can do any testing (like creating new schemas, tables and so on) on our standby database. Please note that at this point of time; all the redo generated in our production database will be still shipped to standby database.  But it is just that not goin...

What is active data guard and How to enable stanby database is in read-only mode (Active standby)

What is active data guard and How to enable stanby database is in read-only mode (Active standby)?? If trying open the standby database in read only mode will get the below error. SQL> ALTER DATABASE OPEN READ ONLY; ALTER DATABASE OPEN READ ONLY * ERROR at line 1: ORA-10456: cannot open standby database; media recovery session may be in progress. 1. First we need turf off the log apply process on the standby database. Using the below. DGMGRL> edit database <stdby_dbname> set state=apply-off; SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; SQL> ALTER DATABASE OPEN READ ONLY; SQL>Select name, open_mode, switchover_status, database_role from v$database; Start apply process using Broker (OR) Manually in standby database. DGMGRL> edit database <stdby_dbname> set state=apply-on; SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT; To disable the active data guard, the steps are the same: 1. DGMGRL> edit databa...

Convert standby database to standby Snapshot database

PROD - Primary database COB  - Physical standby database 2. Convert COB to standby Snapshot database and confirm it is in read/Write  (i)SQL> alter database recover standby database cancel; or DGMGRL > EDIT DATABASE 'COB_DATABASE' SET STATE = 'APPLY-OFF'; (ii)DGMGRL > convert database 'COB_DATABASE' to snapshot standby; (iii)shutdown the database on the node and start the database like below SRVCTL status database - d COB_DATABASE SRVCTLstop database - d COB_DATABASE SRVCTL start database - d COB_DATABASE SRVCTL status database - d COB_DATABASE (iv) SQL > SELECT database_role role, name, db_unique_name, platform_id, open_mode, log_mode, flashback_on, protection_mode, protection_level FROM v$ database;

DATA GUARD BASICS

DATA  GUARD Data Guard is basically a ship redo and then apply redo, as you know redo is the information needed to recover a database transaction. A production database referred to as a primary database transmits redo to one or more independent replicas referred to as standby databases. Redo information needed to recover a database transaction. Remember that the LGWR can write to the log file using "group" commits, basically entire list of redo entries of waiting transactions (not yet committed) can be written to disk in one operation, thus reducing I/O. Even through the data buffer cache has not been written to disk, Oracle guarantees that no transaction will be lost due to the redo log having successfully saved any changes. A production database referred to as a primary database transmits redo to one or more independent replicas referred to as standby databases. A standby database will also automatically re synchronize if it becomes temporary disconnected ...

STEPS TO TURN ON PHISICAL STANBY TO ACTIVE STANDBY DATABASE

Please follow below steps. NOTE: Here primary & standby already configuared. The below are the steps we are performing on standby database, to make it active standby database. ------------------------------------------------------------- 1. Connect to the standby database. ------------------------------------------------------------- 2. Stop redo apply using the below script SQL>recover managed standby database cancel; --------------------------------------------------------------------------------------------------- 3. Issue the following query to find out if the standby database is performing Redo Apply or real-time apply. If the MRP0 or MRP process exists, then the standby database is applying redo SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY; --------------------------------------------------------------------------------------------------- 4. Check database tole, open mode using the below script.  SQL>select name, database_role,o...

DATA GUARD INTERVIEW QUESTIONS & ANSWERS.

1. 1.  What are the advantages in using Oracle Data Guard?   Following are the different benefits in using Oracle Data Guard feature in your environment.    High Availability.   Data Protection.   Off-loading Backup operation to standby database.   Automatic Gap detection and Resolution in standby database.   Automatic Role Transition using Data Guard Broker. 22.    What are the different services available in Oracle Data Guard?                 Following are the different Services available in Oracle Data Guard of Oracle database. ü   Redo Transport Services. ü   Log Apply Services. ü   Role -Transitions. 33.  What are the different Protection modes available in Oracle Data Guard? Below are the protection modes available in DG ü   Maximum Protection ü   Maximum Availability ü   Maximum...