Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Oracle 9i RAC
OPS (Oracle Parallel Server) was renamed as RAC
CFS (Cluster File System) was supported
OCFS (Oracle Cluster File System) for Linux and Windows
watchdog timer replaced by hangcheck timer
When installing Oracle 10g/11g R1 RAC, three network interfaces(IPs) are required
for each node in the RAC cluster, they are:
When installing Oracle 11g R2 RAC, we need one more network interface(IP) is
required for each node in the RAC cluster.
SCAN Interface (IP): 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.
Oracle 10g Cluster Ready Services enables databases to use a Virtual IP address to
configure the listener ON. This feature is to assure that oracle clients quickly
failover when a node fails. In Oracle Database 10g RAC, the use of a virtual IP
address to mask the individual IPO addresses of the clustered nodes is required.
The virtual IP addresses are used to simplify failover and are automatically
managed by CRS.
One public IP address for each node to use for its Virtual IP address for client
connections and for connection failover. This IP address is in addition to the
operating system managed public host IP address that is already assigned to the
node by the operating system. This public Virtual IP must be associated with the
same interface name on every node that is a part of the cluster. The IP addresses
that are used for all of the nodes that are part of a cluster must be from the same
subnet. The host names for the VIP addresses must be registered with the domain
name server (DNS). The Virtual IP address should not be in use at the time of the
installation because this is a Virtual IP address that Oracle manages internally to
the RAC processes. This virtual IP address does not require a separate NIC. The
VIPs should be registered in the DNS. The VIP addresses must be on the same subnet
as the public host network addresses. Each Virtual IP (VIP) configured requires an
unused and resolvable IP address.
Using virtual IP we can save our TCP/IP timeout problem because Oracle notification
service (ONS) maintains communication between each nodes and listeners. Once ONS
found any listener down or node down, it will notify another nodes and listeners.
While new connection is trying to establish connection to failure node or listener,
virtual IP of failure node automatically divert to surviving node and session will
be establishing in another surviving node. This process doesn't wait for TCP/IP
timeout event. Due to this new connection gets faster session establishment to
another surviving nodes/listener.
Virtual IP (VIP) is for fast connection establishment in failover dictation. Still
we can use physical IP address in Oracle 10g in listener if we have no worry for
failover timing. We can change default TCP/IP timeout using operating system
utilities/commands and kept smaller. But taking advantage of VIP (Virtual IP
address) in Oracle 10g RAC database is advisable.
#srvctl start nodeapps -n node_name -- Starts GSD, VIP, listener and ONS
#srvctl start nodeapps -n rac99
#srvctl stop nodeapps -n node_name [-r] -- Stops GSD, VIP, listener and ONS
#srvctl stop nodeapps -n lnx03
#srvctl config nodeapps -n node_name [-a] [-g] [-o] [-s] [-l]
-a Display VIP configuration
#srvctl config nodeapps -n node33 -a
This process maintains statuses of datafiles and each cached block by recording
information in a Global Resource Directory(GRD). This process also controls the
flow of messages to remote instances and manages global data block access and
transmits block images between the buffer caches of different instances. This
processing is a part of cache fusion feature.
The LMSx handles the acquisition interrupt and blocking interrupt requests from the
remote instances for Global Cache Service resources. For cross-instance consistent
read requests, the LMSx will create a consistent read version of the block and send
it to the requesting instance. The LMSx also controls the flow of messages to
remote instances.
The LMSn processes handle the blocking interrupts from the remote instance for the
Global Cache Service resources by:
Managing the resource requests and cross-instance call operations for the shared
resources.
Building a list of invalid lock elements and validating the lock elements during
recovery.
Handling the global lock deadlock detection and Monitoring for the lock conversion
timeouts.
Oracle RAC instances use two processes GES(Global Enqueue Service), GCS(Global
Cache Service) that enable cache fusion. The GES and GCS maintain records of the
statuses of each datafile and each cached block using global resource directory
(GRD). This process is referred to as cache fusion and helps in data integrity.
Oracle RAC is composed of two or more instances. 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. To enable inter instance
communication Oracle RAC makes use of interconnects. The Global Enqueue
Service(GES) monitors and Instance enqueue process manages the cache fusion.
clscfg commands in Oracle RAC
CLSCFG: -- Oracle cluster configuration tool, in Oracle Real Application
Cluster(RAC)
1) cemutlo utility can be used to find out Oracle RAC Cluster name.
$GRID_HOME/bin/cemutlo -n
e.g.:
/u01/app/11.2/grid/bin/cemutlo -n
Below command will give number of characters in Oracle RAC Cluster name.
/u01/app/11.2/grid/bin/cemutlo -n|wc -c
2) olsnodes utility can be used to find out Oracle RAC Cluster name.
olsnodes -c
crs_stat -ls
crs_stat -t/v/p resource_name or crs_stat -t/v/p|grep keyword -- will show the
entries with that keyword
crs_stat -p lnx02
crs_stat -v | grep eg6245
#/etc/init.d/init.cssd stop
#/etc/init.d/init.cssd start
#/etc/rc.d/init.d/init.evmd
#/etc/rc.d/init.d/init.cssd
#/etc/rc.d/init.d/init.crsd
$crsctl lsmodules crs -- lists CRS modules that can be used for debugging
CRSUI
CRSCOMM
CRSRTI
CRSMAIN
CRSPLACE
CRSAPP
CRSRES
CRSCOMM
CRSOCR
CRSTIMER
CRSEVT
CRSD
CLUCLS
CSSCLNT
COMMCRS
COMMNS
$crsctl lsmodules css -- lists CSS modules that can be used for debugging
CSSD
COMMCRS
COMMNS
$crsctl lsmodules evm -- lists EVM modules that can be used for debugging
EVMD
EVMDMAIN
EVMCOMM
EVMEVT
EVMAPP
EVMAGENT
CRSOCR
CLUCLS
CSSCLNT
COMMCRS
COMMNS
#crsctl debug statedump crs -- dumps state info for crs objects
#crsctl debug statedump css -- dumps state info for css objects
#crsctl debug statedump evm -- dumps state info for evm objects
#crsctl backup -h
#crsctl backup css votedisk
crsctl lsmodules {mdns | gpnp | css | crf | crs | ctss | evm | gipc}
crsctl lsmodules evm
mdns: Multicast domain name server
gpnp: Grid Plug and Play service
css: Cluster Synchronization Services
crf: Cluster Health Monitor
crs: Cluster Ready Services
ctss: Cluster Time Synchronization Service
evm: Event Manager
gipc: Grid Interprocess Communication
#ocrcheck -local
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262132
Used space (kbytes) : 9200
Available space (kbytes) : 252932
ID : 604793089
Device/File Name : /u02/crs/cdata/localhost/lnx6.olr Device/File integrity check
succeeded
Local OCR integrity check succeeded
#ocrconfig -overwrite
oifcfg iflist -p -n
etho 147.43.1.60 UNKNOWN 255.255.255.0 (public interfaces are UNKNOWN)
ethl 192.168.1.150 PRIVATE 255.255.255.0
oifcfg getif
eth1 192.168.1.150 global cluster_interconnect
eth0 192.168.0.150 global public
Provides the list of nodes and other information for all nodes participating in the
cluster
#olsnodes [node_name] [-g] [-i] [-l] [-n] [-p] [-s] [-t] [-v]
node_name -- displays information for the particular node
g -- more details
i -- with VIP
l -- local node name
n -- with node number
p -- private interconnect
s -- status of the node (ACTIVE or INACTIVE)
t -- type of the node (PINNED or UNPINNED)
v -- verbose
#olsnodes -n
#olsnodes node44 -v
#olsnodes -n -p -i
node1-pub 1 node1-prv node1-vip
node2-pub 2 node2-prv node2-vip
#olsnodes -i
node1 178.192.1.1
node2 178.192.2.1
node3 178.192.3.1
node4 178.192.4.1
#olsnodes -c
How to find out the nodes in cluster (or) how to find out the master node?
#olsnodes - Which ever displayed first, is the master node of the cluster.
4. What are the special background processes for RAC (or) what is difference in
stand-alone database & RAC database background processes?
DIAG, LCKn, LMD, LMSn, LMON
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.
18. What is Voting file/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.
Number of voting files must be odd i.e. 1, 3, 5, 7, 9, 11, 13, 15(max) etc.
21. If voting disk/OCR file got corrupted and don�t have backups, how to get them?
Ans:
We have to install Clusterware.
23. What are various IPs used in RAC? Or How may IPs we need in RAC?
Ans:
Public IP, Private IP, Virtual IP, SCAN IP
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.
25. 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.
36. 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.
37. How to find out the nodes in cluster (or) how to find out the master node?
Ans:
To find out which is the master node, use any one of the below.
i) # olsnodes -- Which ever displayed first, is the master node of the cluster.
ii) select MASTER_NODE from v$ges_resource;
iii) check ocssd.log file and search for "master node number".
iv) oclumon manage -get master (in Oracle RAC 12c)
v) ocrconfig -manualbackup
38. 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
gc buffer busy
gc buffer busy acquire
gc current request
gc cr request
gc cr failure
gc current block lost
gc cr block lost
gc current block corrupt
gc cr block corrupt
gc current block busy
gc cr block busy
gc current block congested
gc cr block congested.
gc current block 2-way
gc cr block 2-way
gc current block 3-way
gc cr block 3-way
(even if we have n number of nodes, there can be only 3-way wait event)
gc current grant 2-way
gc cr grant 2-way
gc current grant busy
gc current grant congested
gc cr grant congested
gc cr multi block read
gc current multi block request
gc cr multi block request
gc cr block build time
gc current block flush time
gc cr block flush time
gc current block send time
gc cr block send time
gc current block pin time
gc domain validation
gc current retry
ges inquiry response
gcs log flush sync
46. What is the difference between cr block and cur (current) block?
47. What are the initialization parameters that must have same value for every
instance in an Oracle RAC database?
Ans:
http://satya-racdba.blogspot.com/2012/09/init-parameters-in-oracle-rac.html
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
50. Why we need user equivalency? What happen if we remove it between node 3,5 in a
Production of 6 node RAC cluster?
To resolve this, a copy of the Oracle Local Registry(OLR) registry is now created
on each node during the initial installation which stores node specific information
and allows us to get around the problem.
Oracle Local Repository (OLR) contains information that allows the cluster
processes to be started up with the OCR being in the ASM storage system. Since the
ASM file system is unavailable until the Grid processes are started up a local copy
of the contents of the OCR is required which is stored in the OLR.
52. What is difference is between relocating the SCAN using srvctl relocate scan
and SCAN_LISTENER by using srvctl relocate scan_listener command?
53. What is the difference between Crash recovery and Instance recovery?
When an instance crashes in a single node database on startup a crash recovery
takes place. In a RAC environment the same recovery for an instance is performed by
the surviving nodes called Instance recovery.
55. How do you determine what protocol is being used for Interconnect traffic?
One of the ways is to look at the database alert log for the time period when the
database was started up.
Oracle RAC 11g release 2 introduces the Single Client Access Name (SCAN), which
provides a single name for clients to access Oracle Databases running in a cluster
and simplify the database connection strings that an Oracle Client uses to connect.
Without SCAN, till Oracle Clusterware 11g release 1, TNSNAMES has 1 entry per node.
RACDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))
. . .
(ADDRESS = (PROTOCOL = TCP)(HOST = nodeN-vip)(PORT = 1521))
(CONNECT_DATA =
. . . ))
With every cluster change, like node addition or removal, all client TNSNAMES need
to be changed.
With SCAN, from Oracle Clusterware 11g release2, only 1 entry per cluster is used,
regardless of the number of nodes.
RACDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = SCANname)(PORT = 1521))
(CONNECT_DATA =
. . . ))
Single Client Access Name (SCAN) - eliminates the need to change TNSNAMES entry
when nodes are added to or removed from the Cluster. RAC instances register to SCAN
listeners as remote listeners. Oracle recommends assigning 3 addresses to SCAN,
which will create 3 SCAN listeners, though the cluster has got dozens of nodes.
SCAN is a domain name registered to at least one and up to three IP addresses,
either in DNS (Domain Name Service) or GNS (Grid Naming Service). The SCAN must
resolve to at least one address on the public network. For high availability and
scalability, Oracle recommends configuring the SCAN to resolve to three addresses.
Public network addresses are used to provide services to clients. If clients are
connecting to the Single Client Access Name (SCAN) addresses, then we may need to
change public and virtual IP addresses as we add or remove nodes from the cluster,
but you do not need to update clients with new cluster addresses. SCANs function
like a cluster alias. SCANs are resolved on any node in the cluster, so unlike a
VIP address for a node, clients connecting to the SCAN no longer require updated
VIP addresses as nodes are added to or removed from the cluster. Because the SCAN
addresses resolve to the cluster, rather than to a node address in the cluster,
nodes can be added to or removed from the cluster without affecting the SCAN
address configuration.
Oracle Database 11g release 2 (11.2) instances only register with SCAN listeners as
remote listeners. Databases register with SCAN listeners as remote listeners, and
also continue to register with all node listeners. It's highly recommended that the
clients are Oracle 11g R2 or later version clients, to allow them to fully take
advantage of the failover with the SCAN settings.
Cluster Resources
--------------------------------------------
ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE node1
ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE node2
ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE node3
To use the DNS method for defining SCAN, the network administrator must create a
single name that resolves to 3 separate IP addresses using round-robin algorithms.
Regardless of how many systems are part of cluster, Oracle recommends that 3 IP
addresses are configured to allow for failover and load-balancing. SCAN Name needs
to be registered in DNS and resolved using round-robin algorithm. To test the
round-robin algorithm, perform nslookup on the SCAN Name. The DNS server should
return those 3 set of IP Address in different order each time.
It is important that the IP addresses are on the same subnet as the public network
for the server. The other two requirements are that the name (not including the
domain suffix) are 15 characters or less in length and that the name can be
resolved without using the domain suffix. Also, the IP addresses should not be
specifically assigned to any of the nodes in the cluster.
Using GNS assumes that a DHCP server is running on the public network with enough
available addresses to assign the required IP addresses and the SCAN VIP. Only one
static IP address is required to be configured and it should be in the DNS domain.
Oracle Clusterware 11g release 2 (11.2) supports the use of Dynamic Host
Configuration Protocol (DHCP) for the VIP addresses and the SCAN address, but not
the public address. DHCP provides dynamic configuration of the host's IP address,
but it does not provide an optimal method of producing names that are useful to
external clients. When using GNS and DHCP, Oracle Clusterware configures the VIP
addresses for the SCAN name that is provided during cluster configuration. The node
VIP and the three SCAN VIPs are obtained from the DHCP server when using GNS. If a
new server joins the cluster, then Oracle Clusterware dynamically obtains the
required VIP address from the DHCP server, updates the cluster resource, and makes
the server accessible through GNS.
cluvfy comp scan -> Use the cluvfy comp scan component verification command to
check the Single Client Access Name (SCAN) configuration.
SCAN:
srvctl add scan -n scan_name [-k network_number] [-S subnet/netmask[/if1[|
if2|...]]]
#srvctl add scan -n scan.mycluster.example.com -- Adds new SCAN information for a
cluster
srvctl config scan [-i ordinal_number] -- Shows the current SCAN configuration
srvctl config scan
srvctl config scan -i 2
Scan_listener:
srvctl add scan_listener [-l lsnr_name_prefix] [-s] [-p "[TCP:]port_list[/IPC:key]
[/NMP:pipe_name][/TCPS:s_port] [/SDP:port]"]
#srvctl add scan_listener -l myscanlistener -- Adds a new SCAN listener for a
cluster on the default port of 1521
#srvctl add scan_listener -p 1565 -- Adds a new SCAN listener on a
different port
ordinal_number=1,2,3
srvctl config gns [-a] [-d] [-k] [-m] [-n node_name] [-p] [-s] [-V] [-q name] [-l]
[-v]
srvctl config gns -n lnx03