Bulid Logical Database

I Post Earlier What is the Different Between Logical Database and Standby Database , Both Are Type For Data Guard .

Today i will take about how to configure Logical Database , to do this you must first create Physical Standby Which i mention it before , And you can Follow the link .

These steps for 10g,  Now After create physical Standby Database , And Make sure its working Without any problem , You Have to follow the below steps to Create Oracle Logical Standby.


Steps to convert Standby Database to Logical Standby Database :

Step #1 : 

in this step logminer Dictionary Must be Built into redo data. ( Build LogMiner Tables for Dictionary)

On Primary

SQL> begin
  2  dbms_logstdby.build;
  3  end ;
  4  /

OR

 SQL> execute dbms_logstdby.build;

Step #2:

Now we have stop Managed recovery between primary and standby :

On Standby :

SQL> alter database recover managed standby database cancel ;

Database altered.

Step #3 :

Convert Physical Standby to Logical Standby .

On Standby :

SQL> alter database recover to logical standby stdby ;

Database altered.

Notices : If this command hang and take to much Time then Back to step #1 and did it again .

Step #4:

On Standby ( New Logical)  we open it in Resetlog mode .

On New Logical ( Standby) :

SQL> shutdown immediate ;
ORA-01507: database not mounted

ORACLE instance shut down.

SQL> startup mount ;
ORACLE instance started.

Total System Global Area  839282688 bytes
Fixed Size                  2217992 bytes
Variable Size             532678648 bytes
Database Buffers          301989888 bytes
Redo Buffers                2396160 bytes
Database mounted.

SQL>
SQL>
SQL> alter database open resetlogs ;

Database altered.

Step #5:

Start Apply Service On logical

SQL> alter database start logical standby apply ;

Database altered.

OR

SQL> alter database start logical standby apply immediate ;
Database altered.

Just As Check if everything Goes Fine :

SQL> select database_role , Name from v$database ;

DATABASE_ROLE    NAME
—————- ———
LOGICAL STANDBY  STDBY

Thank you
Osama Mustafa

Logical Standby Vs Physical Standby

What is the difference between these two Data Guard configuration , When To Use them :

Physical Standby:

1- Physical Standby Database Its exactly same As Primary Database.
2-  In Physical Data Guard The archivelog Applied directly after transfer from primary database (FTP)

Properties of Physical Standby

1- Maintain Is Easy.
2- Creation is Easy .
3- Copy Of your Primary Database ( Disaster Recovery Solution ).

Usage :

High availability solutions Or disaster recovery Solution.

Logical Standby

1 – Opposite Of standby Database , Which is not Match primary Database .
2 – This Kind Of Configuration can be Opened in Read Only Mode .
3 – can have additional materialized views and indexes added for faster performance
4 – LogMiner Techniques to transfer Archivelog.

Properties Of Logical Database :

1 – Open In Read only Mode .
2 – Sometimes its used as RollBack Solution In Upgrade ,

Usage:

1 – reporting Database to avoid overhead in primary database.
2 – Query Database .

How they Works :

Regarding to Oracle documentation  :

LNS (log-write network-server) and ARCH (archiver) processes running on the primary database select archived redo logs and send them to the standby database, where the RFS (remote file server) background process within the Oracle instance performs the task of receiving archived redo-logs originating from the primary database.

Alternatively, a supplementary mechanism may transfer the archived redo logs. On the standby database a Fetch Archive Log (FAL) client monitors for gaps in the sequence of received logs. If it finds a gap, it may invoke one or more Fetch Archive Log (FAL) servers to run on the primary database to forward the missing item(s).

Once the archived redo logs have arrived, other processes (such as an ARCH (Archiver process), an MRP (Managed Recovery Process), and/or an LSP (Logical Standby Process)) may set about applying the log contents to the standby database.

 Conclusion :

The difference between physical and logical standby is in the way the changes from the primary are applied. Both created as an exact image of the primary database. Both receive redo logs from the primary database.

 Refernce :
 Oracle DataGuard architecture 

Thank you
Osama mustafa