Professional Documents
Culture Documents
RAC
Oracle 11g R2
1
Agenda
Introduction
Availability
Scalability
Manageability
Total Cost of Ownership
Conclusion
2
What Is a RAC Cluster?
What Is a RAC Cluster? Interconnect
Nodes
Interconnect Node 1
Node 2
Shared disk subsystem
Instances
Database
Shared Disks
3
What is RAC?
Multiple instances running on separate servers (nodes)
Single database on shared storage accessible to all nodes
Instances exchange information over an interconnect
network
Node 1 Node 2
6
Instances versus Databases
Public
Private Network Network
(Interconnect)
Storage
Network
Database
7
A RAC Database –what’s different?
Contents similar to single instance database except …
8
What is the Interconnect?
Instances communicate with each other over the
interconnect (network)
9
Why Use Shared Storage?
Mandatory for
Database files
Control files
Online redo logs
Server Parameter file (if used)
Optional for
Archived redo logs (recommended)
Executables (Binaries)
Password files
Parameter files
Administrative directories
Alert Log
Dump Files
10
What Shared Storage is Supported?
Oracle supplied options
Oracle Cluster File System (OCFS)
Version 1
Windows and Linux
No executables
12
Internal Structures and Services
Global Resource Directory (GRD)
Records current state and owner of each resource
Contains convert and write queues
Distributed across all instances in cluster
13
Background Processes
Each RAC instance has set of standard background processes e.g.
PMON
SMON
LGWR
DBWn
ARCn
RAC instances use additional background processes to support GCS and
GES including
LMON
LCK0
LMDn
LMSn
DIAG
14
RAC init.ora Parameters
*.db_cache_size=113246208
*.java_pool_size=4194304
*.db_name='racdb‘
racdb2.instance_number=2
racdb1.instance_number=1
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY
_FILE_DEST'
racdb2.thread=2
racdb1.thread=1
*.undo_management='AUTO'
racdb2.undo_tablespace='UNDOTBS2'
racdb1.undo_tablespace='UNDOTBS1'
15
Why Do Users Deploy RAC?
Users may deploy RAC to achieve
Increasing availability
Increasing scalability
Improving maintainability
16
Availability
17
What is Failover?
If one node or instance fails
Node detecting failure will
Read redo log of failed instance from last checkpoint
Apply redo to datafiles including undo segments (roll
forward)
Rollback uncommitted transactions
Node 1 Node 2
18
What are Database Services?
Database Services are logical groups of sessions
19
What are Database Services?
Can be used with Resource Manager to control resource usage e.g.
CPU
Parallel execution
20
What is Oracle Clusterware?
Oracle Clusterware is the technology that transforms a server farm into a
cluster. A cluster in general is a group of independent servers that cooperate
as a single system. Oracle Clusterware is the intelligence in this system that
ensures that required cooperation.
Oracle Clusterware was introduced with Oracle Database 10g as the general
underlying clusterware that is required to run Oracle Real Application
Clusters 10g. At this time Oracle Clusterware was known as Oracle CRS.
21
What is the OCR?
Oracle Cluster Registry (OCR)
Configuration information for Oracle Clusterware / CRS
22
What is the OCR?
Defines cluster resources including:
Databases
Instances
RDBMS
ASM
Services
Node Applications
VIP
ONS
GSD
Listener Process
23
What is a Voting Disk?
Known as Quorum Disk / File in Oracle 9i
In the event of node failure voting disk is used to determine which
instance takes control of cluster
Avoids split brain
24
Network Requirements
Each node must have at least two network adapters; one
for the public network interface and one for the private
network interface (the interconnect).
25
What is VIP?
VIPs are used in order to facilitate faster failover in the event of a
node failure
Each node not only has its own statically assigned IP address as
well as also a virtual IP address that is assigned to the node
Without VIP, clients will have to wait for long TCP/IP timeout
before getting an error message or TCP reset from nodes that have
died
26
What is SCAN?
SCAN was first introduced in Oracle RAC 11g Release 2
Single Client Access Name (SCAN) provides a single
name for clients to access any Oracle Database running
in a cluster
You can think of SCAN as a cluster alias for databases
in the cluster
Client can user Ezconnect Method to connect to server
like Sqlplus hr/manager@ol5-112-scan/oltp
27
What is TAF?
TAF is Transparent Application Failover
28
What is TAF?
TAF defined by FAILOVER_MODE parameter
TYPE=SESSION
- User does not need to reconnect
- Session failed over to another available instance in the list
- But SQL statements in progress will have to be
reissued
TYPE=SELECT
- Query will be restarted after failover
- Rows not fetched before failover will be retrieved
29
What is TAF?
Connection modes METHOD=BASIC or PRECONNECT
BASIC
- After failover connection must reconnect to next address in
the list
- Additional time to failover
PRECONNECT
- Session is opened against all addresses in the list
- Only one is used – others remain connected
- Faster failover with preconnected sessions
- More memory resources consumed by preconnected sessions
on other nodes
30
What is TAF?
TAF is Transparent Application Failover
33
Does RAC Increase Availability?
Depends on definition of availability
May achieve less unplanned downtime
May have more time to respond to failures
Instance failover means any node can fail without total loss of
service
34
Does RAC Increase Availability?
Can still get data corruptions
Human errors / software errors
Only one logical copy of data
Only one logical copy of application / Oracle software
35
Scalability
36
What is Scalability?
Scalability is the relationship between increments of resources and
workloads
Can be any resource but with RAC normally refers to adding instances
Scalability can be
linear - optimal but rare
non-linear - suboptimal but normal
Workload
Workload
Linear Non-
Linear
Resource Resource
37
What is Workload Balancing?
Balancing of workload across available instances
Can have
Client-side connection balancing
Server-side connection balancing
RAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = node2)(PORT = 1521))
(LOAD_BALANCE = ON)
(FAILOVER = ON)
(CONNECT_DATA =
(SERVICE_NAME = RAC)
(FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASIC))
)
)
38
Increasing Scalability
If application scales well on a single-instance then it should scale well on
RAC
Eliminate contention
Use sequences
39
Increasing Scalability
Use Automatic Segment Space Management
Default in Oracle 11.2
40
Manageability
41
Server Parameter File
Introduced in Oracle 9.0.1
Must reside on shared storage
Shared by all RAC instances
Binary (not text) files
Parameters can be changed using ALTER SYSTEM
Can be backed up using the Recovery Manager (RMAN)
Created using
CREATE SPFILE [ = ‘SPFILE_NAME’ ]
FROM PFILE [ = ‘PFILE_NAME’ ];
init.ora file on each node must contain SPFILE
parameter
SPFILE = <pathname>
42
Parameters
RAC uses same parameters as single-instance
Some must be different on each instance
Some must be same on each instance
43
Parameters
Some parameters must be same on each instance including :
ARCHIVE_LAG_TARGET
CLUSTER_DATABASE
CLUSTER_DATABASE_INSTANCES
CONTROL_FILES
COMPATIBLE
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_EXECUTION_MESSAGE_SIZE
UNDO_MANAGEMENT
44
Parameters
Some parameters, if used, must be different on each
instance including
THREAD
INSTANCE_NUMBER
INSTANCE_NAME
SPFILE
SERVICE_NAMES
UNDO_TABLESPACE
ROLLBACK_SEGMENTS
46
SRVCTL - Examples
Starting and Stopping a Database
srvctl start database -d RAC
srvctl stop database -d RAC
47
What is CLUVFY?
Introduced in Oracle 10.2
48
CLUVFY
Stages include
49
CLUVFY
Components include
nodereach Checks reachability between nodes
nodecon Checks node connectivity
cfs Checks CFS integrity
ssa Checks shared storage accessibility
space Checks space availability
sys Checks minimum system requirements
clu Checks cluster integrity
clumgr Checks cluster manager integrity
ocr Checks OCR integrity
crs Checks Oracle Clusterware (CRS) integrity
nodeapp Checks node applications exist
admprv Checks administrative privileges
peer Compares properties with peers
50
CLUVFY
For example, to check configuration before installing Oracle
Clusterware on node1 and node2 use:
sh runcluvfy.sh stage -pre crsinst -n node1,node2
Checks:
node reachability
user equivalence
administrative privileges
node connectivity
shared stored accessibility
51
Does RAC Improve Manageability?
Advantages
Fewer databases to manage
Easier to monitor
Easier to upgrade
Easier to control resource allocation
Resources can be shared between applications
Disadvantages
Upgrades potentially more complex
Downtime may affect more applications
Requires more experienced operational staff
Higher cost / harder to replace
52
Total Cost of
Ownership
53
Reduction in TCO?
Possible for sites with legacy systems
Mainframes / Minicomputers
Applications / Packages
54
Reduction in TCO?
Additional resources required
Redundant hardware
Nodes
Network switches
SAN fabric
Hardware e.g. fibre channel cards
55
What are the Alternatives to RAC?
Data Guard
Physical Standby
Introduced in Oracle 7.3.4
Stable, well proven technology
Logical Standby
Introduced in Oracle 9.2
Still not widely adopted
Streams
Introduced in Oracle 9.2
Implemented by increasing number of sites
Advanced Replication
56
What are the Alternatives to RAC?
Symmetric Multiprocessing (SMP) Systems
Single Point of Failure
Simplified configuration
Eliminate RAC overhead
Parallel systems
For systems with deterministic input
Messaging
Data Warehouses
57
Conclusion
Success of RAC deployments dependent on
Application design and implementation
Failover requirements
IT infrastructure
Flexibility and commitment of IT department(s)
59