Thursday, June 25, 2009

LOG APPLY SERVICES (LAS)

LOG APPLY SERVICE:

i. Applying redo immediately

ii. Time delay for redo apply

Applying redo data to Physical Standby Database

  1. start redo apply
  2. stop redo apply
  3. monitor redo apply

Applying redo data to Logical Standby Database

iii. start sql apply

iv. stop sql apply

v. monitor sql apply

LOG APPLY SERVICES (LAS): Process is Automatic

1. Redo Apply (Physical Standby Database only)

· Uses Media Recovery to keep Primary Database & Standby Database synchronized.

· Kept in mounted state & can be open for reporting.

2. SQL Apply (Logical Standby Database only)

· Reconstructs the SQL statements form redo data received from Primary Database & applies it to Logical Standby Database.

· Can be opened in R/W mode.

Redo Transport Service Process on the Standby Database receives the redo data and applies it to standby redolog files or archived redolog files.

RFS - Redo file server process

MRP- Managed recovery process (performs recovery i.e... starts apply redo data)

LSP - Logical Standby Process.

FIG 6-1: Oracle Dataguard (B14239-04)

1. Applying Redo Data Immediately: (Real-Time Apply)

In this process the redo data is applied immediately as it is received without waiting for the current standby redolog file to be archived

Enabling real-Time Apply for Physical Standby Database

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE

Enabling real-Time Apply for Logical Standby Database

ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE

2. Specifying a time delay for applying Redologs:

Paramter used: log_archive_dest_n

Attribute: delay

System: Delay in minutes

Default Value: 30 mins

Delay is used to protect the corrupted data getting applied to Standby Database.

Delay time starts after redo is received and completely archived

If real time is applied & delay is specified then delay is ignored

Cancel delay using nodelay

Ex:

Physical Standby Database

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE NODELAY;

Logical Standby Database

SQL> ALTER DATABASE START LOGICAL STANDBY APPLY NODELAY;

Alternate option for delaying:

Using flash back on standby database.

Applying Redo data to Physical Standby Database:

· By default redo is always applied from archived redo logs of standby db.

· In case of real-time apply; redo applied directly from standby redo log files before they are archived.

· Redo data cannot be applied if Physical Standby Database is open in read only mode. There fore start the Physical Standby Database and keep it in mounted state to apply the redo.

Apply redo is foreground process ( control is not returned)

Sql> Alter database recover managed standby database;

Applying redo as background process(control is returned)

Sql> Alter database recover managed standby database disconnect;

Using Real-time Apply:

Sql> Alter database recover managed standby database using current logfile;

Cancel Real-time Apply:

Sql> Alter database recover managed standby database cancel;

Monitoring:

Use OEM for monitoring log apply services.

Applying redo data to Logical Standby Database:

SQL Apply converts the data from archived redo log files or standby redolog ifles on Logical Standby Database into sql statements and then these sql statement are applied to Logical Standby Database.

Logical Standby Database always remain open as sql statements has to be executed.

Used for reporting, summations and quering purpose.

Starting sql apply

SQL> ALTER DATABASE START LOGICAL STANDBY APPLY;

Realtime:

SQL> ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;

Stopping:

SQL> ALTER DATABASE STOP LOGICAL STANDBY APPLY;

Note: This command is delayed as sql apply will wait to apply all the commited transactions.

For stopping immediately used

SQL> ALTER DATABASE ABORT LOGICAL STANDBY APPLY;

Monitoring:

Use OEM for monitoring log apply servies.

No comments:

Post a Comment