Tuesday 20 October 2015

Oracle RAC Interview Questions/Answers

Oracle RAC Interview Questions/Answers

1) What is the use of RAC?
Ans: Oracle RAC allows multiple computers to run Oracle RDBMS software simultaneously while accessing a single database, thus providing clustering.

2) What are Oracle CLusterware and Daemon Processes and what they do?
Ans: ocssd, crsd, evmd, oprocd, racgmain, racgimon

3) What are the special background processes for RAC (or) what is difference in stand-alone database & RAC database background processes?
Ans: DIAG, LCKn, LMD, LMSn, LMON

4) What are structural changes in 11g R2 RAC?
Ans: Grid & ASM are on one home, Voting disk & ocrfile can be on the ASM, SCAN, By using srvctl, we can mange diskgroups, home, ons, eons, filesystem, srvpool, server, scan, scan_listener, gns, vip, oc4j,GSD

5) What is Cache Fusion?
Ans: Transferring of data between RAC instances by using private network. Cache Fusion is the remote memory mapping of Oracle buffers, shared between the caches of participating nodes in the cluster. When a block of data is read from datafile by an instance within the cluster and another instance is in need of the same block, it is easy to get the block image from the instance which has the block in its SGA rather than reading from the disk.

6) What is the purpose of Private Interconnect?
Ans: Clusterware uses the private interconnect for cluster synchronization (network heartbeat) and daemon communication between the clustered nodes. This communication is based on the TCP protocol.  RAC uses the interconnect for cache fusion (UDP) and inter-process communication (TCP).

7) What are the Clusterware Components?
Ans: Voting Disk - Oracle RAC uses the voting disk to manage cluster membership by way of a health check and arbitrates cluster ownership among the instances in case of network failures. The voting disk must reside on shared disk.
Oracle Cluster Registry (OCR) - Maintains cluster configuration information as well as configuration information about any cluster database within the cluster. The OCR must reside on shared disk that is accessible by all of the nodes in your cluster. 
The daemon OCSSd manages the configuration info in OCR and maintains the changes to cluster in the registry.
Virtual IP (VIP) - When a node fails, the VIP associated with it is automatically failed over to some other node and new node re-arps the world indicating a new MAC address for the IP. Subsequent packets sent to the VIP go to the new node, which will send error RST packets back to the clients.

This results in the clients getting errors immediately.
crsd – Cluster Resource Services Daemon
cssd – Cluster Synchronization Services Daemon
evmd – Event Manager Daemon
oprocd / hangcheck_timer – Node hang detector

8) What is OCR file?
Ans: RAC configuration information repository that manages information about the cluster node list and instance-to-node mapping information. The OCR also manages information about Oracle Clusterware resource profiles for customized applications. Maintains cluster configuration information as well as configuration information about any cluster database within the cluster. The OCR must reside on shared disk that is accessible by all of the nodes in your cluster.The daemon OCSSd manages the configuration info in OCR and maintains the changes to cluster in the registry.

9) What is Voting disk and how many files should be there?
Ans: Voting Disk File is a file on the shared cluster system or a shared raw device file. Oracle Clusterware uses the voting disk to determine which instances are members of a cluster. Voting disk is akin to the quorum disk, which helps to avoid the split-brain syndrome. Oracle RAC uses the voting disk to manage cluster membership by way of a health check and arbitrates cluster ownership among the instances in case of network failures. The voting disk must reside on shared disk.

10) How to take backup of OCR file?
Ans: #ocrconfig -manualbackup, 
#ocrconfig -export file_name.dmp,
#ocrdump -backupfile my_file, 
$cp -p -R /u01/app/crs/cdata /u02/crs_backup/ocrbackup/RAC1

11) How to recover OCR file?
Ans:
#ocrconfig -restore backup_file.ocr
#ocrconfig -import file_name.dmp

12) what is Local OCR?
Ans:
/etc/oracle/local.ocr
/var/opt/oracle/local.ocr

13) How to check backup of OCR files?
Ans:
#ocrconfig –showbackup

14) How to take backup of voting file?
Ans: dd if=/u02/ocfs2/vote/VDFile_0 of=$ORACLE_BASE/bkp/vd/VDFile_0
crsctl backup css votedisk         -- from 11g R2

