Beruflich Dokumente
Kultur Dokumente
1
Contents
Introduction to Oracle RAC ................................................................................................. 4
High Availability:................................................................................................................ 4
SMP & Cluster ..................................................................................................................... 5
Types of Clusters: ................................................................................................................ 5
Shared Storage in Clusters ................................................................................................. 6
Clusters in Market............................................................................................................... 7
Standalone vs RAC ............................................................................................................. 7
RAC Version History .......................................................................................................... 7
Storage Basics & ASM........................................................................................................... 8
DAS (Direct Attached Storage): ........................................................................................ 8
NAS ( Network Attached Storage): .................................................................................. 9
SAN(Storage Area Network):............................................................................................ 9
RAC Storage Options & File Systems: ........................................................................... 10
ASM..................................................................................................................................... 11
Oracle Real Application Cluster Basics ........................................................................... 13
Components of Oracle RAC ( Physical Layout ) .......................................................... 13
Components of Oracle RAC ( Software & Instance Layout ) ..................................... 14
Cache Fusion ...................................................................................................................... 15
Background Processes of Oracle 12c RAC..................................................................... 15
Oracle Clusterware (10gR2) ............................................................................................. 16
Oracle Grid Infrastructure (11gR2):................................................................................ 18
12c Oracle Real Application Clusters: ............................................................................ 21
Installing Oracle 12c RAC on OEL7 ................................................................................. 22
Installing Oracle 12CR1 RAC on OEL 7.2 Using Virtual Box at the LAB: ................ 22
Upgrading Database and Oracle RAC ............................................................................. 69
Necessity of Applying Patches........................................................................................ 88
How to Upgrade a Database: .......................................................................................... 89
Applying latest PSU to 12.1.0.2: ...................................................................................... 89
Applying Patches on RAC and Upgradations: ............................................................. 90
Applying 12.1.0.2 Patchset on 12.1.0.1: .......................................................................... 90
Clusterware Administration: ............................................................................................. 90
2
Workload Management ...................................................................................................... 94
Fast Connection Failover: ................................................................................................ 96
Services ............................................................................................................................... 96
Administering OCR & Voting Disk ................................................................................. 98
Administering Voting Disks ............................................................................................. 98
Recovering Voting Disks.................................................................................................. 98
Adding, Moving, or Deleting Voting Disks .................................................................. 98
Administering the Oracle Cluster Registry .................................................................... 99
Adding an Oracle Cluster Registry ................................................................................ 99
OCR Import/Export ....................................................................................................... 100
Configuring Initialization Parameters for an Oracle RAC Database ...................... 100
Troubleshooting Oracle RAC: ......................................................................................... 103
Debugging Resources: .................................................................................................... 103
Debugging Components: ............................................................................................... 103
Diagnostics Collection Script......................................................................................... 103
Oracle Clusterware Alerts ............................................................................................. 104
Troubleshooting OCR & VOTING DISK: .................................................................... 105
Handling Node Eviction Issues: ................................................................................... 105
OS Watcher: ..................................................................................................................... 106
12c RAC New Features: ..................................................................................................... 107
11gR2 vs 12c Database differences ................................................................................. 112
11gR2 vs 12c RAC differences ......................................................................................... 113
Flex Cluster & Flex ASM in 12c ....................................................................................... 113
Oracle 12c RAC Commands Changes ............................................................................ 120
3
Introduction to Oracle RAC
Before understanding about Oracle RAC (Real Application clusters ), It's very important for
every DBA to know about Oracle High Availability.
High Availability:
If critical applications, servers, or data becomes unavailable, entire business might be
jeopardized. Loss of revenue, dissatisfied customers, penalties, and negative press will have
a lasting effect on organization's reputation. Hence High Availability plays a crucial role in
the modern IT Infrastructure. To understand about High Availability, we need to
understand about different types of failures. The Failures can be classified as shown below:
Downtime
Planned Unplanned
Storage Human
Site Error Corruption
Failure Error
Each type of failure should be handled in a different way and Oracle have different
solutions for different types of failures. The overview of the high availability solutions is
given below:
Oracle Real Application Clusters: For handling Computer Failures, Performance, &
Scalability
Oracle ASM: Storage Failure ( Volume Manager )
Oracle Data Guard: Site Failure ( Disaster Recovery )
Oracle Flashback: Human Error
HARD, RMAN & Secure Backup: Data Corruption
When we use all the High Availability (HA) solutions then we call it "Maximum Availability
Architecture (MAA)".
4
SMP & Cluster
Symmetric Multiprocessing (SMP) involves a multiprocessor computer hardware
architecture where two or more identical processors are connected to a single shared main
memory and are controlled by a single OS instance. A computer Cluster consists of a set of
loosely connected computers that work together so that in many respects they can be viewed
as a single system. Requires a software to manage the cluster.
Types of Clusters:
Clusters can be classified into the following categories:
Active-Active Cluster
Active-Passive Cluster
3 Additional Nodes can be added to the No use of adding additional nodes as only
Cluster when required one node accesses the storage always
5 Load Balancing and Better Performance No Load Balancing and Poor Performance
6 e.g. IBM HACMP e.g. Oracle RAC
5
Shared Storage in Clusters
Clusters can be classified into the following categories based on how the shared storage is
configured.
Shared Nothing:
Data partitioned is accessed by several nodes separately.
Each node can write into its own disks.
Adding nodes dynamically is not possible. Requires downtime and sometimes re-
configuration
No Failover capacity e.g. Teradata, Microsoft Cluster
Shared Everything:
All nodes of the cluster access the same data simultaneously performing read/write
operations
In case of node failure, the surviving nodes can recover the transactions. There is no
down-time.
Nodes can be removed or added dynamically
e.g. Oracle RAC, Oracle Exadata
6
Clusters in Market
Solaris : Sun Cluster, Veritas Cluster Services
HP-UX : HP Service Guard
HP Tru 64 : Tru Cluster
Windows : Microsoft Cluster Services
Linux: Oracle Clusterware
IBM AIX : HACMP
Standalone vs RAC
7
OPS has been re-named as RAC ( Real Application Clusters) from Oracle 9i. Cache-
Fusion has been improvised
Oracle Cluster Manager has been introduced in 9i ( Supports only Windows and Linux),
prior to which there is no Oracle Proprietary Cluster Software. So Oracle has to depend
on other vendors.
In 2003, with 10g, Oracle Clusterware has been introduced
In 2005, with 10gR2 RAC, CVU has been introduced
11gR1 also used Oracle Clusterware
11gR2 introduced Oracle Grid Infrastructure which includes Oracle Clusterware as well
as ASM.
Oracle RAC is certified on most platforms and till 100 Nodes
Storage plays a key role in the Enterprise Infrastructure. Depending on the requirement of
the Project, different storage options can be considered. Storage plays a crucial role in
Database Projects.
A storage architecture defines the way Servers are connected to the storage array units.
Following are some the important storage architectures:
DAS should located physically close to the Node due to the limitations of Distance
and Performance of I/O bus
8
The number of Storage Devices that can be connected is limited so it's not a scalable
option.
The SAN Storage is available to multiple hosts at the same time which makes SAN
Scalable and Flexible.
SAN provides block level I/O access to the hosts where as NAS Provides File Level
I/O Access.
The initial implementation cost is high and requires specialized training to
implement and manage.
SAN provides High Performance, Reliability and High Availability.
9
SAN I/O traffic does not impact the LAN Traffic and the Storage generally not
accessible/reachable by End Users/Applications.
RAW Devices
CFS ( Cluster File System)
ASM ( Automatic Storage Management)
RAW Devices:
A disk or partition where all I/O operations to that device bypass any OS-level caches or
buffers and are delivered immediately to the driver subsystem
Raw devices are disk drives without any file system setup.
Generally found in /dev in unix & linux bases OS’s and are supported for RAC as
they can be shared.
A raw partition can have only 1 file stored in it which is a major disadvantage for
databases with several Datafiles or other files. Managing RAW devices is complex.
RAW devices give better performance compared to other options as there will be no
additional overhead of filesystem.
11gR2 doesn’t support RAW devices during installation but RAW devices can be
used during Upgrades if already being used in older versions
Oracle Cluster File System (OCFS) presents a consistent file system image across the servers
in a cluster. OCFS allows administrators to take advantage of a files system for the Oracle
database files (data files, control files, and archive logs) and configuration files. This eases
administration of the Oracle Real Application Clusters.
OCFS is Oracle proprietary cluster filesystem which is certified only for Linux and Windows
OS’s. OCFS is used rarely in Real-Time implementations. OCFS is not very scalable for
large number of nodes. OCFS has 2 versions: OCFS and OCFS2.
ASM:
ASM (Automatic Storage Management) was introduced in Oracle 10g. ASM provides both
File System and Volume Management capabilities and simplifies the storage management
for DBAs. Most implemented solution in Real-Time from 10g.
10
NFS ( Network File System):
Started by Sun Microsystems as a generic fileserver solution. Originally UNIX-only, some
windows support available today. In the database world, generally dismissed as slow and
unreliable. NFS is certified in both 10g and 11g. It is a less expensive solution for RAC and
easy to use. In Real-Time NAS is not used in large-scale transaction-intensive applications.
NFS supports all types of files to be stored.
ASM
ASM (Automatic Storage Management) was introduced in Oracle 10g. ASM provides both
File System and Volume Management capabilities and simplifies the storage management
for DBAs.
ASM Instance:
An ASM Instance is built on the same technology as an Oracle Database Instance with its
own SGA and Background Processes. However, an Oracle Database Instance is responsible
for processing the user database requests and an ASM Instance mounts the Disk Groups it
manages and makes the ASM Files available to the Database Instances.
ASM Disks:
ASM Disks are storage devices like a Disk or a partition or a logical volume etc.
ASM Files:
These are the files that are stored in ASM Disk Groups. Each ASM file is contained within a
single ASM disk group. Some of the examples of ASM Files are Datafiles, Control Files,
SPFILE, RMAN Backup Files, Online Redo Logs, Archive logs etc
Example:
Have a look at the picture below:
11
In the image, there is an ASM Instance which is being used by 3 Databases. The files(Can a
Data File, Controlfile, Backups etc) related to the 3 databases will be stored in the 2 Disk
Groups A and B. Disk Group A has 3 Disks where as B has only 2 Disks.
Most of the Oracle RAC Configurations use Oracle ASM. Each node in Oracle RAC should
have an ASM Instance. In the above Example, 2 RAC Databases(Each with 2 Nodes) and a
Standalone Database Node are accessing the ASM storage with 2 Disk Groups.
Advantages of ASM:
Oracle proprietary solution addressing both File System and Volume Manager
requirements thereby reducing the dependency on various other File Systems and
3rd party volume managers.
ASM Disk and Disk Group management ( Storage Management ) can be done by
even Oracle DBAs with minimum knowledge on storage using ASMCMD,
Enterprise Manager and even simple SQL Statements thereby reducing the
dependency on dedicated storage administrators.
As a Volume Management solution, it provides Striping and Mirroring features for
better performance and redundancy respectively.
Compatible and certified with Oracle Real Application Clusters (RAC) and RMAN.
12
Oracle Real Application Cluster Basics
13
All the nodes in the cluster will be connected to the Shared Storage to access the same
database.
All nodes will be having atleast 2 NIC Cards: One for Public Network through which the
Clients connect and the other is Privtae Inter-Connect which is used to for Inter-Node or
Inter-Instance communication. For e.g. Cache Fusion
Virtual IP, Introduced in 10g will be there for every node which helps in TAF
(Transparent Application Failover).
Each node in Oracle RAC has 2 Oracle Homes. 1: Oracle Clusterware Home 2: Oracle
RDBMS Home.
Each node has 2 Instances. 1: Database Instance 2: ASM Instance. ASM is an Optional
Storage Option.
Voting Disk and OCR are Oracle Clusterware related files which are in shared
storage and should be accessible by all the nodes in the cluster.
The above picture shows the order of installation and configuration as well which
implies that once the Nodes have OS installed, Oracle Clusterware is installed 1st
followed by Oracle Database Software, ASM and then Oracle Database Creation.
14
Cache Fusion
Cache Fusion involves the ability of Oracle RAC to "fuse" i.e. Combine the in-memory data
cached physically separately on each computer into a single, Global Cache. Cache Fusion
happens with the help of the Private Interconnect.
Cache Fusion improves the performance of the databases as the I/Os are very less when
compared to the previous versions.
The GCS and GES processes, and the GRD collaborate to enable Cache Fusion. The Oracle
RAC processes and their identifiers are as follows:
In an Oracle RAC environment, the ACMS per-instance process is an agent that contributes
to ensuring a distributed SGA memory update is either globally committed on success or
globally aborted if a failure occurs.
The GTX0-j process provides transparent support for XA global transactions in an Oracle
RAC environment. The database autotunes the number of these processes based on the
workload of XA global transactions.
The LMON process monitors global enqueues and resources across the cluster and performs
global enqueue recovery operations.
The LMD process manages incoming remote resource requests within each instance.
The LMS process maintains records of the data file statuses and each cached block by
recording information in a Global Resource Directory (GRD). The LMS 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
part of the Cache Fusion feature.
The LCK0 process manages non-Cache Fusion resource requests such as library and row
cache requests.
15
RMSn: Oracle RAC Management Processes (RMSn)
The RMSn processes perform manageability tasks for Oracle RAC. Tasks accomplished by
an RMSn process include creation of resources related to Oracle RAC when new instances
are added to the clusters.
RSMN: Remote 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.
The Files that belong to Oracle Clusterware and that should be in shared storage are OCR
and Voting Disk.
Oracle Clusterware is installed, entries are added to the /etc/inittab file , the init process
spawns the EVMD, OCSSD, and CRSD processes.
OCR:
Oracle Clusterware uses the Oracle Cluster Registry (OCR) to store and manage information
about the components that Oracle Clusterware controls, such as Oracle RAC databases,
Instances, Listeners, VIPs, and services and any applications.
To ensure cluster high availability, Oracle recommends that you define multiple OCR
locations (multiplex).
1. Oracle Clusterware reads the ocr.loc file (located in the /etc directory on Linux and Unix
systems to determine which applications resources need to be started and the nodes on
which to start them.
2. Oracle uses a distributed shared cache architecture to optimize queries against the
cluster repository. Each node maintains a copy of the OCR in memory.
3. You can have up to five OCR locations. Each OCR location must reside on shared
storage that is accessible by all of the nodes in the cluster
4. You can replace a failed OCR location online if it is not the only OCR location
5. The OCR clients are Oracle Enterprise Manager, the Server Control Utility (SRVCTL), the
OCR configuration utility (OCRCONFIG), OUI or the Database Configuration Assistant
(DBCA)
16
Voting Disks:
Manages node membership by using a health check and arbitrates cluster ownership among
the instances in case of network failures. RAC uses the voting disk to determine which
instances are members of a cluster. The voting disk must reside on shared disk.
If you configure voting disks on Oracle ASM, then you do not need to manually configure
the voting disks. Depending on the redundancy of your disk group, an appropriate number
of voting disks are created.
You should have at least three voting disks, unless you have a storage device, such as a disk
array that provides external redundancy. Oracle recommends that you do not use more than
five voting disks. The maximum number of voting disks that is supported is 15.
CRSd
CRS is installed and run from a different ORACLE_HOME known as ORA_CRS_HOME
( Called as GRID_HOME starting from 11gR2), which is independent of
ORACLE_HOME.
CRSd manages the resources like starting and stopping the services and failing-over the
cluster resources which can be Virtual IP, Database Instance, Listener or Database etc
CRS daemon has two modes of running. During startup and after a shutdown. During
planned clusterware start it is started as ‘reboot’ mode. It is started as ‘restart’ mode after
unplanned shutdown in which it retains the previous state and returns resources to their
previous states before shutdown.
In case of failure of CRSd, it starts automatically without restarting the node.
Manages the Oracle Cluster Registry and stores the current known state in the Oracle
Cluster Registry.
Runs as ‘root’ on Unix and ‘LocalSystem’ on windows and automatically restarts in case
of failure.
CRS requires the public interface, private interface and the Virtual IP (VIP) for the
operation. All these interfaces should be up and running, should be able to ping each
other before starting CRS Installation. Without the above network infrastructure CRS
cannot be installed.
Command: ps -ef | grep crsd
OCSSd
It maintains membership in the cluster through a special file called a voting disk (also
referred to as a quorum disk). This is the first process that is started in the Oracle
Clusterware stack.
OCSS in Stand-alone Databases using ASM is used for the inter-instance communication
and in RAC environments, identified a Clustered Configuration.
OCSS reads OCR to locate VD and reads the VD to determine the number and names of
cluster members.
CSS verifies the number of nodes already registered as part of the cluster. After
verification, if no MASTER node has been established, CSS authorizes the verifying node
to be the MASTER node. This is the first node that attains the ACTIVE state. Cluster
synchronization begins when the MASTER node synchronizes with the other nodes
17
OCSSd offers Node Membership(NM) and Group Membership(GM) services.
The NM checks the heartbeat across the various nodes in the cluster every second. If the
heartbeat/node members do not respond within 60 seconds, the node (among the
surviving nodes) that was started first (master) will start evicting the other node(s) in the
cluster.
All clients that perform I/O operations register with the GM (e.g., the LMON, DBWR).
Reconfiguration of instances (when an instance joins or leaves the cluster) happens
through the GM. When a node fails, the GM sends out messages to other instances
regarding the status.
EVMd
It receives the FAN events posted by the clients and propagates the information to the other
nodes. Failure of EVMd doesn't require node reboot and restarts automatically.
It is spawned by init.evmd wrapper script. It starts evmlogger child process which scans the
callout directory and starts racgevt process to execute the callouts.
ONS:
It is a publish and subscribe service for communicating Fast Application Notification (FAN)
events to clients. Whenever the state of resource changes in the cluster nodes, CRS triggers
a HA event and routes them to the ONS process which propagates the information to other
cluster nodes
OProcd
OPROCd serves as the I/O fencing solution for the Oracle Clusterware. It is the process
monitor for Oracle Clusterware and it uses the hang check timer for the cluster integrity so
that the hanging nodes cannot perform any I/O. Failure of the OPROCd process causes the
node to restart.
18
In 11gR2 Clusterware Processes have systematically organized into several
component groups as show below:
When you have Oracle RAC installed, the crsd process monitors the Oracle
database instance, listener, and so on, and automatically restarts these
components when a failure occurs. When a CRS resource fails, the CRS daemon
attempts to restart it, if the resource is so configured. CRS fails the resource over
to another node (again, if it is configured to do so) after exhausting restart
attempts.
Cluster Synchronization Service (CSS): Manages the cluster configuration by
controlling which nodes are members of the cluster and by notifying members
when a node joins or leaves the cluster. If you are using certified third-party
clusterware, then CSS processes interfaces with your clusterware to manage node
membership information. CSS has three separate processes: the CSS daemon
(ocssd), the CSS Agent (cssdagent), and the CSS Monitor (cssdmonitor). The
cssdagent process monitors the cluster and provides input/output fencing. This
service formerly was provided by Oracle Process Monitor daemon (oprocd), also
known as OraFenceService on Windows. A cssdagent failure results in Oracle
Clusterware restarting the node.
Disk Monitor daemon (diskmon): Monitors and performs input/output fencing
for Oracle Exadata Storage Server. As Exadata storage can be added to any
Oracle RAC node at any point in time, the diskmon daemon is always started
when ocssd is started.
Multicast domain name service (mDNS): Allows DNS requests. The mDNS
process is a background process on Linux and UNIX, and a service on Windows.
Oracle Grid Naming Service (GNS): Is a gateway between the cluster mDNS
and external DNS servers. The GNS process performs name resolution within the
cluster.
oraagent: Extends clusterware to support Oracle-specific requirements and
complex resources. It runs server callout scripts when FAN events occur. This
process was known as RACG in Oracle Clusterware 11g Release 1 (11.1).
19
Oracle root agent (orarootagent): Is a specialized oraagent process that helps
CRSD manage resources owned by root, such as the network, and the Grid
virtual IP address
Cluster kill daemon (oclskd): Handles instance/node evictions requests that
have been escalated to CSS
Grid IPC daemon (gipcd): Is a helper daemon for the communications
infrastructure
The overall Clusterware Stack startup Sequence can be understand using the below
picture:
20
12c Oracle Real Application Clusters:
Oracle Flex ASM - This feature of Oracle Clusterware 12c claims to reduce per-node
overhead of using ASM instance. Now the instances can use remote node ASM for any
planned/unplanned downtime. ASM metadata requests can be converted by non-local
instance of ASM.
ASM Disk Scrubbing - From RAC 12c, ASM comes with disk scrubbing feature so that
logical corruptions can be discovered. Also Oracle 12c ASM can automatically correct
this in normal or high redundancy diskgroups.
Oracle ASM Disk Resync & Rebalance enhancements.
Application Continuity (AC) - is transparent to the application and in-case the database
or the infrastructure is unavailable, this new features which work on JDBC drivers,
masks recoverable outages. This recovers database session beneath the application so
that the outage actually appears to be delayed connectivity or execution. Transaction
guard (improvements of Fast Application Notification).
IPv6 Support - Oracle RAC 12c now supports IPv6 for Client connectivity, Interconnect
is still on IPv4.
Per Subnet multiple SCAN - RAC 12c, per-Subnet multiple SCAN can be configured per
cluster.
Each RAC instance opens the Container Database (CDB) as a whole so that versions
would be same for CDB as well as for all of the Pluggable Databases (PDBs). PDBs are
also fully compatible with RAC.
Oracle installer will run root.sh script across nodes. We don't have to run the scripts
manually on all RAC nodes.
new "ghctl" command for patching.
TAF is extended to DML transactions failover (insert/update/delete).
21
Installing Oracle 12c RAC on OEL7
Installing Oracle 12CR1 RAC on OEL 7.2 Using Virtual Box at the LAB:
The following explains how to install a 2 nodes Oracle 12c Real Application Cluster
(RAC) on Oracle Linux 7. I did this installation on Oracle Virtual Box by creating 2
virtual machines with shared storage. OS platform I used is Oracle Enterprise Linux
7, and Oracle GI and RDBMS version is 12.1.0.2.
My environment:
Prerequisites
Prepare all the nodes by installing Oracle Linux 7 with all selected packages during
installation. Have private interconnects setup, and shared storage mounted on all the
nodes. Have 2 public IPs, 2 virtual IPs, 2 private IPs, 1 dns IP and 3 SCAN IP (from
public subnet), which we will use later during the installation. For this article, node
names for are as follows
Public
racnode1.oracle.com
racnode2.oracle.com
Virtual
racnode1-vip.oracle.com
racnode2-vip.oracle.com
Private
racnode1-priv.oracle.com
racnode2-priv.oracle.com
Dns
dns.oracle.com
22
Perform Oracle RAC Installation Prerequisites:
Now we start the installation. Following are the steps to install Oracle 12c RAC on Linux.
Here we are assuming that all the nodes are installed with all packages and up and running.
1) On each node, edit /etc/selinux/config and set value for SELINUX to either
“permissive” or “disabled”
SELINUX=disabled
2) On each node, configure Shared Memory File System. Add following line in /etc/fstab
file for shared memory file system. Modify the value of “size” based on the amount of
memory you will be using for your SGA.
5) On each node, in /etc/host file, add the IP addresses and fully qualified names of each
node of RAC, including public IPs; virtual IP; private IPs .
#Public
192.168.1.101 racnode1.oracle.com racnode1
192.168.1.102 racnode2.oracle.com racnode2
#Virtual
192.168.1.201 racnode1-vip.oracle.com racnode1-vip
192.168.1.202. racnode2-vip.oracle.com racnode2-vip
#Private
192.168.2.101 racnode1-priv.oracle.com racnode1-priv
192.168.1.102 racnode2-priv.oracle.com racnode2-priv
#Dns
192.168.1.100 dns.oracle.com dns
Make sure that Public interface and Private interfaces have the same name and they list in
same order on all the nodes, in ifconfig command (my public interface name is enp0s3 and
private interface name is enp0s8)
23
6) Test the nodes connectivity with each other using ping command from each node to the
other node(s). SCAN IP and Virtual IPs are not required to be tested at this point.
7) We can perform automatic configuration of the node using “yum” command. If you want
to do manual configuration, skip this step and go to next step.
As already mentioned, above command will install all required packages which are needed
for grid infrastructure and/or RDBMS software installation.
# Oracle user
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728
24
8) Skip this step if you have followed Step 7 above; otherwise perform following tasks
on each node.
Install following RPM packages (or latest version) from either yum repository or from Linux
7 media
binutils-2.23.52.0.1-12.el7.x86_64
compat-libcap1-1.10-3.el7.x86_64
gcc-4.8.2-3.el7.x86_64
gcc-c++-4.8.2-3.el7.x86_64
glibc-2.17-36.el7.i686
glibc-2.17-36.el7.x86_64
glibc-devel-2.17-36.el7.i686
glibc-devel-2.17-36.el7.x86_64
libaio-0.3.109-9.el7.i686
libaio-0.3.109-9.el7.x86_64
libaio-devel-0.3.109-9.el7.i686
libaio-devel-0.3.109-9.el7.x86_64
ksh
make-3.82-19.el7.x86_64
libXi-1.7.2-1.el7.i686
libXi-1.7.2-1.el7.x86_64
libXtst-1.2.2-1.el7.i686
libXtst-1.2.2-1.el7.x86_64
libgcc-4.8.2-3.el7.i686
libgcc-4.8.2-3.el7.x86_64
libstdc++-4.8.2-3.el7.i686
libstdc++-4.8.2-3.el7.x86_64
libstdc++-devel-4.8.2-3.el7.i686
libstdc++-devel-4.8.2-3.el7.x86_64
sysstat-10.1.5-1.el7.x86_64
unixODBC-2.3.1
On each node, edit /etc/sysctl.conf add following entries to set kernel parameters
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
25
Execute following command after adding above lines
/sbin/sysctl -p
On each nodes, edit the /etc/security/limits.d file to set shell limits for oracle user.
# Oracle user
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728
9) On each node, install oracleasm-support and oracleasmlib rpm’s , and then configure
oracleasm.
oracleasm kernel driver is built in Oracle Linux and does not need to be installed.
Install oracleasm-support from yum repository or from Linux media, then download
oracleasmlib package form the following URL, and install.
http://www.oracle.com/technetwork/server-storage/linux/asmlib/ol7-2352094.html
26
10) On each node, stop and disable NTP (Network Time Protocol)
During the installation, Cluster Time Synchronization Service would be installed and used
instead or NTP.
Add the scan name, scan IP’s and all the racnode IP’s in the /var/named/localdomain.zone
file as follow. Here I used scan name as ‘rac-scan’.
27
Enable and restart the named service on the dns server a follow.
12) On each rac node, make sure /etc/resolv.conf file contain entries similar to the
following. Replace oracle.com with your domain name and 192.168.1.100 with your names
server IP address
search localdomain
nameserver 192.168.1.100
Execute the following command as root user to prevent overwriting the /etcresolv.conf on
network reboot or system reboot.
chattr +i /etc/resolv.conf
With this in place and the DNS configured the SCAN address is being resolved to all three
IP addresses on each node.
28
29
13) On each rac node, install cvuqdisk RPM
This is required for cluvfy (Cluster Verification Utility) to work properly to discover shared
disks, otherwise an error will be reported while running cluvfy. Log in as root and execute
following steps
Set the environment variable CVUQDISK_GRP to point to the group what will own
cvuqdisk, which is oinstall group
[root@racnode1 ~]# export CVUQDISK_GRP=oinstall
Install cvuqdisk which will be found under unziped Grid Infrastructure software
14) On each node, create directories and change ownership to respective users.
15) From any racnode, create the shared disks as follows. You can use other ways also for
configure shared storage for all nodes.
30
Go to setting and click on the storage and click button add hard disks to create a disk.
31
32
Make the created disks as shared disks between all the node as follows.
From Virtual media manager settings, Select the disk and click on Modify button at the top
of screen.
33
Select the Sharable and click on ok button.
Go to racnode2 setting and select storage options and click on add hard disks button.
Click on choose existing hard disk.
34
Select created sharable disks from the path.
35
Start the machines and execute the below command as root user.
# fdisk -l
For simplicity, after executing command fdisk for each disk, press following sequence keys
n, p, 1, <enter>, <enter>, w to create new partitions for each disk
36
After the partitioning completes, following are my partitioned disks
16) From any node, Create the disks as asmdisks as shown below by using oraclasm.
37
Execute “oracleasm scandisks” and “oracleasm listdisks” command on all other nodes
also and you should be able to see all the ASM disks.
From the other node(s), issue following as root user
38
17) On each node, add IO scheduler for ASM disks. Modify highlighted disks names to
match your environment.
Add the following to the "/etc/scsi_id.config" file to configure SCSI devices as trusted.
Create the file if it doesn't already exist.
options=-g
39
[root@racnode1 ~]# KERNEL=="sd?1", SUBSYSTEM=="block",
PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent",
RESULT=="1ATA_VBOX_HARDDISK_VBf72914ad-884ce4f5",
SYMLINK+="oracleasm/ASMDATA1", OWNER="oracle", GROUP="dba", MODE="0660"
umask 022
This will fail if user equivalence (passwordless ssh login) has not been configured from each
node to other node. Passwordless login using ssh is also optional at this point, because
installer will allow us to configure user equivalence during the installation wizard as you
will see in a while.
21) Start installation from the extracted software directory (/u01/stage/grid), execute
“./runInstaller” to begin the installation
40
Select “Install and configure Oracle Grid Infrastructure for a cluster “ from the given
options and click on next button.
41
Select “Configure a Standard cluster “and click on next.
42
Select a language from the available options.
Enter the SCAN name and uncheck the configure GNS button.
43
In this window click on “Add button” and add the second rac node public hostname
and virtual hostnames.
Click on “SSH connectivity” and enter the password oracle user. Click on setup
button to configure ssh connectivity between the node. After successful ssh setup
click next button.
44
Select the private and public interfaces for grid infrastructure and click on next
button.
Accept the default “Use standard ASM storage” as we are going to configure grid
with ASM storage and click next.
45
Select the storage and select the redundancy and show in below picture.
46
If You want to configure the enterprise manager cloud control then select the “
Register with Enterprise manager (EM) Cloud Control “ or uncheck it and click next
to proceed installation.
47
Enter the related groups for each in this section and go with next.
48
Select the Inventory location and click on next button.
If You want to run Root scripts automatically enter the password for root user or you
can manually run the root scripts.
49
The window will perform the pre requisite checks and list the warnings and errors as
. Make sure that no errors will be present in this screen before doing to proceed with
installation. The below warnings can be ignored safely.
Review the listed information and click on install button at the bottom.
50
The installation will process and wait for the installation to complete.
The successful installation will display the below screen. Click on close button to
close the installation window.
51
Install the Database Software
Start the virtual machines racnode1 and racnode2. Check that all services are up using "crsctl
stat res -t", as described before.
Create the required directories on both nodes and set the permissions for oracle user
as below.
Login to racnode1 as the oracle user and start the Oracle installer from the database
software stage location.
$ cd /u01/stage/database
$ ./runInstaller
52
Uncheck the security updates checkbox and click the "Next" button and "Yes" on the
subsequent warning dialog.
53
Select the "Install database software only" option, then click the Next button.
Accept the default "Oracle Real Application Clusters database installation" option by
clicking the "Next" button.
54
Select the racnode2 and click on next.
Select the languages from given list and click on next button.
55
Select the "Enterprise Edition" option, then click the "Next" button.
Give the locations for Oracle base and Oracle home installation location.
56
Select the desired operating system groups, then click the Next button.
It will perform prerequisite check and list the errors and warning. If there are no
warning it displays the summary information.
57
Click on install button to start the installation.
58
When prompted, run the configuration script on each node as in give order. When
the scripts have been run on each node, click the "OK" button.
The successful installation shows the below screen. Click on close button to exit.
59
12c RAC Database creation using DBCA
Start the racnode1 and racnode2 machine and login as oracle user. Go the oracle home
software location and run “database configuration assistance”.
[ oracle@racnode1 ~] $ cd /u01/app/oracle/product/12.1.0.2/bin
[ oracle@racnode1 ~] $ ./dbca
The database creation window will display as shown below. Select “create database”
and click on next button.
60
Select “General purpose or Transaction processing” and click in next .
61
Enter the Global database name and SID for database. Click on next.
Uncheck the box for “Configure Enterprise manager” and go with next to proceed.
62
Enter the database administrative passwords and click on next.
63
Select “Database files storage type” as ASM and make the required the changes.
Click on next button to continue installation.
Change the database options as per your requirement and click on next button.
64
Change the size of memory, character set and connection mode setting in this screen
as required and click on next button.
Select “Create the database” and click on Next to proceed with database creation.
65
The installation wizard will perform prerequisite checks and display the summary
screen as shown below. Click on “Finish” button to start the database creation.
66
When the database creation completed, click the "Close" button to exit installer.
67
Spfile: +DATA/PROD/spfilePROD.ora
Domain:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
OSOPER group:
68
Upgrading Database and Oracle RAC
Necessity of Applying Patches
A Database Internal Error/Bug is causing Application/Database unavailability
or Severe Performance Issue
End of Support for a Particular Database version. For e.g 11gR2 Support
extended support ends in Jul-20. So the customers should consider upgrading to
12c seriously. Customers can apply Patchsets or Upgrading to any new Major
Release based on the requirement
A CPU/PSU patch needs to be applied
Due to EOL for Hardware or for reduction overall TCO, Customers might
consider H/W as well as Platform migration which requires to Install Softwares ,
Applying Patches, Patchsets etc
For getting new features which Improves Performance, Stability, Administration.
For e.g. ACFS in 11g, AWR & ASH in 10g etc
Types of Patches:
Merge level request patch In case of Conflict with existing one-off, Oracle
(MLR) development can be asked to provide a merged set of
these patches.
Patch Set Updates (PSU) Patch Set Updates bundle previously separate patches in
given product areas together
Patch set To apply a Point Release. For e.g. Patch set for Upgrading
from 11.2.0.3 to 11.2.0.4
69
How to Upgrade a Database:
There are different methods to upgrade an Oracle Database but the DBA has to
choose the Best method based on the Current Database Size, Version , OS, Data
Complexity, Downtime etc
DBUA
Manual Upgrade
Data Pump Export & Import , Export & Import
TTS
Oracle Data Guard SQL Apply
Oracle Streams & Golden Gate
DBUA is the most preferred method. Here we are going to demonstrate how we can
upgrade a real application cluster database to 12.1.0.2 using DBUA.
Copy and unzip Oracle grid and database 12.1.0.2 software and run Oracle
universal installer as oracle user
70
Select the option to upgrade the clusterware as below,
Select the desired language and in the next screen setup ssh connectivity
between the nodes and proceed to the next screen
71
If your environment has Oracle cloud control configured and if you wish to
add the clusterware as a managed target, enter the required configuration
details otherwise skip this step and proceed. The clusterware can be added as
managed target even after the upgradation completes.
72
Select the OS groups that will be used for OS authentication to ASM
Select the location of Oracle base and give the path for new clusterware
location which was created earlier.
73
From 12c, OUI is capable of running post install root scripts if we supply root
credentials in this step. Or you can choose to manually run root scripts by
clicking next.
74
In 12c, root scripts can be executed in batches. Root scripts are executed
simultaneously on every node in a batch and batches are run one after the
other and will ask for confirmation before executing the scripts in a new
batch. Batches can be specified based on number of nodes and you can specify
up to 3 batches.
Oracle universal installer will now perform prerequisite checks and if all the
checks are passed, start the upgradation.
75
76
The installer will ask for confirmation before executing root scripts as shown
above. Click Yes to start executing root scripts. This finishes the upgradation
of clusterware.
77
Check the version of clusterware using this command to verify the successful
upgradation,
Enter Oracle support credentials or uncheck the box and click next if you do
not want to receive any security updates.
78
Select “Install database software Only” option from the available options and
click next,
79
Select all the nodes where you want to install Oracle RAC database software.
And also setup password less ssh connectivity by supplying the OS
credentials of the user performing the install. Then click next.
Select desired language and the edition of the database to install and click
next,
80
Specify the path to Oracle base and also give location for installing new
database software. Make sure the user performing the installation has
required permissions on the directory. Then click next,
81
Assign appropriate OS user groups for operating system authentication.
Oracle universal installer will now perform prerequisite checks for database
software installation. Below screen is displayed if all the checks are passed.
Click “Install” to start the installation. Ensure that all the prerequisites are met
before starting the installation.
82
Run the root scripts in the specified order in all cluster nodes. Note that
database installer cannot run root scripts by itself as shown during grid
infrastructure upgrade in section 1. They have to be manually run as root
user.
After the root scripts run successfully, click “Ok” to finish the database
software installation
83
Section 3: RAC database upgrade to 12c
Start the database upgrade assistant (DBUA) from the newly installed oracle
home from section 2. The DBUA executable can be found under
“$ORACLE_HOME/bin”. On the initial screen, select the option “Upgrade
Oracle Database” and click next.
This screen will list all the instances running in the server. Select the database
you want to upgrade and click “Next”.
Note: If the database you want to upgrade is not listed, check the contents of
“/etc/oratab” for an entry of the running instance.
84
DBUA will run prerequisite checks display any errors or warnings if found,
It can be seen from below screen that few components have given warnings
during prerequisite checks. As these components can be reconfigured or
upgraded after the database upgradation, click “Next” to ignore and proceed
to next step.
85
You can specify the upgrade parallelism for speeding up the upgrade process.
The parallelism should be defined appropriately based on available resources
(No.of CPUs). Check the option to recompile invalid objects post upgradation.
If you want to run gather schema statistics or upgrade time zone, you can do it by
checking the respective boxes. Specify the location of diagnostic and audit file
destination or leave it to default location as shown. Custom sql scripts can be run by
giving their location under “Custom SQL Scripts” tab.
86
Configure a backup and restore strategy for the database in case the
upgradation fails midway. If that happens this backup will be used to restore
the database to original state. DBUA can take a new rman backup of the
database before starting upgrade or if you have already taken the backup, you
can select “I have my own backup and restore strategy” and click next.
Note that if you select this option DBUA will not take any backup prior to starting
the upgrade.
87
A summary screen will be displayed as below. In this screen we can see the
current database version and the version to which the database is going to be
upgraded, the status of the database instances, and any changes DBUA is
going to make to initialization parameters.
DBUA will start the upgradation now and the progress can be seen on the
status bar. Depending on the amount of resources available and the size of
database, the upgradation can take very long time. Therefore patiently wait
for the upgrade to complete and keep checking the alert log for any errors.
88
When the status bar reaches 100%, it means the upgrade has completed
successfully. Click on “Upgrade Results” to view the current version of the
database which is 12.1.0.2 and also the status of instances. If you wish to
revert back to 11g, click on “Restore Database” and proceed with the steps to
fully restore the database using the backup and restory strategy configured
earlier.
This completes the Upgradation of Oracle Grid Infrastructure and Oracle RAC
Database from 11.2.0.4 to 12.1.0.
89
Applying latest PSU to 12.1.0.2:
Go to support.oracle.com and Search with “12.1.0.2 PSU”
Check the latest version of the PSU and Download it for the respective OS
Make sure the latest version of Opatch is downloaded with the help of the patch
6880880 and Unzip it in OH
Shutdown all the services of the OH
Unzip the Patch and run “opatch apply”
The Services related to the Clusterware, Other Oracle Homes need to be properly
shutdown before Applying the patches
Backup of Database (Using RMAN is Recommended), OCR, Voting Disk, Control File etc
is recommended
Applying Patches or Upgrading should/will be done only from one of the Nodes and
the Updates to the other nodes are propagated automatically.
10g to 11gR1 is almost the same however 10gR2 to 11gR2 is different because of Grid
Infrastructure
90
Clusterware Administration:
CRSCTL:
CRSCTL is one of the key tools to manager Oracle Clusterware using which the Clusterware
processes and resources can be stopped and started. It is also useful in debugging the
Clusterware related issues and find the root cause quickly. The following are some of the
important CRSCTL syntaxes and the uses:
crsctl query css votedisk - To list the voting disks used by CSS
crsctl stop crs - stops all CRS daemons. Stops CRS resources in case of cluster.
crsctl debug statedump evm - dumps state info for evm objects
crsctl debug statedump crs - dumps state info for crs objects
crsctl debug statedump css - dumps state info for css objects
crsctl query crs softwareversion [<nodename>] - lists the version of CRS software installed
crsctl query crs activeversion - lists the CRS software operating version
91
CRS_STAT:
It is used for monitoring the status of the Clusterware resources and the state of the
resources.
OCRCHECK:
OCRCONFIG:
This utility is used to manage the OCR File and can be used to perform the following:
92
CLUVFY:Cluster Verification Utility (CLUVFY ) is the most important which is used during
Installation of Oracle RAC with the help of which, the DBAs can validate their installation
progress at different stages of Installation.
93
e.g.
The following syntax is used to validate the installation of Clusterware and the current state
to confirm whether we can proceed with the next step of Installation process
Workload Management
Load balancing is one of the significant features of Oracle RAC which improves the overall
performance. This is achieved by distributing the Workload efficiently between the available
Oracle RAC nodes.
Oracle performs workload distribution using connection balancing. In other words, all load
balancing activity is performed before a session establishes a connection. Once the
connection has been established to a specific instance, the session will communicate with the
same instance until either the session or the instance terminates.
JDBC Example:
url="jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=TCP)(HOST=raclinux1-vip.localdomain)(PORT=1522))
(ADDRESS=(PROTOCOL=TCP)(HOST=raclinux2-vip.localdomain)(PORT=1522))
(CONNECT_DATA=(SERVICE_NAME=RACDB_MAIN)))"
When the LOAD_BALANCE parameter is set to ON, Oracle Net will select a node at
random from the list of addresses to establish a connection with the various listeners. No
load metrics are used for distributing work.
Client-side connection balancing works well if all instances are registered. Prior to Oracle
10.1, client-side connection balancing did not detect blocked, failed, or hung instances,
which could lead to skewed connection loads on each node. In Oracle 10.1, the combination
of Virtual IP (VIP) and Fast Application Notification (FAN) can be used to detect failed
instances.
94
One of the main disadvantages of this method is it is unaware of the existing load on the
nodes and therefore does not take account of how many other clients are currently
connected to the node or of the current workload on the node.
In Oracle 10.2 and above, RAC includes a load balancing advisory which can supply
information to OCI, ODP.NET, and JDBC connection pools. Third-party applications can
subscribe to the load balancing advisory using the Oracle Notification Service (ONS). The
load balancing advisory monitors the current workload for each service in the instance and
creates FAN events.
LISTENER_RACDB = (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = raclinux1-vip.localdomain)
(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST = raclinux2-vip.localdomain)
(PORT = 1522))
Transparent Application
(CONNECT_DATA = Failover:
(SERVICE_NAME = RACDB_MAIN)))
Transparent Application Failover (TAF) is an Oracle RAC feature that can completely mask
many failures from end-users, by preserving the state of their application and resuming any
work that had been in progress at the time of failure. TAF also provides developers with
tools to build applications that leverage TAF and make all failures, including those affecting
transactions, transparent to end-users.
95
Fast Connection Failover:
Starting with Oracle 10g, the TAF policy for JDBC thin and JDBC OCI drivers is supported
by setting up a new Fast Connection Failover (FCF) feature.
Services
Services are groups or classifications of applications that comprise business components that
extend and respond to application workloads. Examples of services are Accounts Payable
(AP), Customer Relationship Management (CRM), and so on. Services in RAC enable
continuous, uninterrupted database operations to support multiple services on more than
one instance.
Services can be created when you create a Real application Cluster (RAC) database. and
assign them to instances using the DBCA. After your RAC database is operational, you can
administer services and high availability using the DBCA, as well as Enterprise Manager
and SRVCTL.
SRVCTL:
You can create and administer services using SRVCTL utility, DBMS_SERVICE PL/SQL
package and Enterprise Manager.
srvctl start service -d name [-s service_name_list] [-i inst_name] [-o start_options] [-c
connect_str | -q]
srvctl stop service -d name -s service_name_list [-i inst_name] [-o start_options] [-c
connect_str | -q]
96
Enabling and Disabling Services with SRVCTL:
You may have to relocate services sometimes from one instance to other
SRVCTL can also be used for managing several resources like Node Apps, Instances,
Databases etc It is tightly integrated with Clusterware.
ASM:
srvctl status asm -n nodename
srvctl config asm -n nodename
Database:
97
srvctl status instance -d dbname -i instancename
srvctl start instance -d dbname -i instancename
srvctl stop instance -d dbname -i instancename
Issue the dd command to back up a voting disk, as appropriate. In the following examples,
voting_disk_name is the name of the active voting disk and backup_file_name is the name
of the file to which you want to back up the voting disk contents:
dd if=voting_disk_name of=backup_file_name
If you have multiple voting disks, then you can remove the voting disks and add them back
into your environment using the following commands, where path is the complete path of
the location where the voting disk resides
To retrieve the current voting disk used by CSS, issue the following command:
To add a voting disk, issue the following command as the root user, replacing the path
variable with the fully qualified path name for the voting disk you want to add:
98
crsctl add css votedisk path -force
To move a voting disk, issue the following commands as the root user, replacing the path
variable with the fully qualified path name for the voting disk you want to move:
Manual backups—This feature has been introduced from 11g. Use the ocrconfig -
manualbackup command to force Oracle Clusterware to perform a backup of the OCR
at any time, rather than wait for the automatic backup that occurs at 4-hour intervals.
The -manualbackup option is especially useful when you to need to obtain a binary
backup on demand, such as before you make changes to the OCR.
Note:
If the OCR resides on a cluster file system file or if the OCR is on a network file system, then
create a dummy file before performing the procedures in this section.
As the root user, issue the following command to add an OCR location using either
destination_file or disk to designate the target location of the additional OCR:
Run the following command to add an OCR mirror location using either destination_file or
disk to designate the target location of the additional OCR:
Run the following command on any node in the cluster to remove the OCR device:
99
Run the following command on any node in the cluster to remove the mirrored OCR device:
OCR Import/Export
The OCR Import/Export commands can also be used as an alternative for backup and
recovery of OCR
ASM supports OCR and Voting Disk files from 11gR2. The OCR is striped and mirrored (if
we have a redundancy other than external), similar as ordinary Database Files are. So we can
now leverage the mirroring capabilities of ASM to mirror the OCR also, without having to
use multiple RAW devices for that purpose only. The Voting Disk (or Voting File, as it is
now also referred to) is not striped but put as a whole on ASM Disks – if we use a
redundancy of normal on the Diskgroup, 3 Voting Files are placed, each on one ASM Disk.
This is a concern, if our ASM Diskgroups consist of only 2 ASM Disks! Therefore, the new
quorum failgroup clause was introduced:
The failgroup fg3 above needs only one small Disk to keep one Mirror of the Voting File. fg1
and fg2 will contain each one Voting File and all the other stripes of the Database Area as
well, but fg3 will only get that one Voting File.
Voting File is no longer supported to be taken a manual backup of it with dd. Instead, the
Voting File gets backed up automatically into the OCR.
ACTIVE_INSTANCE_COUNT
CLUSTER_DATABASE
CLUSTER_DATABASE_INSTANCES
100
COMPATIBLE
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 (RDBMS or ASM)
PARALLEL_MAX_SERVERS
REMOTE_LOGIN_PASSWORDFILE
RESULT_CACHE_MAX_SIZE
UNDO_MANAGEMENT
INSTANCE_NUMBER
THREAD
ROLLBACK_SEGMENTS
UNDO_TABLESPACE
INSTANCE_NAME
ARCHIVE_LAG_TARGET
CONTROL_MANAGEMENT_PACK_ACCESS
LICENSE_MAX_USERS
LOG_ARCHIVE_FORMAT
SPFILE
UNDO_RETENTION
101
DB_RECOVERY_FILE_DEST and DB_RECOVERY_FILE_DEST_SIZE parameters to the
same values on all instances. Recommended Configuration is using ASM with different Disk
Groups other than once being used for Data Files.
In an Oracle RAC environment, each instance will have its own set of online redolog files
known as a thread. Each Oracle instance will use its set (group) of online redologs in a
circular manner. Once an online redolog fills, Oracle moves to the next one. If the database is
in "Archive Log Mode", Oracle will make a copy of the online redo log before it gets reused.
A thread must contain at least two online redologs (or online redolog groups).
An instance does not need access to the archived redo log files from a different instance
except when performing backup or recovery operations.
export ORACLE_SID=prod1
sqlplus '/as sysdba'
SQL> alter system set cluster_database=false scope=spfile sid='prod1';
System altered.
SQL> exit
srvctl stop database -d prod
sqlplus '/as sysdba'
SQL> startup mount
SQL> alter database archivelog;
Database altered.
SQL> alter system set cluster_database=true scope=spfile sid='prod1';
System altered.
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
srvctl start database -d prod
sqlplus '/as sysdba'
SQL> archive log list;
102
Troubleshooting Oracle RAC:
Before understanding different techniques of troubleshooting Oracle RAC Issues, it is
important to understand some basic commands to monitor services and locations of some
important files.
ocrcheck
or
crs_stat -t
A RAC DBA might possibly face several issues which might be related to Clusterware Stack,
Resources, OCR & Voting Disk etc.
Debugging Resources:
In the below example while trying to start the resources, if we get the issue like below:
We can debug any resources with the help of crsctl command as below:
$CRS_HOME/log/<hostname>
Debugging Components:
We can also debug the Clusterware components i.e. CRS, EVM, OCSS etc
103
diagnostics provide additional information so Oracle Support can resolve problems. Run
this script from the following location:
CRS_home/bin/diagcollection.pl
CRS_home/log/hostname/alerthostname.log
104
Troubleshooting OCR & VOTING DISK:
Failed or corrupted Vote Disks:
Implement multiple copies of the vote disk on different disk volumes to eliminate
Single Point of Failure.
Make sure that you take regular backups for vote disks with the dd utility
(Unix/Linux) or copy utility (Windows)
The Same dd command can be used in Linux/Unix to restore the backup Voting
Disk
Without a backup of the vote disk, CRS should be reinstalled.
Both OCR and Voting Disks are always recommended to be kept in different disks to avoid
single point of failure.
ocrconfig –showbackup
OS Messages files:
Linux: /var/log/messages
Sun: /var/adm/messages
HP-UX: /var/adm/syslog/syslog.log
IBM: /bin/errpt -a > messages.out
105
Common Causes:
OS Watcher:
OS Watcher (OSW) is a collection of UNIX shell scripts intended to collect and archive
operating system and network metrics to aid support in diagnosing performance issues.
OSW operates as a set of background processes on the server and gathers OS data on a
regular basis, invoking such Unix utilities as vmstat, netstat and iostat.
OS watcher can be downloaded from My Oracle Support " Doc ID: 301137.1"
Once the tar file downloaded is extracted, from the the extracted directory, run
e.g. Configure OS Watcher to take snapshots with the system utilities at every 5 minutes for
the last 24 hours.
106
12c RAC New Features:
Oracle Flex Cluster 12c
Oracle Clusterware, in the original design, is a tightly coupled clustering solution which
requires shared storage and shared network between all servers in the cluster. This is a
requirement when Oracle Clusterware is installed for Oracle databases - RAC and single
instance. This tightly coupled cluster is required to preserve data integrity of multi-instance,
shared cache clustered databases. Oracle 12c introduces an innovative clustering solution -
Oracle Flex Cluster which relaxes the tightly coupled nature of Oracle Clusterware and
permits the collocation of applications and the RDBMS in a common Oracle Flex Cluster. In
the Oracle Flex Cluster, the database tier, composed of 'HUB' servers, preserves the tightly
coupled configuration, while the application tier, composed of 'LEAF' servers, is loosely
coupled and does not require shared storage and peer-to-peer communication with other
servers in the cluster. This innovative tightly coupled/loosely coupled clustering solution
provides far greater scalability without compromising the availability and resource
management expected in high performance, and very large scale consolidations.
Oracle Flex Clusters extends the availability and management features well known in Oracle
Real Application Clusters to the application tier. In the initial 12c release, Oracle Flex Cluster
is designed for collocation of applications and the RDBMS in a common cluster using the
HUB-LEAF deployment model described above.
The collocation of applications and the database in a common cluster offers far greater
availability and ease of management between application components and the database,
where start, stop ordered dependencies, and placement may be defined and automated.
Specifically, applications may depend on components outside of the respective application
management domain. Customers either execute the start up of these various components
manually, or, they maintain cumbersome scripts in an attempt to automate. For example, a
PeopleSoft application may have a WebLogic component and a Tuxedo component, each of
which are managed within their respective domains. Oracle Flex Cluster allows you to
manage these components collectively while maintaining secure, isolation management
between the components. And if the database is not up, the dependency model can be
extended between the application and database tiers allowing the application to pull up the
database or, if the application tier is down, the database startup would start the application
components on the correct servers in the correct order. The entire process, application tier
start up with correct startup order and placement and database/application tier pull-up - is
fully automated.
Oracle Flex Cluster is compatible with the Oracle Clusterware Agents. These Agents,
developed by Oracle Clusterware engineering and the respective application engineering
groups, are fully integrated to provide high availability (HA) and online relocation services
for applications running in the Oracle Flex Cluster. The dependencies described above are
implicitly configured by Oracle and can extend between the application and the database.
107
The Agents allow for applications to define start and stop dependencies on database services
or the databases directly
The above figure illustrates the Oracle Flex Cluster coupled with no shared storage or peer
cluster. A LEAF node has a loose communication association with a single HUB node in the
cluster.
Oracle Flex Cluster is the innovative clustering solution to preserve and protect business
critical functions and insures continuous, automated availability for application and
database services.
As noted earlier, Oracle Flex Cluster is designed for optimal scalability where shared storage
and peerto-peer communication is restricted to the HUB tier. This design supports very
large scale deployments of 100s of nodes. Another innovation introduced with Oracle Flex
Cluster 12c is the ability to deploy Oracle VM guests and Bare Metal servers in the same
cluster. Earlier releases of Oracle Clusterware support Oracle Clusterware deployments in
Oracle VM environments for Oracle RAC and applications, however, all servers in the
cluster are expected to be Oracle VM guest. Oracle Flex Cluster, however, allows the
application/LEAF servers to be deployed as Oracle VMs while the HUB servers are Bare
Metal. This deployment model allows for rapid application provisioning while preserving
HUB tier performance requirements. In addition, the Oracle Flex Cluster HA and policy
management capabilities are complimentary to Oracle VM. Oracle Flex Cluster Agents
rapidly detect VM hangs or infrastructure failures and provide hot standby failover of the
application to another VM in the cluster. The start/stop dependencies, ordering and
placement driven through the Oracle Flex Cluster policy engine guarantees ordered start
108
and stop of application components and a rich placement configuration for attraction,
dispersion and hard, weak, pull-up and exclusion ordering for Bare Metal and Oracle VM
servers in the Oracle Flex Cluster.
The online resource relocation service of Oracle Flex Cluster can online relocate applications
or application components running inside Oracle VM guests to a hot standby Oracle VM
guest in the cluster. This functionality offers fine-grain control of application and resource
management within a VM and compliments the course-grained control of Oracle VM Live
Migration.
The complimentary power of Oracle VM and Oracle Flex Cluster allow for very large scale
deployment and agile resource management of applications running in Oracle VM guests
and Bare Metal servers.
Server Categorization
Oracle Clusterware 12c introduces Server Categories, where Oracle Clusterware will
dynamically discover the computing attributes of a server, such as processor types, memory
and other distinguishing system features and allow users to organize servers into server
pools based on these categories. When SERVER_CATEGORY is defined in place of
SERVER_NAMES, server membership in a pool is restricted to servers with attributes that
satisfy the category. Users can define their own characteristic of servers for categorization in
addition to the discoverable attributes. Oracle Flex Cluster 12c provides two default named
categories, HUB and LEAF for the specific server roles configured. Use of server categories
provides an efficient, automated mechanism to allocate compute resources to server pools
based on pre-defined server attributes.
The use of server pools and server categorization requires the cluster to be configured as a
policymanaged cluster. Prior to Oracle Clusterware 12c, server pool changes were manually
executed by the end-user based on fluctuating demand or as a recommendation from the
Oracle Database Quality of Service Management framework (QoS Management). Oracle
Clusterware 12c allows users to define a cluster configuration policy for each server pool
109
defined in the system. These policies collectively represent the cluster configuration policy
set. An administrator can set different policies to be in effect at different dates or times of the
day in accordance with business needs and the system demands. The policy in effect drives
the cluster topology as a whole based on server pool requirements for the target workload.
Cluster configuration policy sets provide dynamic management of cluster polices across the
cluster.
Oracle Database QoS Management1 is a full Oracle stack development effort introduced in
11gR2 to provide effective runtime database management of datacenter SLAs by ensuring
when there are sufficient compute and memory resources to meet all objectives these
resources are properly allocated. Should demand or server availability change where
capacity is over-subscribed, Oracle Database QoS Management insure that the most business
critical SLAs are preserved at the cost of less critical work. Oracle Clusterware 12c cluster
configuration policy sets are Oracle Database QoS Management aware. If you create policies
with Oracle Database QoS Management the Oracle Clusterware 12c cluster configuration
policy sets are disabled in deference to the Oracle Database QoS Management server pool
directive overrides.
Predictability
This action plan consists of a series of resource state transitions and/or server pool
reconfigurations. What-If response plans are available for the following event categories:
110
• Resources: start, stop, relocate, add, and modify
Oracle Clusterware 12c What-If action plans help administrators determine failover capacity
for planned or unplanned events, confirm correct dependency definitions for configured
resources and validate policy set deployments. It is an essential tool in automated workload
management.
Policy Management and server pools offer a standardized deployment model for database
and application clustering. As stated, Oracle Flex Cluster 12c provides HUB server pools for
the database tiers and LEAF server pools for applications. Oracle Clusterware has a common
command line interface to manage resource in both tiers either by a single GRID
Administrator or, by secure, roleseparated administrators for each tier. The interface is the
standard Oracle Clusterware interface for all cluster resources.
Oracle Clusterware is fully integrated with Oracle Cloud Control. Oracle Clusterware
configured resources - cluster, local, network, application, database, VM and storage are all
exposed as Enterprise Managed targets which provides a single management 'pane of glass'
for all tiers managed by Oracle Clusterware. All Oracle Clusterware management operations
are available through the Oracle Cloud Control GUI.
111
11gR2 vs 12c Database differences
2 Standard Oracle clusters can Flex cluster and Flex ASM is designed to scale
accommodate between 32 to 64 nodes up to 2000 nodes
3 No Pluggable Database concept in 11gR2 Oracle 12c pluggable database plugging and
unplugging
4 Single database structure. Consolidation multiple 11gR2 databases into
Oracle 12c container database as PDB's
5 Table space should be kept in read only Online rename and relocation of an active data
mode and data file should be offline to file and additionally data files can be migrated
move the data file. between storages e.g. non-ASM to ASM and
vice versa.
6 Heap Tables(Non-Partitioned ) migration Online migration of table partition or sub-
is achieved. partition. a table partition or sub-partition can
be moved to a different table space online or
offline.
7 Invisible indexes and virtual columns Along with Invisible indexes, Invisible column
feature Introduced. concepts has been introduced in Oracle 12c R1.
8 Will create single Index on one column Will create multiple indexes on the same
column or set columns with different Index
types.( only one index applicable at a time.)
9 All Redo data would be stored in UNDO temporary undo feature in 12c R1 to reduce the
Tbs. load the actual UNDO table space and less redo
generation.
10 In 11g R2, SYSASM privilege was SYSBACKUP privilege has been introduced in
introduced to perform ASM specific 12c to execute backup and recovery commands
operations. in Recovery Manager (RMAN).
11 SQL statements Execution at RMAN SQL statements Execution at RMAN prompt.
prompt. Eg: RMAN> select * from v$version ;
Eg: RMAN> sql 'select * from v$version '
;
12 Restore a table or partition using physical you can recover a particular table or partition to
backups is not possible. a point-in-time or SCN from RMAN backups
13 Restricting PGA size is not possible. It Restricting PGA size is possible.(
changes depends on load dynamically PGA_AGGREGATE_LIMIT)
14 Pre Upgrade script utlu112i.sql for any Preupgrd.sql replaces legacy utlu121i.sql script
issue fixes before Upgradations. and It provides fix up scripts to easy the process
of fixing issues in Upgradations.
15 Standard sql file "catupgrd.sql" is used catctl.pl (parallel-upgrade utility) introduced in
for upgradation 12C to improve the upgradation time by
parallel mode of execution.
112
16 Restore/Recover data files over the Restore/Recover data files over the network
network is not possible. using SERVICE NAME.
17 There is no feature available in Turn off redo log generation while import
Datapump to turn off redo generation. operation in
Datapump(TRANSFORM=DISABLE_ARCHI
VE_LOGGING:Y)
18 AWR,ASH,ADDM will not work Real-time ADDM analysis(Emergency
properly when DB was hung completely Monitoring Option in 12c Cloud Control)
and un responsive.
19 Gathering Database statistics on single Gathering Database statistics concurrently on
table at a time. multiple tables
113
availability frame work of oracle clusterware into the application tier. With flex cluster, we
can manage multiple databases and applications running in a single cluster.
Flex cluster:
Oracle 12c offers two types of Clusterware configuration setups: Standard Cluster and Flex
Cluster. In a standard Oracle Clusterware configuration, all nodes in the cluster tightly
coupled through private network and have direct read/write access to shared storage. A
Flex Cluster, on the other hand, designed over HUB-LEAF topology to scale the Cluster to
large number of nodes, up to 2000 nodes. Hub nodes are very much similar to the standard
cluster architecture, they are tightly coupled through a private interconnect and have direct
access to shared storage. On the contrary, Leaf nodes are very light weight servers, not
connected to other leaf nodes, and have no direct access to the storage. A Hub node can have
multiple leaf nodes, but, a node leaf can’t be part of multiple of Hub nodes. In a nutshell, the
prime purpose of an Oracle Flex Cluster is to provide the combined database and
application tiers together in a single clustering environment.
Hub Node:
Hub Nodes are similar to Oracle Grid Infrastructure nodes in an Oracle Clusterware
standard Cluster configuration. They are tightly connected and have direct accesses to
shared storage.
Leaf Node:
Leaf Nodes are different from standard Oracle Grid Infrastructure nodes, and they do not
require direct access to shared storage, but instead request data through Hub Nodes. Leaf
Nodes must be members of a cluster that includes at least one Hub Node.
114
$ crsctl get cluster mode status
If the cluster is running in standard mode, we can easily change from standard to flex mode
using CRSCTL utility.
Step 2: Run the following command to ensure that the Grid Naming Service (GNS) is
configured with a fixed VIP:
This procedure cannot succeed unless GNS is configured with a fixed VIP. If there is no
GNS, then as root create one as follows:
NOTE: before executing the following step, please ensure to make the GNS VIP IP entry in
the DNS server.
Step 3: Before changing the cluster mode, oracle flex ASM has to be enabled in cluster.
Enable the flex ASM using ASMCA.
$ asmcmd showclustermode
Step 4: Now, using ASMCA you can convert oracle ASM configuration to oracle FLEX ASM.
Before that we need to create password file in shared disk group using ORAPWD utility.
115
$ asmca
In ASM instances page you can select the “convert to oracle flex asm” dialogue box.
In this tab, select the instances to perform the operations and then click the “convert to
Oracle Flex ASM” dialogue box which is highlighted in RED. It will automatically open one
more tab, which specifies the listener port and network interface for the conversion to flex
ASM.
Select the network to be used for ASM network and then click OK button.
116
After that, run the above script as privileged user in local node for complete ASM
conversion. This script should take some time for converting ASM configuration to flex
ASM.
$ su – grid
$ asmcmd showclustermode
Now, we can change the mode of the cluster to FLEX cluster as ‘ROOT’ user.
Flex ASM:
The Next generation ASM(Automatic Storage Management ) has new name i.e Flex ASM.
As normal ASM instance will run on each node with Flex configuration to support pre 12c
database. The compatibility parameter of ASM disk group is used to manage the
compatibility of between and among database instances. Advantage of this approach is that
if an Oracle 12c database instance loses connectivity with an ASM instance, then the
117
database connections will failover to another ASM instance on a different server. This
failover is achieved by setting the cardinality to all.
Oracle Flex ASM supports larger LUN sizes for Oracle Database 12c clients.
Maximum number of Disk Groups supported is 511.
Flexibility to rename an ASM Disk in a Disk Group.
ASM instance Patch-level verification
Patch level verification is disabled during rolling patches
Replicated Physical Metadata
Flex ASM adds the ASM network, which can be used for communication between ASM
and its clients to isolate and offload ASM trafficated Physical Metadata
118
Deploying Flex ASM
You can use the ASMCMD command to determine whether Oracle Flex ASM is
enabled.
$ asmcmd showclustermode
Use SRVCTL to determine the status of the instances in an Oracle Flex ASM
configuration.
ASM is enabled
119
Oracle 12c RAC Commands Changes
SRVCTL Commands:
120