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)

1 comment:

  1. very much helpful blog. . keep it up. . keep updating....

    ReplyDelete