15) How do I identify the voting disk location? Or what is the location of Voting disk?
Ans: # crsctl query css votedisk
 
16) What is the location of OCR file?
check /var/opt/oracle/ocr.loc or /etc/ocr.loc
Ans: # ocrcheck

17) If voting disk or OCR file got corrupte and don’t have backups so how to get them?
Ans: We have to install Clusterware.

18) who will manage OCR files?
Ans: cssd will manage OCR.

19) who will take backup of OCR files?
Ans: crsd will take backup.

20) What is split brain syndrome?
Ans: Will arise when two or more instances attempt to control a cluster database. In a two-node environment, one instance attempts to manage updates simultaneously while the other instance attempts to manage updates.

21) what are various IPs used in RAC? And How may IPs we need in RAC?
Ans: Public IP, Private IP, Virtual IP, SCAN IP

22) whaat is the use of Virtual IP?
Ans: When a node fails, the VIP associated with it is automatically failed over to some other node and new node re-arps the world indicating a new MAC address for the IP. Subsequent packets sent to the VIP go to the new node, which will send error RST packets back to the clients.This results in the clients getting errors immediately.

Without using VIPs or FAN, clients connected to a node that died will often wait for a TCP timeout period (which can be up to 10 min) before getting an error. As a result, you don't really have a good HA solution without using VIPs.

23) what is the use of SCAN IP (scan Name) and will it provide load balancing?
Ans:Single Client Access Name (SCAN) is a new Oracle Real Application Clusters (RAC) 11g Release 2,
feature that provides a single name for clients to access an Oracle Database running in a cluster. The benefit is clients using SCAN do not need to change if you add or remove nodes in the cluster.

24) How many Scan Listeners will be running?
Ans: Three SCAN listeners only.

25) What is FAN?
Ans: Applications can use Fast Application Notification (FAN) to enable rapid failure detection, balancing of connection pools after failures, and re-balancing of connection pools when failed components are repaired.
The FAN process uses system events that Oracle publishes when cluster servers become unreachable or if network interfaces fail.

26) What is FCF?
Ans: Fast Connection Failover provides high availability to FAN integrated clients, such as clients that use JDBC, OCI, or ODP.NET. If you configure the client to use fast connection failover, then the client automatically subscribes to FAN events and can react to database UP and DOWN events. In response, Oracle gives the client a connection to an active instance that provides the requested database service.

27) What is TAF and TAF policies?
Ans: Transparent Application Failover (TAF) - A runtime failover for high availability environments,
such as Real Application Clusters and Oracle Real Application Clusters Guard, TAF refers to the failover and re-establishment of application-to-service connections. It enables client applications to automatically reconnect to the database if the connection fails, and optionally resume a SELECT statement that was in progress. This reconnect happens automatically from within the Oracle Call Interface (OCI) library.

28) what are nodeapps?
Ans: VIP, listener, ONS, GSD

29) How to do load balancing in RAC?

Client Side Connect-Time Load Balance:

The client load balancing feature enables clients to randomize connection requests among the listeners.
This is done by client Tnsnames Parameter: LOAD_BALANCE.
The (load_balance=yes) instructs SQLNet to progress through the list of listener addresses in the  address_list section of the net service name in a random sequence. When set to OFF, instructs SQLNet to try the addresses sequentially until one succeeds.

Client Side Connect-Time failover 

This is done by client Tnsnames Parameter: FAILOVER
The (failover=on) enables clients to connect to another listener if the initial connection to the first listener fails. Without connect-time failover, Oracle Net attempts a connection with only one listener.

Server Side Listener Connection Load Balancing.
 
With server-side load balancing, the listener directs a connection request to the best instance currently providing the service.
Init parameter remote_listener should be set. When set, each instance registers with the TNS listeners running on all nodes within the cluster.

There are two types of server-side load balancing: 

Load Based — Server side load balancing redirects connections by default depending on node load. This id default.
Session Based — Session based load balancing takes into account the number of sessions connected to each node and then distributes the connections to balance the number of sessions across the different nodes.

Transparent Application Failover(TAF):

