In sweet memories of my ever loving brother "kutty thambi " ARUN KUMAR

Saturday, January 30, 2010

Error: ORA-16825: Fast-Start Failover and other errors or warnings detected for the database

ORA-16795:

database resource guard detects that database re-creation is required

ORA-16825:

Fast-Start Failover and other errors or warnings detected for the database

ORA-16817:

unsynchronized Fast-Start Failover configuration

solution:

DGMGRL> show database rajesh

Database
  Name:            rajesh
  Role:            PRIMARY
  Enabled:         YES
  Intended State:  ONLINE
  Instance(s):
    rajesh

Current status for "rajesh":
Error: ORA-16825: Fast-Start Failover and other errors or warnings detected for the database


DGMGRL> show database jeyanthi

Database
  Name:            jeyanthi
  Role:            PHYSICAL STANDBY
  Enabled:         NO
  Intended State:  ONLINE
  Instance(s):
    jeyanthi

Current status for "jeyanthi":
Error: ORA-16661: the standby database needs to be reinstated



DGMGRL> reinstate database jeyanthi;
Reinstating database "jeyanthi", please wait...
Operation requires shutdown of instance "jeyanthi" on database "jeyanthi"
Shutting down instance "jeyanthi"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "jeyanthi" on database "jeyanthi"
Starting instance "jeyanthi"...
ORACLE instance started.
Database mounted.
Continuing to reinstate database "jeyanthi" ...
Reinstatement of database "jeyanthi" succeeded
DGMGRL> show configuration verbose;

Configuration
  Name:                jeyanthi
  Enabled:             YES
  Protection Mode:     MaxAvailability
  Fast-Start Failover: ENABLED
  Databases:
    jeyanthi - Physical standby database
             - Fast-Start Failover target
    rajesh   - Primary database

Fast-Start Failover
  Threshold: 30 seconds
  Observer:  rac3

Current status for "jeyanthi":
Warning: ORA-16607: one or more databases have failed

then,
stop and start the observer.(start from another machine)
DGMGRL> stop observer
Done.
DGMGRL> connect sys/oracle@jeyanthi
Connected.
DGMGRL> start observer
Observer started


DGMGRL> show configuration verbose

Configuration
  Name:                jeyanthi
  Enabled:             YES
  Protection Mode:     MaxAvailability
  Fast-Start Failover: ENABLED
  Databases:
    jeyanthi - Physical standby database
             - Fast-Start Failover target
    rajesh   - Primary database

Fast-Start Failover
  Threshold: 30 seconds
  Observer:  rac2

Current status for "jeyanthi":
SUCCESS

regards,
rajeshkumar g

Wednesday, January 27, 2010

Configuration of 10g Data Guard Broker and Observer for Switchover

 Configuring Data Guard Broker for Switchover, General Review.

 On a previous document, 10g Data Guard, Physical Standby Creation, step by step I did describe how to implement a Data Guard
configuration; on this document I'm adding how to configure the broker and observer, setup the database to Maximum Availability and
managing switchover from Data Guard Manager, DGMGRL.
Data Guard Broker permit to manage a Data Guard Configuration, from both the Enterprise Manager Grid Control console, or from a
terminal in command line mode. In this document I will explore command line mode.
Pre requisites include the use of 10g Oracle server, using spfile on both the primary and standby and a third server for the Observer,
and configure the listeners to include a service for the Data Guard Broker.

The Enviroment
     • 2 Linux servers, Oracle Distribution 2.6.9-55 EL i686 i386 GNU/Linux, the Primary and Standby databases are located on these
       servers.
     • 1 Linux server, RH Linux 2.6.9-42.ELsmp x86_64 GNU/Linux, The Data Guard Broker Observer is located on this server
     • Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
       ssh is configured for user oracle on both nodes
     • Oracle Home is on identical path on both nodes
     • Primary database ANTONY  
     • Standby database JOHN

 Step by Step Implementation of Data Guard Broker
Enable Data Guard Broker Start on the Primary and Standby databases
    SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;
    System altered.
Setup the Local_Listener parameter on both the Primary and Standby databases
    SQL> ALTER SYSTEM SET LOCAL_LISTENER='LISTENER_VMRACTEST' SCOPE=BOTH;
    System altered.
Setup the tnsnames to enable communication with both the Primary and Standby databases
The listener.ora should include a service named global_db_nameDGMGRL to enable the broker to start the databases on the event of
switchover. This configuration needs to be included on both servers.
Listener.ora on Node 1
    LISTENER_VMRACTEST =
     (DESCRIPTION_LIST =
       (DESCRIPTION =
         (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521)(IP = FIRST))
       )
     )
    SID_LIST_LISTENER_VMRACTEST =
     (SID_LIST =
       (SID_DESC =
         (GLOBAL_DBNAME = antony)
         (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1  )
         (SID_NAME = antony)
       )
       (SID_DESC =
         (SID_NAME= antony)
         (GLOBAL_DBNAME = antony_DGMGRL)
         (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 )
       )
     )
Listener.ora on Node 2
   LISTENER_VMRACTEST =
     (DESCRIPTION_LIST =
       (DESCRIPTION =
         (ADDRESS = (PROTOCOL = TCP)(HOST = rac2.localdomain)(PORT = 1521)(IP = FIRST))
       )
     )
    SID_LIST_LISTENER_VMRACTEST =
     (SID_LIST =
       (SID_DESC =
         (GLOBAL_DBNAME = john)
         (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1  )
         (SID_NAME = john)
       )
       (SID_DESC =
         (SID_NAME= john)
         (GLOBAL_DBNAME = john_DGMGRL)
         (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1 )
       )
     )
Tnsnames.ora on Node 1, 2 and the observer node
   ANTONY =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521))
      (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = antony_DGMGRL)
      )
    )
   JOHN =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST =  rac2.localdomain)(PORT = 1521))
      (CONNECT_DATA =
        (SERVER = DEDICATED)
        (SERVICE_NAME = john_DGMGRL)
      )
 )
