Forgot your password?    
+ Reply to Thread
Results 1 to 3 of 3

Thread: Create and configure physical Standby Database 10g PART II

  1. #1
    Expert Oracle Administrator
    Join Date
    Oct 2011
    Posts
    120

    Create and configure physical Standby Database 10g PART II

    Continued From : Create-and-configure-physical-Standby-Database-10g-PART-I

    Configure the Standby Database
    This section contains the steps used to create, mount, and start Redo Apply services for the physical standby database.

    1. Create the Standby Password File
    Create the password file on the standby database using the following steps:
    [oracle@vmlinux2 ~]$ cd $ORACLE_HOME/dbs
    [oracle@vmlinux2 dbs]$ orapwd file=orapwstby password=MySysPassword

    2. Create an spfile for the Standby Instance
    [oracle@vmlinux2 ~]$ sqlplus / as sysdba
    SQL> create spfile from pfile='/u04/oracle/dg_staging/initstby.ora';
    File created.
    SQL> !ls -l $ORACLE_HOME/dbs
    total 12
    -rw-r----- 1 oracle oinstall 1536 Dec 8 22:20 orapwstby
    -rw-r----- 1 oracle oinstall 4608 Dec 8 22:20 spfilestby.ora

    3. Create and Start the Standby Instance
    Start by creating the "dump directories" on the standby host as referenced in the standby initialization parameter file:
    [oracle@vmlinux2 ~]$ mkdir -p /u01/app/oracle/admin/stby/adump
    [oracle@vmlinux2 ~]$ mkdir -p /u01/app/oracle/admin/stby/bdump
    [oracle@vmlinux2 ~]$ mkdir -p /u01/app/oracle/admin/stby/cdump
    [oracle@vmlinux2 ~]$ mkdir -p /u01/app/oracle/admin/stby/dpdump
    [oracle@vmlinux2 ~]$ mkdir -p /u01/app/oracle/admin/stby/pfile
    [oracle@vmlinux2 ~]$ mkdir -p /u01/app/oracle/admin/stby/scripts
    [oracle@vmlinux2 ~]$ mkdir -p /u01/app/oracle/admin/stby/udump
    Next, create and verify all directories on the standby host that will be used for database files and the Flash Recovery Area:
    [oracle@vmlinux2 ~]$ mkdir -p /u02/oradata/STBY/controlfile
    [oracle@vmlinux2 ~]$ mkdir -p /u02/oradata/STBY/datafile
    [oracle@vmlinux2 ~]$ mkdir -p /u02/oradata/STBY/onlinelog
    [oracle@vmlinux2 ~]$ mkdir -p /u03/flash_recovery_area/STBY/archivelog
    [oracle@vmlinux2 ~]$ mkdir -p /u03/flash_recovery_area/STBY/autobackup
    [oracle@vmlinux2 ~]$ mkdir -p /u03/flash_recovery_area/STBY/backupset
    [oracle@vmlinux2 ~]$ mkdir -p /u03/flash_recovery_area/STBY/controlfile
    [oracle@vmlinux2 ~]$ mkdir -p /u03/flash_recovery_area/STBY/onlinelog
    After verifying the appropriate environment variables are set on the standby host ($ORACLE_SID, $ORACLE_HOME, $PATH, $LD_LIBRARY_PATH), start the physical standby instance:

    [oracle@vmlinux2 ~]$ echo $ORACLE_SID
    stby

    [oracle@vmlinux2 ~]$ sqlplus / as sysdba
    SQL> startup nomount

    4. Create the Physical Standby Database
    From the standby host where the standby instance was just started, duplicate the primary database as a standby using RMAN:

    [oracle@vmlinux2 ~]$ rman target sys/MySysPassword@prod auxiliary sys/MySysPassword@stby
    RMAN> duplicate target database for standby;
    RMAN> exit
    The RMAN duplicate process above will read the backupset that was transferred to the staging directory, clone the standby controlfile, mount the database on the new standby controlfile, and restore the physical database files.

    5. Start Redo Apply on the Standby Database
    Now that the standby is in place, start Redo Apply on the standby database by putting it in managed recovery mode.
    SQL> alter database recover managed standby database disconnect;
    To use Real Time Apply, run the following alternate version of the alter database command to place the standby database in managed recovery mode:
    SQL> alter database recover managed standby database using current logfile disconnect;
    NOTE:To use real time apply standby logfile is mandatory.

    Start Remote Archiving
    With the standby database now in managed recovery mode, the next and final phase is to start shipping redo data to the standby from the primary.
    SQL> alter system set log_archive_dest_state_2=enable scope=both;
    System altered.
    To force the current redo logs to be archived immediately, use the following statement on the primary database:
    SQL> alter system archive log current;
    System altered.
    At this point, the standby database will continue to apply changes from archive redo logs being transferred from the primary.

    Redo Transport
    From the primary database, perform a log switch and then verify the transmissions of the archive redo log file was successful:

    SQL> alter system switch logfile;
    SQL> select status, error from v$archive_dest where dest_id = 2;
    STATUS ERROR
    --------- ---------------------------------------------------------
    VALID

    If the transmission was successful, the status of the destination will be VALID as shown above. If for any reason the transmission was unsuccessful, the status will be INVALID and the full text of the error message will be populated in the ERROR column which can be used to investigate and correct the issue.

    Redo Apply
    First, identify the existing archived redo redo logs on the standby database:
    [oracle@vmlinux2 ~]$ sqlplus sys/MySysPassword@stby as sysdba
    SQL> alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS';
    SQL> select sequence#, first_time, next_time, archived, applied from v$archived_log order by sequence#;

    From the primary database, archive the current log using the following SQL statement:
    SQL> alter system archive log current;
    Go back to the standby database and re-query the V$ARCHIVED_LOG view to verify redo data was shipped, received, archived, and applied:
    SQL> select sequence#, first_time, next_time, archived, applied from v$archived_log order by sequence#;
    Last edited by Hemant; 01-15-2012 at 09:43 PM.

  2. #2
    Oracle DBA
    Join Date
    Oct 2011
    Posts
    17
    Both part are very good. Very comprehensive explanation of standby.

  3. #3
    Oracle DBA
    Join Date
    Sep 2012
    Posts
    1

    Excellent learning this way!

    [Really, steps are self explanatory. It prooves how Theory can be so EASY!]