Transparent Application Failover (TAF) is a feature of the Oracle Call Interface (OCI) driver at client side. It enables the application to automatically reconnect to a database, if the database instance to which the connection is made fails. In this case, the active transactions roll back.
Tnsnames Parameter: FAILOVER_MODE

e.g (failover_mode=(type=select)(method=basic))
Failover Mode Type can be Either SESSION or SELECT.

Session failover will have just the session to failed over to the next available node. With SELECT, the select query will be resumed.
TAF can be configured with just server side service settings by using dbms_service package.

Fast Connection Failover (FCF):

Fast Connection Failover is a feature of Oracle clients that have integrated with FAN HA Events.
Oracle JDBC Implicit Connection Cache, Oracle Call Interface (OCI), and Oracle Data Provider for .Net (ODP.Net) include fast connection failover.

With fast connection failover, when a down event is received, cached connections affected by the down event are immediately marked invalid and cleaned up.

30) What are the uses of services? How to find out the services in cluster?
Ans: Applications should use the services to connect to the Oracle database.Services define rules and characteristics (unique name, workload balancing, failover options, and high availability) to control how users and applications connect to database instances.

31) how to file out the nodes in cluster (or) how to find out the master node?
Ans: # olsnodes  -- Which ever displayed first, is the master node of the cluster.
 
select MASTER_NODE from v$ges_resource;

To find out which is the master node, you can see ocssd.log file and search for "master node number".

32) How to know the public IPs, Private IPs, VIPs in RAC?
Ans:
# olsnodes -n -p -i
node1-pub       1       node1-prv       node1-vip
node2-pub       2       node2-prv       node2-vip

33) What utility is used to start DB or Instance?
Ans:
srvctl start database –d database_name
srvctl start instance –d database_name –i instance_name

34) How can you shutdown single instance?
Ans:
Change cluster_database=false
srvctl stop instance –d database_name –i instance_name

35) What is HAS (High Availability Service) and the Comnmands?
Ans: HAS includes ASM and database instance and listeners.

crsctl check has
crsctl config has
crsctl disable has
crsctl enable has
crsctl query has releaseversion
crsctl query has softwareversion
crsctl start has
crsctl stop has [-f]

36) How many nodes are supported in a RAC Database?
Ans: 10g Release 2, support 100 nodes in a cluster using Oracle Clusterware, and 100 instances in a RAC database.

37) What is fencing?
Ans: I/O fencing prevents updates by failed instances, and detecting failure and preventing split brain in cluster.When a cluster node fails, the failed node needs to be fenced off from all the shared disk devices or diskgroups. This methodology is called I/O Fencing, sometimes called Disk Fencing or failure fencing.

38) Why Clusterware installed in root?
Oracle Clusterware works closely with the operating system, system administrator access is required for some of the installation tasks. In addition, some of the Oracle Clusterware processes must run as the special operating system user, root.

39) What are the initialization parameters that must have same value for every instance in an Oracle RAC database?
Ans:ACTIVE_INSTANCE_COUNT
ARCHIVE_LAG_TARGET
COMPATIBLE
CLUSTER_DATABASE
CLUSTER_DATABASE_INSTANCE
CONTROL_FILES
DB_BLOCK_SIZE
DB_DOMAIN
DB_FILES
DB_NAME
DB_RECOVERY_FILE_DEST
DB_RECOVERY_FILE_DEST_SIZE
DB_UNIQUE_NAME
INSTANCE_TYPE
PARALLEL_MAX_SERVERS
REMOTE_LOGIN_PASSWORD_FILE
UNDO_MANAGEMENT


Thanks (Commands Plz)

Managing Client Connectivity in a Data Guard Configuration



Managing Client Connectivity.
Understanding Client Connectivity in a Data Guard Configuration.Be aware of the following issues when you manage client connectivity in a Data Guard configuration:
• Databases reside on different hosts in a Data Guard configuration.
• Clients must connect to the correct database:
– Primary
– Logical standby
– Snapshot standby
– Physical standby with real-time query
• If clients send connection requests to the wrong host, they may be connected to the wrong Database or receive an error.
• Clients must automatically reconnect to the correct database in the event of a failover. 