Setup the Broker configuration files
   The broker configuration files are automatically created when the broker is started using ALTER SYSTEM SET
   DG_BROKER_START=TRUE.
   The default destination can be modified using the parameters DG_BROKER_CONFIG_FILE1 and DG_BROKER_CONFIG_FILE2
On Primary:
SQL>SHOW PARAMETERS DG_BROKER_CONFIG

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1               string      /u01/app/oracle/product/10.2.0
                                                 /db_1/dbs/dr1antony.dat
dg_broker_config_file2               string      /u01/app/oracle/product/10.2.0
                                                 /db_1/dbs/dr2antony.dat

On standby:
SQL> SHOW PARAMETERS DG_BROKER_CONFIG

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1               string      /u01/app/oracle/product/10.2.0
                                                 /db_1/dbs/dr1john.dat
dg_broker_config_file2               string      /u01/app/oracle/product/10.2.0
                                                 /db_1/dbs/dr2john.dat

Next create from within the DGMGRL the configuration
[oracle@rac1 ~]$ dgmgrl
DGMGRL for Linux: Version 10.2.0.1.0 - Production

Copyright (c) 2000, 2005, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@antony
Connected.
DGMGRL> create configuration ANTONY AS
> PRIMARY DATABASE IS antony
> CONNECT IDENTIFIER IS antony;

Configuration "antony" created with primary database "antony"


Add the standby to the configuration and check it

DGMGRL> ADD DATABASE john AS
> CONNECT IDENTIFIER IS john
> MAINTAINED AS PHYSICAL;
Database "john" added

DGMGRL> SHOW CONFIGURATION;

Configuration
  Name:                antony
  Enabled:             NO
  Protection Mode:     MaxPerformance
  Fast-Start Failover: DISABLED
  Databases:
    antony - Primary database
    john   - Physical standby database

Current status for "antony":
DISABLED

DGMGRL> SHOW DATABASE VERBOSE john;

Database
  Name:            john
  Role:            PHYSICAL STANDBY
  Enabled:         NO
  Intended State:  OFFLINE
  Instance(s):
    john

  Properties:
    InitialConnectIdentifier        = 'john'
    LogXptMode                      = 'ARCH'
    Dependency                      = ''
    DelayMins                       = '0'
    Binding                         = 'OPTIONAL'
    MaxFailure                      = '0'
    MaxConnections                  = '1'
    ReopenSecs                      = '300'
    NetTimeout                      = '180'
    LogShipping                     = 'ON'
    PreferredApplyInstance          = ''
    ApplyInstanceTimeout            = '0'
    ApplyParallel                   = 'AUTO'
    StandbyFileManagement           = 'auto'
    ArchiveLagTarget                = '0'
    LogArchiveMaxProcesses          = '30'
    LogArchiveMinSucceedDest        = '1'
    DbFileNameConvert               = '/u01/app/oracle/oradata/antony/, /u01/app /oracle/oradata/john/'
    LogFileNameConvert              = '/u01/app/oracle/oradata/antony/, /u01/app /oracle/oradata/john/'
    FastStartFailoverTarget         = ''
    StatusReport                    = '(monitor)'
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    SendQEntries                    = '(monitor)'
    LogXptStatus                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    HostName                        = 'rac2'
    SidName                         = 'john'
    LocalListenerAddress            = '(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdo main)(PORT=1521))'
    StandbyArchiveLocation          = '/u01/app/oracle/oradata/john/arch/'
    AlternateLocation               = ''
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = '%t_%s_%r.arc'
    LatestLog                       = '(monitor)'
    TopWaitEvents                   = '(monitor)'

Current status for "john":
DISABLED

DGMGRL> show database verbose antony;

Database
  Name:            antony
  Role:            PRIMARY
  Enabled:         NO
  Intended State:  OFFLINE
  Instance(s):
    antony

  Properties:
    InitialConnectIdentifier        = 'antony'
    LogXptMode                      = 'ASYNC'
    Dependency                      = ''
    DelayMins                       = '0'
    Binding                         = 'OPTIONAL'
    MaxFailure                      = '0'
    MaxConnections                  = '1'
    ReopenSecs                      = '300'
    NetTimeout                      = '180'
    LogShipping                     = 'ON'
    PreferredApplyInstance          = ''
    ApplyInstanceTimeout            = '0'
    ApplyParallel                   = 'AUTO'
    StandbyFileManagement           = 'auto'
    ArchiveLagTarget                = '0'
    LogArchiveMaxProcesses          = '30'
    LogArchiveMinSucceedDest        = '1'
    DbFileNameConvert               = '/u01/app/oracle/oradata/john/, /u01/app/o racle/oradata/antony/'
    LogFileNameConvert              = '/u01/app/oracle/oradata/john/, /u01/app/o racle/oradata/antony/'
    FastStartFailoverTarget         = ''
    StatusReport                    = '(monitor)'
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    SendQEntries                    = '(monitor)'
    LogXptStatus                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    HostName                        = 'rac1'
    SidName                         = 'antony'
    LocalListenerAddress            = '(ADDRESS=(PROTOCOL=TCP)(HOST=rac1.localdo main)(PORT=1521))'
    StandbyArchiveLocation          = '/u01/app/oracle/oradata/antony/arch/'
    AlternateLocation               = ''
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = '%t_%s_%r.arc'
    LatestLog                       = '(monitor)'
    TopWaitEvents                   = '(monitor)'

Current status for "antony":
DISABLED

DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;

Configuration
  Name:                antony
  Enabled:             YES
  Protection Mode:     MaxPerformance
  Fast-Start Failover: DISABLED
  Databases:
    antony - Primary database
    john   - Physical standby database

Current status for "antony":
SUCCESS

DGMGRL> enable database john;
Enabled.
DGMGRL> SHOW DATABASE VERBOSE john;