+ Reply to Thread

Similar Threads

  1. Oracle 10g Using RMAN to Roll Forward a Physical Standby Database.
    By ajaychandi in forum DataGuard Setup and Management
    Replies: 0
    Last Post: 01-25-2012, 02:56 PM
  2. Oracle 10g Enable Read Write On Physical Standby Database.
    By ajaychandi in forum DataGuard Setup and Management
    Replies: 0
    Last Post: 01-25-2012, 02:45 PM
  3. Create and configure physical Standby Database 10g PART I
    By mdmasood in forum DataGuard Setup and Management
    Replies: 2
    Last Post: 01-18-2012, 05:04 PM
  4. Create and configure logical Standby Database 10g PART I
    By mdmasood in forum DataGuard Setup and Management
    Replies: 1
    Last Post: 11-03-2011, 06:30 PM
  5. Create and configure logical Standby Database 10g PART II
    By mdmasood in forum DataGuard Setup and Management
    Replies: 0
    Last Post: 11-03-2011, 05:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

DBA Lounge (P) Ltd. deals in Oracle Technologies on Consulting, Resourcing, Corporate Training


Online and corporate training available on Oracle Database 11g, Oracle 11g Real Application Cluster (RAC), Oracle Applications 11i/R12, Oracle Fusion Middleware 11g, Oracle Identity Management-OIM, Oracle Internet Directory 11g-OID, Oracle Business Intelligence Enterprise Edition-OBIEE, Oracle Golden Gate, Oracle Access Management-OAM, Oracle Internet Directory-ODS, Oracle Identity Analytics Architecture-OIA Statistics