Preventing Clients from Connecting to the Wrong Database
• Use database services to prevent clients from connecting to the wrong database in the Data Guard configuration.
• Database services act as an abstraction layer between the client and database instances.
• Database services register with listeners.
• Clients connect to database services instead of database instances.
• Listeners use registration details to determine which instances support a particular service at a particular
moment in time.
• Listeners then direct connection requests to the correct instances; otherwise, the appropriate error is returned.


Preventing Clients from Connecting to the Wrong Database
Clients who send connection requests to the wrong host might be connected to the wrong database instance, or they might receive an error message such as the following: ORA-01033: ORACLE initialization or shutdown in progress You can prevent clients from connecting to the wrong database by using database services.

Creating a Service for orcl Instance Invoke SQL*Plus on your primary database host and connect as the SYSDBA user.

SQL> show parameter service_names

On Primary

Managing Services
 

• Database services can be managed by using the DBMS_SERVICE package when Oracle Restart is not used.
• Database services attributes:
– Service Name: For administration of the service
– Network Name: For services that are implemented for external client connections
– Transparent Application Failover (TAF) attributes: For TAFenabled client connections 


Managing Services

Database services are implemented with the DBMS_SERVICE package. This package provides for the creation, deletion, starting, and stopping of services for a single database instance.
 

Note: For Oracle Real Application Clusters (RAC) and single-instance databases managed by Oracle Restart or Oracle Clusterware (which includes ASM), the DBMS_SERVICE procedure is deprecated in Oracle Database 11g Release 2 (11.2) and srvctl should be used instead to create services.




$ srvctl add service -d orcl -s prmy -l PRIMARY -m BASIC -e SELECT -w 1 -z 180
$ lsnrctl services
$ srvctl start service -d orcl -s prmy
$ lsnrctl services

SQL> show parameter service_names

Creating a Service for the stdy Instance

SQL> show parameter service_names

$ srvctl add service -d stdy -s prmy -l PRIMARY -m BASIC -e SELECT -w 1 -z 180
$ srvctl start service -d stdy -s prmy
$ srvctl config service -d stdy -s prmy

Creating an Oracle Net Service Name on Your Primary Database Host

prmy =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 11gr2.rhel5.com)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 11gr2sb.rhel5.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = prmy.rhel5.com)
    )
  )

Creating an Oracle Net Service Name on Your Standby Database Host

prmy =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 11gr2.rhel5.com)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 11gr2sb.rhel5.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = prmy.rhel5.com)
    )
  )

Testing Your Implementation on your primary database

SQL> create user dgtest identified by dgtest;

SQL> grant create session to dgtest;

SQL> grant select_catalog_role to dgtest;

On your physical standby database host, connect to the primary database as the DGTEST user by using the prmy service.
$ sqlplus dgtest/dgtest@prmy

SQL> select host_name from v$instance;

HOST_NAME
----------------------------------------------------------------
11gr2.rhel5.com

SQL> select failover_type, failover_method, failed_over from v$session where username = 'DGTEST';

FAILOVER_TYPE FAILOVER_M FAI
------------- ---------- ---
SELECT        BASIC      NO

Return to your primary database

$ dgmgrl

DGMGRL> connect sys/oracle
DGMGRL> switchover to stdy;
DGMGRL> connect sys/oracle
DGMGRL> startup mount

On your primary database host, check the listener services again. prmy is no longer listed.

$ lsnrctl services

Return to your (original) physical standby database host. In your existing SQL*Plus session, query V$INSTANCE to determine what host you are now connected to

SQL> select host_name from v$instance;
SQL> select failover_type, failover_method, failed_over from v$session where username = 'DGTEST';
SQL> show parameter service

$ lsnrctl services listener


If the prmy service does not start. Set the local_listener value to null as it is only needed for Non-default listener port to do dynamic registeration with the service. 


Thanks (Commands Plz)

Monday 19 October 2015

Enabling Fast Start Failover and the Observer

Enabling Fast Start Failover and the Observer
Ensure standby redo logs are configured on both primary and standby databases

Fast-start failover enables Data Guard to rapidly and automatically fail over to a previouslychosen standby database without requiring manual intervention. This feature increases the availability of your database in the event of a disaster by reducing the need for you to performa failover operation manually.
The observer is an Oracle Call Interface (OCI) client-side component that typically runs on aseparate computer and monitors the availability of the primary database

