Oracle Data Guard Protection Modes

on 9:33 AM

1. MAXIMUM PROTECTION

This mode provides maximum protection. 

It guarantees zero data loss. 

In this mode the redo/transaction data must be written to both primary redo log and standby redo log. 

For any reason(mostly N/W issue) if it is unable to write to standby, Then primary will get shutdown.

2. MAXIMUM AVAILABILITY:

It provides the highest level of data protection that is possible without affecting the availability of the primary database.

Transactions are not allowed to commit until all redo data are written to the online redo logs and propagated to at least one  synchronized secondary database. 

If for any reason, the primary database cannot propagate its redo stream to one secondary database, the primary will NOT shutdown and operates as it it were in maximum performance mode until issues are fixed.

3. MAXIMUM PERFORMANCE:

This is the default protection mode. 

With this protection mode, a transaction is committed as soon as the redo data needed to recover the transaction is written to the local (online) redo log.

Difference between pfile and spfile

on 8:45 AM




Oracle Net Services configuration failed. The exit code is 1

on 8:06 AM

[oracle@prim ~]$ netca

Oracle Net Services Configuration:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Error: null
Check the trace file for details: /u01/app/oracle/cfgtoollogs/netca/trace_OraDb11g_home1-1610215PM5028.log
Oracle Net Services configuration failed.  The exit code is 1

Workaround :

[oracle@prim ~]$ su 
Password: ********

[root@prim]# export DISPLAY=:0.0

[root@prim]# xhost +
access control disabled, clients can connect from any host

[oracle@prim~]$ netca


Oracle Net Services Configuration:



Types Of Standby Databases

on 6:36 AM

Standby Database : A standby database is a transactionally consistent copy of the primary database.

There are 3 types of standby setup:

1. Physical standby
2. Logical standby
3. Snapshot standby

PHYSICAL STANDBY:

A physical standby database is an exact, block-for-block copy of a primary database. A physical standby is maintained as an exact copy through a process called REDO APPLY, in which redo data received from a primary database is continuously applied to a physical standby database using the database recovery mechanisms. So it will be always in sync with primary.

This Standby database can be opened in read only mode( knows as ACTIVE DATA GUARD), for reporting purpose. Most of the corporations use physical standby for dataguard configuration.


LOGICAL STANDBY:

The logical standby database is kept synchronized with the primary database through SQL APPLY, which transforms the data in the redo received  from the primary database into SQL statements and then executes the SQL statements on the standby database. So it contains same logical information as that of production , but physical structure of data can be different.

SNAPSHOT STANDBY:

 A snapshot standby database is a fully update-able standby database that is created by converting a physical standby database into a snapshot standby database. During this setup though it will receive logs from primary,But  those redo won’t be applied to snapshot standby. Redo data received from the primary database is  applied when a snapshot standby database is converted back into a physical standby database, after discarding all local updates to the snapshot standby database. 

It provides an exact replica of a production database for development and testing purposes, while maintaining data protection at all times.

Oracle Data Guard 11g

on 12:09 PM

Data Guard provides a comprehensive set of services that create, maintain, manage, and monitor one or more standby databases to enable production Oracle databases to survive disasters and data corruptions.

Its configuration consists of one primary database and one or more standby database. The standby databases will be always in sync  with primary database. If primary production database is unavailable due to planned or unplanned outage , then we can switch the production to standby database, making the application less affected by the outage.

 Apart from this we can use the standby database for taking backups and reporting queries, there by reducing some workload from production.

The main features of Oracle data guard is

1. High availablity
2. Data protection
3. Disaster Recovery

# Primary Database : A Data Guard configuartion contains one production database, also referred to as the primary database.

The primary database can be either a single instance Oracle Database or an Oracle Real Application Cluster database.

# Standby Database : A standby database is a transactionally consistent copy of the primary database.

Dataguard automatically maintains each standby database by transmitting redo data from primary database and then applying the redo to the standby database.

Basic Rman Backup Script

on 3:20 AM

run 



allocate channel c1 type disk; 


allocate channel c2 type disk;


backup database format '/u01/app/oracle/backup/rman/%d_%s_%p_%U.bkp'; 


backup archivelog all format '/u01/app/oracle/backup/rman/ARCH_%d_%s_%p_%U.bkp';


backup current controlfile for standby format '/u01/app/oracle/backup/rman/control_%d_%U.bkp'; 


 }