Oracle DBA Interview Questions and Answers
Oracle DBA Interview Questions and Answers
===========================================
What is RAC and how is it different from non RAC databases?
RAC stands for Real Application Cluster, you will have n number of instances
running in separate nodes for single database and having shared storage.
RAC is the best solution for high performance and high availably.
Oracle Real Application Clusters (RAC) is a software component we
can add to a high-availability solution that enables users on multiple
machines to access a single database with increased performance. RAC
comprises two or more Oracle database instances running on two or more
clustered machines and accessing a shared storage device via cluster
technology. To support this architecture, the machines that host the database
instances are linked by a high-speed interconnect to form the cluster.
Oracle RAC offers features in the following areas:
Scalability
Availability
Load balancing
Failover
Reliability if one node fails, the database wont fail
Availability nodes can be added or replaced without having to shut down
the database
Scalability more nodes can be added to the cluster as the workload
increases
srvctl
srvctl
srvctl
srvctl
srvctl
srvctl
Improve throughput
High availability
Transparency
What is Oracle RAC One Node?
Oracle RAC one Node is a single instance running on one node of the
cluster while the 2nd node is in cold standby mode. If the instance fails for
some reason then RAC one node detect it and restart the instance on the
same node or the instance is relocate to the 2nd node in case there is failure
or fault in 1st node. The benefit of this feature is that it provides a cold
failover solution and it automates the instance relocation without any
downtime and does not need a manual intervention. Oracle introduced this
feature with the release of 11gR2 (available with Enterprise Edition).
Real Application Clusters
Oracle RAC is a cluster database with a shared cache architecture that
overcomes the limitations of traditional shared-nothing and shared-disk
approaches to provide a highly scalable and available database solution
for all your business applications. Oracle RAC provides the foundation for
enterprise grid computing.
Oracles Real Application Clusters (RAC) option supports the transparent
deployment of a single database across a cluster of servers, providing fault
tolerance from hardware failures or planned outages. Oracle RAC running on
clusters provides Oracles highest level of capability in terms of availability,
scalability, and low-cost computing.
One DB opened by multiple instances so the db will be Highly
Available if an instance crashes.
Cluster Software. Oracles Clusterware or products like Veritas Volume
Manager are required to provide the cluster support and allow each node to
know which nodes belong to the cluster and are available and with Oracle
Cluterware to know which nodes have failed and to eject then from the
cluster, so that errors on that node can be cleared.
partition rather than under the direct control of the operating system or a file
system. This as the only available option in 9i.
Cluster File system: This option is not widely used and here the cluster file
system such as Oracle Cluster file system (OCFS) for MS Windows and Linux
holding the all datafiles of RAC database
Automatic Storage Management (ASM): Oracle recommended storage
option which is optimized for cluster file system for Oracle database files
introduced in Oracle 10g.
Oracle Clusterware
Clusterware is the mandatory piece of software which is required to run
Oracle RAC option,it provides the basic clustering support at OS level and
enables oracle software to run in cluster mode.
Clusterware enables nodes to communicate each other and forms the cluster
that make the nodes work as a single logical server.
Clusterware is managed by cluster ready services (CRS) using the Oracle
Cluster registry (OCR) and voting disk
Cluster Ready Services (CRS)
Oracle clusterware uses CRS for interaction between the OS and the
Database.CRS have five components namely Process Monitor daemon
(OPROCd: obsolete in 11gR2),CRS daemon(CRSd),Oralce Custer
Synchronization Service daemon(OCSSd),Event Volume Manager
daemon(EVMd) and the Oracle Notification Service (ONS)
CRS is installed and run from ORA_CRS_HOME in 10g and GRID_HOME in 11g
Starting and Stopping CRS
crsctl stop crs
# Stops Oracle clusterware
crsctl start crs
# Starts Oracle clusterware
crsctl enable crs # Enables Oracle clusterware
crsctl disable crs # Disables Oracle clusterware
Note: These commands should be used in root user (Superuser)
Oracle Cluster Synchronization Services
OCSSd provides synchronization between the nodes. Failure of OCSSd causes
the machine to reboot to avoid split-brain situation.OCSSd runs as oracle
user.
[oracle@node2 ~]$
Instance RACDB1 is
Instance RACDB2 is
[oracle@node2 ~]$
***Repeat same command for all nodes one by one. If you face any
issue in stopping node applications use "-f" as force option to stop
applications.
5. Shut down the Oracle Clusterware or CRS:
[root@node1 bin]# crsctl check cluster -all
**************************************************************
node1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
*************************************************************
node2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
[root@node1 bin]# crsctl stop crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed
resources on 'node1'
CRS-2673: Attempting to stop 'ora.crsd' on 'node1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources
on 'node1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN2.lsnr' on 'node1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'node1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN3.lsnr' on 'node1'
CRS-2673: Attempting to stop 'ora.node2.vip' on 'node1'
------------------------------------------------------------------------------------------------------------------------------------------------CRS-2677: Stop of 'ora.cssd' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'node1'
CRS-2677: Stop of 'ora.gipcd' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'node1'
CRS-2677: Stop of 'ora.gpnpd' on 'node1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources
on 'node1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[root@node1 bin]# crsctl check cluster -all
Start
Start
Start
Start
Start
**************************************************************
node2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
2. Start Node applications running on nodes:
[grid@node1 bin]$ srvctl start nodeapps -n node1
[grid@node1 bin]$ srvctl status nodeapps -n node1
VIP node1-vip is enabled
VIP node1-vip is running on node: node1
Network is enabled
Network is running on node: node1
GSD is disabled
GSD is not running on node: node1
ONS is enabled
ONS daemon is running on node: node1
***DBA has to execute this command for each node to start Real
Application Clusters Cluster database.
3. Start All ASM instances from all nodes:
[grid@node1 bin]$ srvctl start asm -n node1
[grid@node1 bin]$ srvctl status asm -n node1
ASM is running on node1
DBA has to start ASM instance on all database nodes.
4. Start RAC Database Instances on all nodes:
[grid@node1 bin]$ srvctl start database -d RACDB
[grid@node1 bin]$ srvctl status database -d RACDB
Instance RACDB1 is running on node node1
Instance RACDB2 is running on node node2
The RMSn processes perform manageability tasks for Oracle RAC. Tasks
accomplished by an RMSn process include creation of resources related
Oracle RAC when new instances are added to the clusters.
RSMNRemote Slave Monitor manages background slave process creation
and communication on remote instances. These background slave processes
perform tasks on behalf of a coordinating process running in another
instance.
What are Oracle database background processes specific to RAC?
LMSGlobal Cache Service Process
LMDGlobal Enqueue Service Daemon
LMONGlobal Enqueue Service Monitor
LCK0Instance Enqueue Process
Oracle RAC instances use two processes, the Global Cache Service (GCS) and
the Global Enqueue Service (GES). The GCS and GES maintain records of the
statuses of each data file and each cached block using a Global Resource
Directory (GRD). The GRD contents are distributed across all of the active
instances.