When Does Fast-Start Failover Occur?
Fast-start failover occurs when any of the following conditions are met:
• Loss of connectivity between both the primary database and the observer and between the primary database and the fast-start failover target standby database exceeds the fast-start failover threshold.
• The database health-check mechanism determines any of the following (as optionally configured):
- A data file is offline because of a write error.
- Dictionary corruption of a critical database object occurs.
- Control file is permanently damaged because of a disk failure.
- LGWR is unable to write to any member of the log group because of an I/O error.
- Archiver is unable to archive a redo log because the device is full or unavailable.
• An instance crash occurs for a single-instance database.
• All instances of a Real Application Clusters (RAC) primary database crash.
• Shutdown abort of the primary database occurs.
• An application initiates a fast-start failover by calling the DBMS_DG.INITIATE_FS_FAILOVER function. 

SQL> SELECT GROUP#, BYTES/1024, STATUS FROM V$STANDBY_LOG;
  
Ensure the LogXptMode Property is set to SYNC

DGMGRL> EDIT DATABASE ORCL SET PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
DGMGRL>

DGMGRL> EDIT DATABASE STDY SET PROPERTY 'LogXptMode'='SYNC';
Property "LogXptMode" updated
DGMGRL>

Alert log

ALTER SYSTEM SET log_archive_dest_2='service="stdy"','LGWR SYNC AFFIRM delay=0 optional compression=disable max_failure=0 max_connections=1 reopen=300 db_unique_name="stdy" net_timeout=30','valid_for=(all_logfiles,primary_role)' SCOPE=BOTH;
ALTER SYSTEM SWITCH ALL LOGFILE start (orcl)
Thread 1 cannot allocate new log, sequence 72
Checkpoint not complete
  Current log# 2 seq# 71 mem# 0: +DATA/orcl/onlinelog/group_2.264.719142951
  Current log# 2 seq# 71 mem# 1: +DATA/orcl/onlinelog/group_2.265.719142957
2012-08-28 17:34:32.652000 +05:30
Destination LOG_ARCHIVE_DEST_2 is SYNCHRONIZED
******************************************************************
LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2
******************************************************************
NSS2 started with pid=43, OS id=29520
2012-08-28 17:34:36.838000 +05:30
LGWR: Standby redo logfile selected for thread 1 sequence 72 for destination LOG_ARCHIVE_DEST_2
ALTER SYSTEM SWITCH ALL LOGFILE complete (orcl)
Thread 1 advanced to log sequence 72 (LGWR switch)
  Current log# 3 seq# 72 mem# 0: +DATA/orcl/onlinelog/group_3.266.719142961
  Current log# 3 seq# 72 mem# 1: +DATA/orcl/onlinelog/group_3.267.719142965
Archived Log entry 105 added for thread 1 sequence 71 ID 0x4a53118e dest 1:
2012-08-28 17:34:39.158000 +05:30

Specify the FastStartFailoverTarget property

DGMGRL> EDIT DATABASE ORCL SET PROPERTY FastStartFailoverTarget='STDY';

Property "faststartfailovertarget" updated

DGMGRL> EDIT DATABASE STDY SET PROPERTY FastStartFailoverTarget='ORCL';

Property "faststartfailovertarget" updated
DGMGRL>

Upgrade the protection mode to MAXAVAILABILITY, if necessary.

DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
Succeeded.
DGMGRL>


ENABLE FAST START FAILOVER

DGMGRL> show configuration;
Configuration
Name: orcl
Enabled: YES
Protection Mode: MaxAvailability
Fast-Start Failover: DISABLED
Databases:
orcl - Primary database
stdy - Physical standby database
Current status for "orcl":
SUCCESS

DGMGRL> SHOW DATABASE STDY;

Database
  Name:            stdy
  Role:            PHYSICAL STANDBY
  Enabled:         YES
  Intended State:  APPLY-ON
  Instance(s):
    stdy
 Current status for "stdy":
SUCCESS

DGMGRL> ENABLE FAST_START FAILOVER;
Enabled.
DGMGRL>

Alert log

