Creating active dataguard - 11g feature

Here we have primary database(pridb) and standby database(stddb)
Steps to create an active dataguard(11g)

1.copy the password file from the primary to the secondary server under $ORACLE_HOME/dbs directory.

2.Ensure the primary database is in archive log mode if not convert it to archive log mode.

alter system set log_archive_dest_1='location=/vol1/app/oradata/arch valid_for=(all_logfiles,all_roles)';

In mount stage issue the following command

SQL> alter database archivelog;

Enable force logging

SQL> alter database force logging;

Enable the flashback which is not mandatory but recommended.

SQL> alter database flashback on;

Create the standby redolog files in the primary. The recommendation is,

 number of standby redo log groups=(number of online redo log file groups + 1) * number of threads

*The redo log & standby redologs should have same size
*The standby redologs are mandatory only when you do real time apply.

3.Create a controlfile from primary for creating standby.

RMAN>backup current controlfile for standby format='/vol1/rmanbkup/stby_cfile.%U';

4.Backing up the archivelogs and deleting input archivelogs for resolving space constraints.

RMAN>backup archivelog all delete input;

5.create directories for datafiles and logfiles in secondary as like in primary server

6.create pfile from spfile

7.change init parameters in primary database

SQL> alter system set fal_client=pridb;

System altered.

SQL> alter system set fal_server=stddb;

System altered.

SQL> alter system set log_archive_dest_2='service=stddb LGWR ASYNC valid_for=(online_logfiles, primary_role) db_unique_name=stddb';

System altered.

SQL>  alter system set log_archive_dest_state_2=defer;

System altered.

8.Start standby instance

SQL> conn sys/syspridb@stddb as sysdba
Connected to an idle instance.
SQL> startup nomount pfile='/vol1/initstddb.ora';
ORACLE instance started.

run {
    # Set the last log sequence number
    set until sequence = 208 thread = 1;

    # Allocate the channel for the duplicate work
    allocate auxiliary channel ch1 type disk;

set newname for datafile  1 to
set newname for datafile  2 to
set newname for datafile  3 to
set newname for datafile  4 to
    duplicate target database for standby dorecover nofilenamecheck ;

9.Start the mrp

SQL> alter database open read only;

SQL> alter database recover managed standby database using current logfile disconnect;

10.Verify MRP is running:

ps -ef | grep mrp

11.Check applied status in secondary

SQL> select count(*) from v$archived_log where applied='NO';

hits count
Database | Oracle PartnerNetwork Blog