Database
  Name:            john
  Role:            PHYSICAL STANDBY
  Enabled:         YES
  Intended State:  ONLINE
  Instance(s):
    john

  Properties:
    InitialConnectIdentifier        = 'john'
    LogXptMode                      = 'ARCH'
    Dependency                      = ''
    DelayMins                       = '0'
    Binding                         = 'OPTIONAL'
    MaxFailure                      = '0'
    MaxConnections                  = '1'
    ReopenSecs                      = '300'
    NetTimeout                      = '180'
    LogShipping                     = 'ON'
    PreferredApplyInstance          = ''
    ApplyInstanceTimeout            = '0'
    ApplyParallel                   = 'AUTO'
    StandbyFileManagement           = 'auto'
    ArchiveLagTarget                = '0'
    LogArchiveMaxProcesses          = '30'
    LogArchiveMinSucceedDest        = '1'
    DbFileNameConvert               = '/u01/app/oracle/oradata/antony/, /u01/app/oracle/oradata/john/'
    LogFileNameConvert              = '/u01/app/oracle/oradata/antony/, /u01/app/oracle/oradata/john/'
    FastStartFailoverTarget         = ''
    StatusReport                    = '(monitor)'
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    SendQEntries                    = '(monitor)'
    LogXptStatus                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    HostName                        = 'rac2'
    SidName                         = 'john'
    LocalListenerAddress            = '(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)(PORT=1521))'
    StandbyArchiveLocation          = '/u01/app/oracle/oradata/john/arch/'
    AlternateLocation               = ''
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = '%t_%s_%r.arc'
    LatestLog                       = '(monitor)'
    TopWaitEvents                   = '(monitor)'

Current status for "john":
SUCCESS

Enabling the configuration and databases
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;

Configuration
  Name:                antony
  Enabled:             YES
  Protection Mode:     MaxPerformance
  Fast-Start Failover: DISABLED
  Databases:
    antony - Primary database
    john   - Physical standby database

Current status for "antony":
SUCCESS

DGMGRL> enable database john;
Enabled.
DGMGRL> SHOW DATABASE VERBOSE john;

Database
  Name:            john
  Role:            PHYSICAL STANDBY
  Enabled:         YES
  Intended State:  ONLINE
  Instance(s):
    john

  Properties:
    InitialConnectIdentifier        = 'john'
    LogXptMode                      = 'ARCH'
    Dependency                      = ''
    DelayMins                       = '0'
    Binding                         = 'OPTIONAL'
    MaxFailure                      = '0'
    MaxConnections                  = '1'
    ReopenSecs                      = '300'
    NetTimeout                      = '180'
    LogShipping                     = 'ON'
    PreferredApplyInstance          = ''
    ApplyInstanceTimeout            = '0'
    ApplyParallel                   = 'AUTO'
    StandbyFileManagement           = 'auto'
    ArchiveLagTarget                = '0'
    LogArchiveMaxProcesses          = '30'
    LogArchiveMinSucceedDest        = '1'
    DbFileNameConvert               = '/u01/app/oracle/oradata/antony/, /u01/app/oracle/oradata/john/'
    LogFileNameConvert              = '/u01/app/oracle/oradata/antony/, /u01/app/oracle/oradata/john/'
    FastStartFailoverTarget         = ''
    StatusReport                    = '(monitor)'
    InconsistentProperties          = '(monitor)'
    InconsistentLogXptProps         = '(monitor)'
    SendQEntries                    = '(monitor)'
    LogXptStatus                    = '(monitor)'
    RecvQEntries                    = '(monitor)'
    HostName                        = 'rac2'
    SidName                         = 'john'
    LocalListenerAddress            = '(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)(PORT=1521))'
    StandbyArchiveLocation          = '/u01/app/oracle/oradata/john/arch/'
    AlternateLocation               = ''
    LogArchiveTrace                 = '0'
    LogArchiveFormat                = '%t_%s_%r.arc'
    LatestLog                       = '(monitor)'
    TopWaitEvents                   = '(monitor)'

Current status for "john":
SUCCESS

Enabling Fast Start Failover and the Observer

These are the steps required to enable and check Fast Start Failover and the Observer:
1. Ensure standby redologs are configured on all databases.
on primary:
SQL> SELECT TYPE,MEMBER FROM V$LOGFILE;

TYPE    MEMBER
------- --------------------------------------------------
ONLINE  /u01/app/oracle/oradata/antony/redo03.log
ONLINE  /u01/app/oracle/oradata/antony/redo02.log
ONLINE  /u01/app/oracle/oradata/antony/redo01.log
STANDBY /u01/app/oracle/oradata/antony/redoby04.log
STANDBY /u01/app/oracle/oradata/antony/redoby05.log
STANDBY /u01/app/oracle/oradata/antony/redoby06.log

On standby:

SQL> SELECT TYPE,MEMBER FROM V$LOGFILE;

TYPE       MEMBER
---------- --------------------------------------------------
ONLINE     /u01/app/oracle/oradata/john/redo03.log
ONLINE     /u01/app/oracle/oradata/john/redo02.log
ONLINE     /u01/app/oracle/oradata/john/redo01.log
STANDBY    /u01/app/oracle/oradata/john/redoby04.log
STANDBY    /u01/app/oracle/oradata/john/redoby05.log
STANDBY    /u01/app/oracle/oradata/john/redoby06.log

2. Ensure the LogXptMode Property is set to SYNC.
Note: These commands will succeed only if database is configured with standby redo logs.
DGMGRL> EDIT DATABASE antony SET PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
DGMGRL> EDIT DATABASE john SET PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated

3.Specify the FastStartFailoverTarget property

DGMGRL> EDIT DATABASE antony SET PROPERTY FastStartFailoverTarget='john';
Property "faststartfailovertarget" updated
DGMGRL> EDIT DATABASE john SET PROPERTY FastStartFailoverTarget='antony';
Property "faststartfailovertarget" updated