2012-03-04 17:25:35.344000 +05:30
FSFP started with pid=45, OS id=3550

DGMGRL> SHOW CONFIGURATION;
Configuration - orcl_stdy

  Protection Mode: MaxAvailability
  Databases:
    orcl - Primary database
      Warning: ORA-16819: fast-start failover observer not started
    stdy - (*) Physical standby database
      Warning: ORA-16819: fast-start failover observer not started

Fast-Start Failover: ENABLED
Configuration Status:
WARNING

Start the observer

From Another Terminal Start Observer and let it run connect. May need to bounce Listener once.

$ dgmgrl
DGMGRL> connect sys/oracle
Connected.
DGMGRL>
DGMGRL> start observer
Observer started

OR

To start Observer in background

$ dgmgrl -logfile ./observer_log

DGMGRL> connect sys/oracle
Connected.
DGMGRL> start observer

From another session

$ tail -100f observer_log

$ ps -ef|grep observer
oracle   24282 23873  0 09:11 pts/6    00:00:00 rlwrap dgmgrl sys/oracle@orcl start observer
oracle   24283 24282  0 09:11 pts/7    00:00:00 dgmgrl                 start observer
oracle   24320 23873  0 09:12 pts/6    00:00:00 tail -100f observer_log
oracle   24363 24338  0 09:12 pts/8    00:00:00 grep observer
[oracle@server ~]$

Verify the fast-start failover configuration

DGMGRL> SHOW CONFIGURATION VERBOSE;

Configuration - orcl_stdy

  Protection Mode: MaxAvailability
  Databases:
    orcl - Primary database
    stdy - (*) Physical standby database
   (*) Fast-Start Failover target
 Fast-Start Failover: ENABLED
   Threshold:        30 seconds
  Target:           stdy
  Observer:         11gr2.rhel5.com
  Lag Limit:        30 seconds (not in use)
  Shutdown Primary: TRUE
  Auto-reinstate:   TRUE

Configuration Status:
SUCCESS

DGMGRL> SHOW DATABASE STDY;

Database - stdy
   Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   0 seconds
  Apply Lag:       0 seconds
  Real Time Query: OFF
  Instance(s):
    stdy

Database Status:
SUCCESS
 
Perform Fast_Start_Failover

DGMGRL> show fast_start failover;

Fast-Start Failover: ENABLED
  Threshold:        30 seconds
  Target:           stdy
  Observer:         11gr2.rhel5.com
  Lag Limit:        30 seconds (not in use)
  Shutdown Primary: TRUE
  Auto-reinstate:   TRUE
Configurable Failover Conditions
  Health Conditions:
    Corrupted Controlfile          YES
    Corrupted Dictionary           YES
    Inaccessible Logfile            NO
    Stuck Archiver                  NO
    Datafile Offline               YES
  Oracle Error Conditions:
    (none)

DGMGRL> EDIT CONFIGURATION SET PROPERTY FASTSTARTFAILOVERLAGLIMIT=45;
Property "faststartfailoverlaglimit" updated

DGMGRL> show fast_start failover;

Fast-Start Failover: ENABLED
  Threshold:        30 seconds
  Target:           stdy
  Observer:         11gr2.rhel5.com
  Lag Limit:        45 seconds (not in use)
  Shutdown Primary: TRUE
  Auto-reinstate:   TRUE
Configurable Failover Conditions
  Health Conditions:
    Corrupted Controlfile          YES
    Corrupted Dictionary           YES
    Inaccessible Logfile            NO
    Stuck Archiver                  NO
    Datafile Offline               YES
  Oracle Error Conditions:
    (none)

SQL> select database_role from v$database;

DATABASE_ROLE
----------------
PRIMARY

On Primary

SQL> shutdown abort

On Standby
SQL> select database_role from v$database;

DATABASE_ROLE
----------------
PHYSICAL STANDBY

See the Observer Terminal
DGMGRL> start observer
Observer started
10:28:52.96  Sunday, June 21, 2009
Initiating fast-start failover to database "stdy"...
Performing failover NOW, please wait...
Failover succeeded, new primary is "stdy"
12:46:39.08  Sunday, June 21, 2009
Hangup

 On Standby

SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PRIMARY

Before Failover  on Standby
SQL> SELECT fs_failover_status, fs_failover_current_target, fs_failover_threshold, fs_failover_observer_present, fs_failover_observer_host FROM v$database;

FS_FAILOVER_STATUS    FS_FAILOVER_CURRENT_TARGET     FS_FAILOVER_THRESHOLD FS_FAIL FS_FAILOVER_OBSERVER_HOST
--------------------- ------------------------------ --------------------- ------- ---------------------------------------------------------
SYNCHRONIZED          stdy                                              30 YES   server.rhel5.com

Before Reinstating on New Primary but After Failover

SQL> SELECT fs_failover_status, fs_failover_current_target, fs_failover_threshold, fs_failover_observer_present, fs_failover_observer_host FROM v$database;

FS_FAILOVER_STATUS     FS_FAILOVER_CURRENT_TARGET     FS_FAILOVER_THRESHOLD FS_FAIL FS_FAILOVER_OBSERVER_HOST
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
REINSTATE REQUIRED     orcl                                              30 YES     server.rhel5.com

On Old Primary

SQL> startup
ORACLE instance started.
Total System Global Area  213909504 bytes
Fixed Size                  1266656 bytes
Variable Size              83889184 bytes
Database Buffers          125829120 bytes
Redo Buffers                2924544 bytes
Database mounted.
ORA-16649: database will open after Data Guard broker has evaluated Fast-Start Failover status

SQL> SQL> SELECT fs_failover_status, fs_failover_current_target, fs_failover_threshold, fs_failover_observer_present, fs_failover_observer_host FROM v$database;

FS_FAILOVER_STATUS     FS_FAILOVER_CURRENT_TARGET     FS_FAILOVER_THRESHOLD FS_FAIL FS_FAILOVER_OBSERVER_HOST
---------------------- ------------------------------ --------------------- ------- --------------------------------------------------------------------------------
BYSTANDER                                                                30 YES

SQL> show parameter unique

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_unique_name                       string      ORCL

SQL> select database_role from v$database;

DATABASE_ROLE
----------------
PHYSICAL STANDBY

SQL> select open_mode from v$database;

OPEN_MODE
----------
READ ONLY

SQL>

On Observer Host

DGMGRL> connect sys/oracle@ORCL
Connected.
DGMGRL> START OBSERVER
Error: ORA-16795: database resource guard detects that database re-creation is required
Observer started
11:55:51.63  Sunday, June 21, 2009
Initiating reinstatement for database "orcl"...
Reinstating database "orcl", please wait...
Operation requires shutdown of instance "ORCL" on database "orcl"
Shutting down instance "ORCL"...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "ORCL" on database "orcl"
Starting instance "ORCL"...
ORACLE instance started.
Database mounted.
Continuing to reinstate database "orcl" ...
Reinstatement of database "orcl" succeeded
11:57:15.24  Sunday, June 21, 2009
Hangup

After Reinstating on New Primary

SQL> SELECT fs_failover_status, fs_failover_current_target, fs_failover_threshold, fs_failover_observer_present, fs_failover_observer_host FROM v$database;

FS_FAILOVER_STATUS    FS_FAILOVER_CURRENT_TARGET     FS_FAILOVER_THRESHOLD FS_FAIL FS_FAILOVER_OBSERVER_HOST
--------------------- ------------------------------ --------------------- ------- ---------------------------------------------------------
SYNCHRONIZED          orcl                                              30 NO   linux.com

On Old Primary

SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY

SQL> show parameter db_unique
NAME                                 TYPE        VALUE
------------------------------------ -----------
db_unique_name                       string      ORCL

SQL>

Dataguard Broker Configuration after reinstating
DGMGRL> connect sys/oracle@ORCL
Connected.
DGMGRL> SHOW CONFIGURATION;
Configuration
  Name:                orcl
  Enabled:             YES
  Protection Mode:     MaxAvailability
  Fast-Start Failover: ENABLED
  Databases:
    orcl - Physical standby database
         - Fast-Start Failover target
    stdy - Primary database
Current status for "orcl":
SUCCESS
DGMGRL>

Disable Fast Start Failover

DISABLE FAST-START FAILOVER;


Thanks (C0mmands Plz)