4.Upgrade the protection mode to MAXAVAILABILITY, if necessary.

DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Operation requires shutdown of instance "antony" on database "antony"
Shutting down instance "antony"...
Database closed.
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "antony" on database "antony"
Starting instance "antony"...
ORACLE instance started.
Database mounted.

note: if ORA-12514: TNS:listener does not currently know of service requested in connect descriptor Failed.
You are no longer connected to ORACLE
Please connect again.
you must start instance (primary database) manually
SQL> conn / as sysdba
SQL> startup mount;

5. Enable Flashback Database on the Primary and Standby Databases.
 On Both databases
 
To enter the standby into Flashback mode you must shutdown the both databases, then while the primary is down execute the
 following commands on the standby:
   SQL> ALTER SYSTEM SET UNDO_RETENTION=3600 SCOPE=SPFILE;
   System altered.
   SQL> ALTER SYSTEM SET UNDO_MANAGEMENT='AUTO' SCOPE=SPFILE;
   System altered.
   SQL> startup mount;

SQL> ALTER DATABASE FLASHBACK ON;

Enable fast start failover

[oracle@rac1 ~]$ dgmgrl
DGMGRL for Linux: Version 10.2.0.1.0 - Production

Copyright (c) 2000, 2005, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@antony;
Connected.
DGMGRL> show configuration verbose;

Configuration
  Name:                antony
  Enabled:             YES
  Protection Mode:     MaxAvailability
  Fast-Start Failover: DISABLED
  Databases:
    antony - Primary database
    john   - Physical standby database

Current status for "antony":
SUCCESS

DGMGRL> show database john;

Database
  Name:            john
  Role:            PHYSICAL STANDBY
  Enabled:         YES
  Intended State:  ONLINE
  Instance(s):
    john

Current status for "john":
SUCCESS

DGMGRL> ENABLE FAST_START FAILOVER;
Enabled.
start the observer
Start the observer from a third server on background. You may use a script like this:
---------------- script start on next line --------------------
#!/bin/ksh
# startobserver
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export BASE_PATH=/u01/app/oracle/oracle/scripts/general:/opt/CTEact/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/bin:/etc:/usr/local/maint/oracle:/usr/ccs/bin:/usr/openwin/bin:/usr/dt/bin:/usr/local/bin:.
export PATH=$ORACLE_HOME/bin:$BASE_PATH
dgmgrl << eof
connect sys/oracle@antony
START OBSERVER;
eof
---------------- script end on previous line --------------------
[oracle@rac3 ~]$ nohup ./startobserver &
nohup: appending output to `nohup.out'
[1] 27392
Verify the fast-start failover configuration.
[oracle@rac3 ~]$ dgmgrl
DGMGRL for Linux: Version 10.2.0.1.0 - Production

Copyright (c) 2000, 2005, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@antony
Connected.
DGMGRL> show configuration verbose

Configuration
  Name:                antony
  Enabled:             YES
  Protection Mode:     MaxAvailability
  Fast-Start Failover: ENABLED
  Databases:
    antony - Primary database
    john   - Physical standby database
           - Fast-Start Failover target

Fast-Start Failover
  Threshold: 30 seconds
  Observer:  rac1

Current status for "antony":
SUCCESS

Check that primary and standby are healthy
This check must return 'SUCCESS' as the status for both databases, otherwise it means there is a configuration
problem.
DGMGRL> show database antony

Database
  Name:            antony
  Role:            PRIMARY
  Enabled:         YES
  Intended State:  ONLINE
  Instance(s):
    antony

Current status for "antony":
SUCCESS

DGMGRL> show database john

Database
  Name:            john
  Role:            PHYSICAL STANDBY
  Enabled:         YES
  Intended State:  ONLINE
  Instance(s):
    john

Current status for "john":
SUCCESS

DGMGRL>

EXECUTE THE SWITCHOVER:

 DGMGRL> SWITCHOVER TO john;
Performing switchover NOW, please wait...
Operation requires shutdown of instance "antony" on database "antony"
Shutting down instance "antony"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires shutdown of instance "john" on database "john"
Shutting down instance "john"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "antony" on database "antony"
Starting instance "antony"...
ORACLE instance started.
Database mounted.
Operation requires startup of instance "john" on database "john"
Starting instance "john"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "john"
DGMGRL>


DGMGRL> show configuration verbose

Configuration
  Name:                antony
  Enabled:             YES
  Protection Mode:     MaxAvailability
  Fast-Start Failover: ENABLED
  Databases:
    antony - Physical standby database
           - Fast-Start Failover target
    john   - Primary database

Fast-Start Failover
  Threshold: 30 seconds
  Observer:  rac1

Current status for "antony":
SUCCESS

DGMGRL> show database john

Database
  Name:            john
  Role:            PRIMARY
  Enabled:         YES
  Intended State:  ONLINE
  Instance(s):
    john

Current status for "john":
SUCCESS

DGMGRL> show database antony

Database
  Name:            antony
  Role:            PHYSICAL STANDBY
  Enabled:         YES
  Intended State:  ONLINE
  Instance(s):
    antony

Current status for "antony":
SUCCESS

Reference:
Oracle® Data Guard Concepts and Administration
10g Release 2 (10.2)
Part Number B14239-04
http://download.oracle.com/docs/cd/B19306_01/server.102/b14230/cli.htm#BGBFEAFG

Monday, January 25, 2010

fast-start failover DATAGUARD BROKER

here is an example to check the fast start failover in dataguard environment
i manually killed the mandatory background process smon of primary database.
then the observer automatically initiate the standby database to primary database, and reinstate the old primary database to standby.


here, primary database name: whiteowl
physical standby database name: blackowl

observer name: observer

from primary database machine rac1:
[oracle@rac1 ~]$ ps -eaf | grep smon
oracle   17328     1  0 12:25 ?        00:00:00 ora_smon_whiteowl
oracle   17886 17865  0 12:34 pts/4    00:00:00 grep smon
[oracle@rac1 ~]$ kill -9 17428

startup the primary database in mount stage.

DGMGRL> show configuration verbose;

Configuration
  Name:                whiteowl
  Enabled:             YES
  Protection Mode:     MaxAvailability
  Fast-Start Failover: ENABLED
  Databases:
    whiteowl - Physical standby database (disabled)
             - Fast-Start Failover target
    blackowl - Primary database

Fast-Start Failover
  Threshold: 30 seconds
  Observer:  rac1

Current status for "whiteowl":
Warning: ORA-16608: one or more databases have warnings


DGMGRL> show site verbose 'blackowl';
Site
  Name:                          'blackowl'
  Hostname:                      'rac2'
  Instance name:                 'blackowl'
  Service Name:                  'blackowl'
  Standby Type:                  'physical'
  Enabled:                       'yes'
  Required:                      'yes'
  Default state:                 'PRIMARY'
  Intended state:                'PRIMARY'
  PFILE:                         ''
  Number of resources:  1
  Resources:
    Name: blackowl (default) (verbose name='blackowl')
Current status for "blackowl":
Warning: ORA-16817: unsynchronized Fast-Start Failover configuration

DGMGRL> show site verbose 'whiteowl';
Site
  Name:                          'whiteowl'
  Hostname:                      'rac1'
  Instance name:                 'whiteowl'
  Service Name:                  'whiteowl'
  Standby Type:                  'physical'
  Enabled:                       'yes'
  Required:                      'yes'
  Default state:                 'STANDBY'
  Intended state:                'STANDBY'
  PFILE:                         ''
  Number of resources:  1
  Resources:
    Name: whiteowl (default) (verbose name='whiteowl')
Current status for "whiteowl":
Warning: ORA-16817: unsynchronized Fast-Start Failover configuration


on observer: machine rac3

12:19:20.23  Monday, January 25, 2010
Initiating fast-start failover to database "blackowl"...
Performing failover NOW, please wait...
Failover succeeded, new primary is "blackowl"
12:19:51.84  Monday, January 25, 2010

12:24:33.93  Monday, January 25, 2010
Initiating reinstatement for database "whiteowl"...
Reinstating database "whiteowl", please wait...
Operation requires shutdown of instance "whiteowl" on database "whiteowl"
Shutting down instance "whiteowl"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "whiteowl" on database "whiteowl"
Starting instance "whiteowl"...
ORACLE instance started.
Database mounted.
Continuing to reinstate database "whiteowl" ...
Reinstatement of database "whiteowl" succeeded
12:26:02.89  Monday, January 25, 2010

then check,
DGMGRL> show configuration verbose;

Configuration
  Name:                whiteowl
  Enabled:             YES
  Protection Mode:     MaxAvailability
  Fast-Start Failover: ENABLED
  Databases:
    whiteowl - Physical standby database
             - Fast-Start Failover target
    blackowl - Primary database

Fast-Start Failover
  Threshold: 30 seconds
  Observer:  rac1

Current status for "whiteowl":
SUCCESS

regards,
rajeshkumar

Thursday, January 21, 2010

Data Guard errors and solution- i faced

today i started the primary and standby database, i got this error message in primary database
ORA-16649: database will open after Data Guard broker has evaluated Fast-Start Failover status

after connecting with the observer, i gave show configuration verbose command and show database verbose 'whiteowl' command, it showed the below error message.
note: here my database name whiteowl

ORA-16820:

Fast-Start Failover observer is no longer observing this database
Cause: A previously started observer was no longer actively observing this database. A significant amount of time elapsed since this database last heard from the observer. Possible reasons were: - The node where the observer was running was not available.
- The network connection between the observer and this database was not available.
- Observer process was terminated unexpectedly.

Action: Check the reason why the observer cannot contact this database. If the problem cannot be corrected, stop the current observer by connecting to the Data Guard configuration and issue the DGMGRL "STOP OBSERVER" command. Then restart the observer on another node. You may use the DGMGRL "START OBSERVER" command to start the observer on the other node.
what i have done?

i checked the listeners, tnsnames.ora files and tnsping command in primary,standby, observer machines
and then as above mentioned i stop the observer and then start the observer from primary database machine.
now its working fine.
DGMGRL> show configuration verbose;

Configuration
  Name:                whiteowl
  Enabled:             YES
  Protection Mode:     MaxAvailability
  Fast-Start Failover: ENABLED
  Databases:
    whiteowl - Primary database
    blackowl - Physical standby database
             - Fast-Start Failover target

Fast-Start Failover
  Threshold: 30 seconds
  Observer:  rac1

Current status for "whiteowl":
SUCCESS

DGMGRL>

reference:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14230/sofo.htm#BCGHBJJI

Step by Step, document for creating Physical Standby Database, 10g DATA GUARD

10g Data Guard, Physical Standby Creation, step by step

primary database name:  white on rac2 machine

standby database name: black  on rac1 machine

Creating a Data Guard Physical Standby environment, General Review.
Manually setting up a Physical standby database is a simple task when all prerequisites and setup steps are carefully met and executed.
In this example I did use 2 hosts, that host a RAC database. All RAC preinstall requisites are then in place and no additional configuration was
necessary to implement Data Guard Physical Standby manually.

The Enviroment
     2 Linux servers, Oracle Distribution 2.6.9-55 EL i686 i386 GNU/Linux
     Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
     ssh is configured for user oracle on both nodes
     Oracle Home is on identical path on both nodes
Implementation notes:
     Once you have your primary database up and running these are the steps to follow:
     1.  Enable Forced Logging
     2.  Create a Password File
     3.  Configure a Standby Redo Log
     4.  Enable Archiving
     5.  Set Primary Database Initialization Parameters
     Having followed these steps to implement the Physical Standby you need to follow these steps:
     1. Create a Control File for the Standby Database
     2. Backup the Primary Database and transfer a copy to the Standby node.
     3. Prepare an Initialization Parameter File for the Standby Database
     4. Configure the listener and tnsnames to support the database on both nodes
     5. Set Up the Environment to Support the Standby Database on the standby node.
     6. Start the Physical Standby Database
     7. Verify the Physical Standby Database Is Performing Properly
Step by Step Implementation of a Physical Standby Environment
Primary Database Steps
Primary Database General View

SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     0
Current log sequence           1
SQL> select name from v$database;

NAME
---------
WHITE

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/white/system01.dbf
/u01/app/oracle/oradata/white/undotbs01.dbf
/u01/app/oracle/oradata/white/sysaux01.dbf
/u01/app/oracle/oradata/white/users01.dbf

SQL> show parameters unique

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      white
SQL>

Enable Forced Logging
  In order to implement Standby Database we enable 'Forced Logging'.
  This option ensures that even in the event that a 'nologging' operation is done, force logging takes precedence and all operations are logged
  into the redo logs.
  SQL> ALTER DATABASE FORCE LOGGING;
  Database altered.
Create a Password File
  A password file must be created on the Primary and copied over to the Standby site. The sys password must be identical on both sites. This is
  a key pre requisite in order to be able to ship and apply archived logs from Primary to Standby.

 [oracle@rac2 ~]$ cd $ORACLE_HOME/dbs
[oracle@rac2 dbs]$ orapwd file=orapwwhite password=oracle force=y

SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP
------------------------------ ----- -----
SYS                            TRUE  TRUE



Configure a Standby Redo Log
  A Standby Redo log is added to enable Data Guard Maximum Availability and Maximum Protection modes. It is important to configure the
  Standby Redo Logs (SRL) with the same size as the online redo logs.
  In this example I'm using Oracle Managed Files, that's why I don't need to provide the SRL path and file name. If you are not using OMF's
  you then must pass the full qualified name.
SQL> select group#,type,member from v$logfile;

    GROUP# TYPE    MEMBER
---------- ------- --------------------------------------------------
         3 ONLINE  /u01/app/oracle/oradata/white/redo03.log
         2 ONLINE  /u01/app/oracle/oradata/white/redo02.log
         1 ONLINE  /u01/app/oracle/oradata/white/redo01.log
SQL> select bytes from v$log;
     BYTES
----------
  52428800
  52428800
  52428800

SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 4
  2  '/u01/app/oracle/oradata/white/stby04.log' size 50m;

Database altered.

SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 5
  2  '/u01/app/oracle/oradata/white/stby05.log' size 50m;

Database altered.

SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 6
  2  '/u01/app/oracle/oradata/white/stby06.log' size 50m;

Database altered.

SQL> SELECT GROUP#,TYPE,MEMBER FROM V$LOGFILE;

    GROUP# TYPE    MEMBER
---------- ------- --------------------------------------------------
         3 ONLINE  /u01/app/oracle/oradata/white/redo03.log
         2 ONLINE  /u01/app/oracle/oradata/white/redo02.log
         1 ONLINE  /u01/app/oracle/oradata/white/redo01.log
         4 STANDBY /u01/app/oracle/oradata/white/stby04.log
         5 STANDBY /u01/app/oracle/oradata/white/stby05.log
         6 STANDBY /u01/app/oracle/oradata/white/stby06.log

6 rows selected.

Set Primary Database Initialization Parameters
  Data Guard must use spfile, in order to configure it we create and configure the standby parameters on a regular pfile, and once it is ready we
  convert it to an spfile.
  Several init.ora parameters control the behavior of a Data Guard environment. In this example the Primary database init.ora is configured so
  that it can hold both roles, as Primary or Standby.

SQL> CREATE PFILE FROM SPFILE;

File created.

(or)

SQL> CREATE PFILE='/tmp/initwhite.ora' from spfile;

File created.

Edit the pfile to add the standby parameters, here shown highlighted:

white.__db_cache_size=184549376
white.__java_pool_size=4194304
white.__large_pool_size=4194304
white.__shared_pool_size=88080384
white.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/white/adump'
*.background_dump_dest='/u01/app/oracle/admin/white/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/app/oracle/oradata/white/control01.ctl','/u01/app/oracle/oradata/white/control02.ctl','/u01/app/oracle/oradata/white/control03.ctl'
*.core_dump_dest='/u01/app/oracle/admin/white/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='white'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=whiteXDB)'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=285212672
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/white/udump'
db_unique_name='white'
LOG_ARCHIVE_CONFIG='DG_CONFIG=(white,black)'
LOG_ARCHIVE_DEST_1='LOCATION=/u01/app/oracle/oradata/white/arch/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=white'
LOG_ARCHIVE_DEST_2='SERVICE=black LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=black'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
#Standby role parameters------------------------------------------
fal_server=black
fal_client=white
standby_file_management=auto
db_file_name_convert='/u01/app/oracle/oradata/black/','/u01/app/oracle/oradata/white/'
log_file_name_convert='/u01/app/oracle/oradata/black/','/u01/app/oracle/oradata/white/'




Once the new parameter file is ready we create from it the spfile:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>  startup nomount pfile=/u01/app/oracle/product/10.2.0/db_1/dbs/initwhite.ora
ORA-16032: parameter LOG_ARCHIVE_DEST_1 destination string cannot be translated
ORA-07286: sksagdi: cannot obtain device information.
Linux Error: 2: No such file or directory
note: create a archive log destination(location) folder as per in parameter file and then startup the database.
SQL> startup nomount pfile=/u01/app/oracle/product/10.2.0/db_1/dbs/initwhite.ora
ORACLE instance started.

Total System Global Area  285212672 bytes
Fixed Size                  1218992 bytes
Variable Size              96470608 bytes
Database Buffers          184549376 bytes
Redo Buffers                2973696 bytes
SQL> create spfile from pfile;

File created.

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


ORACLE instance shut down.

Enable Archiving
  On 10g you can enable archive log mode by mounting the database and executing the archivelog command:
SQL> startup mount
ORACLE instance started.

Total System Global Area  285212672 bytes
Fixed Size                  1218992 bytes
Variable Size              96470608 bytes
Database Buffers          184549376 bytes
Redo Buffers                2973696 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/oradata/white/arch/
Oldest online log sequence     1
Next log sequence to archive   2
Current log sequence           2
SQL>

Standby Database Steps
Here, i am going to create standby database using backup of the primary database datafiles,redologs, controlfile by rman. compare with user managed backup, rman is comfortable and flexible method.

Create an RMAN backup which we will use later to create the standby:

[oracle@rac2 ~]$ . oraenv
ORACLE_SID = [oracle] ? white
[oracle@rac2 ~]$ rman target=/

Recovery Manager: Release 10.2.0.1.0 - Production on Wed Jan 20 18:41:51 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: WHITE (DBID=3603807872)

RMAN> backup full database format '/u01/app/oracle/backup/%d_%U.bckp' plus archivelog format '/u01/app/oracle/backup/%d_%U.bckp';

Next, create a standby controlfile backup via RMAN:
RMAN> configure channel device type disk format '/u01/app/oracle/backup/%U';

new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/u01/app/oracle/backup/%U';
new RMAN configuration parameters are successfully stored
released channel: ORA_DISK_1

RMAN> BACKUP CURRENT CONTROLFILE FOR STANDBY;

RMAN> BACKUP ARCHIVELOG ALL;


In this simple example, I am backing up the primary database to disk; therefore, I must make the backupsets available to the standby host if I want to use them as the basis for my duplicate operation:
[oracle@rac2 ~]$ cd /u01/app/oracle/backup
[oracle@rac2 backup]$ ls -lart
total 636080
drwxrwxr-x  9 oracle oinstall      4096 Jan 20 18:42 ..
-rw-r-----  1 oracle oinstall  50418176 Jan 20 18:43 WHITE_01l3v1uv_1_1.bckp
-rw-r-----  1 oracle oinstall 531472384 Jan 20 18:54 WHITE_02l3v203_1_1.bckp
-rw-r-----  1 oracle oinstall   7143424 Jan 20 18:54 WHITE_03l3v2jf_1_1.bckp
-rw-r-----  1 oracle oinstall   1346560 Jan 20 18:54 WHITE_04l3v2jv_1_1.bckp
-rw-r-----  1 oracle oinstall   7110656 Jan 20 19:19 05l3v41r_1_1
drwxr-xr-x  2 oracle oinstall      4096 Jan 20 19:20 .
-rw-r-----  1 oracle oinstall  53174272 Jan 20 19:21 06l3v448_1_1
[oracle@rac2 backup]$ scp * oracle@rac1:/u01/app/oracle/backup/
05l3v41r_1_1                                  100% 6944KB   6.8MB/s   00:00
06l3v448_1_1                                  100%   51MB  16.9MB/s   00:03
WHITE_01l3v1uv_1_1.bckp                       100%   48MB   2.7MB/s   00:18
WHITE_02l3v203_1_1.bckp                       100%  507MB   1.5MB/s   05:47
WHITE_03l3v2jf_1_1.bckp                       100% 6976KB 996.6KB/s   00:07
WHITE_04l3v2jv_1_1.bckp                       100% 1315KB   1.3MB/s   00:01

NOTE:
The primary and standby database location for backup folder must be same.
for eg: /u01/app/oracle/backup folder

On the standby node create the required directories to get the datafiles
mkdir -p /u01/app/oracle/oradata/black
mkdir -p /u01/app/oracle/oradata/black/arch
mkdir -p /u01/app/oracle/admin/black
mkdir -p /u01/app/oracle/admin/black/adump
mkdir -p /u01/app/oracle/admin/black/bdump
mkdir -p /u01/app/oracle/admin/black/udump
mkdir -p /u01/app/oracle/flash_recovery_area/WHITE
mkdir -p /u01/app/oracle/flash_recovery_area/WHITE/onlinelog

Prepare an Initialization Parameter File for the Standby Database

Copy from the primary pfile to the standby destination
[oracle@rac2 ~]$ cd /u01/app/oracle/product/10.2.0/db_1/dbs/
[oracle@rac2 dbs]$ scp initwhite.ora oracle@rac1:/tmp/initblack.ora
initwhite.ora                                 100% 1704     1.7KB/s   00:00

Copy and edit the primary init.ora to set it up for the standby role,as here shown highlighted:


black.__db_cache_size=188743680
black.__java_pool_size=4194304
black.__large_pool_size=4194304
black.__shared_pool_size=83886080
black.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/black/adump'
*.background_dump_dest='/u01/app/oracle/admin/black/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/app/oracle/oradata/black/control01.ctl','/u01/app/oracle/oradata/black/control02.ctl','/u01/app/oracle/oradata/black/control03.ctl'
*.core_dump_dest='/u01/app/oracle/admin/black/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_file_name_convert='/u01/app/oracle/oradata/white/','/u01/app/oracle/oradata/black/'
*.db_name='white'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.db_unique_name='black'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=blackXDB)'
*.fal_client='black'
*.fal_server='white'
*.job_queue_processes=10
*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(white,black)'
*.LOG_ARCHIVE_DEST_1='LOCATION=/u01/app/oracle/oradata/black/arch/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=black'
*.LOG_ARCHIVE_DEST_2='SERVICE=white LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=white'
*.LOG_ARCHIVE_DEST_STATE_1='ENABLE'
*.LOG_ARCHIVE_DEST_STATE_2='ENABLE'
*.LOG_ARCHIVE_FORMAT='%t_%s_%r.arc'
*.LOG_ARCHIVE_MAX_PROCESSES=30
*.log_file_name_convert='/u01/app/oracle/oradata/white/','/u01/app/oracle/oradata/black/'
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=285212672
*.standby_file_management='auto'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/app/oracle/admin/black/udump'

Configure the listener and tnsnames to support the database on both nodes
Configure listener.ora on both servers to hold entries for both databases
#on RAC2 Machine
LISTENER_VMRACTEST =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac2.localdomain)(PORT = 1521))
    )
  )

SID_LIST_LISTENER_VMRACTEST =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = white)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (SID_NAME = white)
    )
)


#on rac1 machine

LISTENER_VMRACTEST =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521))
    )
  )

SID_LIST_LISTENER_VMRACTEST =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = black)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (SID_NAME = black)
    )
)

Configure tnsnames.ora on both servers to hold entries for both databases
#on rac2 machine
LISTENER_VMRACTEST =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac2.localdomain)(PORT = 1521))
    )
  )

WHITE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = white)
    )
  )
BLACK =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = black)
    )
  )
#on rac1 machine
LISTENER_VMRACTEST =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521))
    )
  )
WHITE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac2.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = white)
    )
  )
BLACK =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = black)
    )
  )
Start the listener and check tnsping on both nodes to both services
#on machine rac1
[oracle@rac1 tmp]$ lsnrctl stop LISTENER_VMRACTEST

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 20-JAN-2010 23:59:41

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1.localdomain)(PORT=1521)))
The command completed successfully

[oracle@rac1 tmp]$ lsnrctl start LISTENER_VMRACTEST

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 21-JAN-2010 00:00:00

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener_vmractest.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1.localdomain)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_VMRACTEST
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                21-JAN-2010 00:00:00
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener_vmractest.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1.localdomain)(PORT=1521)))
Services Summary...
Service "black" has 1 instance(s).
  Instance "black", status UNKNOWN, has 1 handler(s) for this service...
Service "black_DGMGRL" has 1 instance(s).
  Instance "black", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

[oracle@rac1 tmp]$ tnsping black

TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 21-JAN-2010 00:00:21

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = black)))
OK (10 msec)

[oracle@rac1 tmp]$ tnsping white

TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 21-JAN-2010 00:00:29

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac2.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = white)))
OK (10 msec)


#on rac2 machine
[oracle@rac2 dbs]$ lsnrctl stop LISTENER_VMRACTEST

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 21-JAN-2010 00:22:48

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)(PORT=1 521)))
The command completed successfully

[oracle@rac2 dbs]$ lsnrctl start LISTENER_VMRACTEST

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 21-JAN-2010 00:23:08

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/liste ner.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener _vmractest.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2.localdomain)(PORT=1 521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac2.localdomain)(PORT=1 521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_VMRACTEST
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                21-JAN-2010 00:23:08
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/list ener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listen er_vmractest.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac2.localdomain)(PORT=1521)))
Services Summary...
Service "white" has 1 instance(s).
  Instance "white", status UNKNOWN, has 1 handler(s) for this service...
Service "white_DGMGRL" has 1 instance(s).
  Instance "white", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

[oracle@rac2 dbs]$ tnsping white

TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 21-JAN-2010 00:23 :14

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac2.loc aldomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = whi te)))
OK (0 msec)

[oracle@rac2 dbs]$ tnsping black

TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 21-JAN-2010 00:23 :18

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.loc aldomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bla ck)))
OK (10 msec)


Set Up the Environment to Support the Standby Database on the standby node.
Create a passwordfile for the standby:
[oracle@rac1 ~]$ orapwd file=$ORACLE_HOME/dbs/orapwblack password=oracle
note: sys password must be identical for both primary and standby database



Append an entry to oratab:

[oracle@rac1 ~]$ echo "black:/u01/app/oracle/product/10.2.0/db_1:N" >> /etc/oratab

Startup nomount the Standby database


Nomount the standby instance in preparation for the duplicate operation:
 Startup nomount the Standby database and generate an spfile

[oracle@rac1 ~]$ . oraenv
ORACLE_SID = [whiteowl] ? black
[oracle@rac1 ~]$ sqlplus '/as sysdba'

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jan 21 00:38:03 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.


SQL> startup nomount pfile='/tmp/initblack.ora'
ORACLE instance started.

Total System Global Area  285212672 bytes
Fixed Size                  1218992 bytes
Variable Size              92276304 bytes
Database Buffers          188743680 bytes
Redo Buffers                2973696 bytes

SQL> create spfile from pfile='/tmp/initblack.ora';

File created.

SQL> shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.


Total System Global Area  285212672 bytes
Fixed Size                  1218992 bytes
Variable Size              92276304 bytes
Database Buffers          188743680 bytes
Redo Buffers                2973696 bytes


Create the standby database using rman:
[oracle@rac1 ~]$ . oraenv
ORACLE_SID = [oracle] ? black
[oracle@rac1 ~]$ rman target=sys/oracle@white auxiliary=/

Recovery Manager: Release 10.2.0.1.0 - Production on Thu Jan 21 00:43:11 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: WHITE (DBID=3603807872)
connected to auxiliary database: WHITE (not mounted)

RMAN> DUPLICATE TARGET DATABASE FOR STANDBY NOFILENAMECHECK;

 Start the redo apply:

SQL> alter database recover managed standby database disconnect from session;

Test the configuration by generating archive logs from the primary and then querying the standby to see if the logs are being successfully applied.

On the Primary:

SQL> alter system switch logfile;
SQL> alter system archive log current;

 SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/oradata/white/arch/
Oldest online log sequence     8
Next log sequence to archive   10
Current log sequence           10

 On the Standby:
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/oradata/black/arch/
Oldest online log sequence     8
Next log sequence to archive   0
Current log sequence           10

SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG
  2  ORDER BY SEQUENCE#;
 
 Stop the managed recovery process on the standby:

SQL> alter database recover managed standby database cancel;
 
 Reference:
Oracle® Data Guard Concepts and Administration
10g Release 2 (10.2)
Part Number B14239-04
http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/create_ps.htm#SBYDB00210

 
free counters
 
Share/Bookmark