Escolar Documentos
Profissional Documentos
Cultura Documentos
AGENDA
Introduction to RAC Availability Manageability Voting Disk Crash Scenarios Global Cache Services ASM Grid infrastructure Patching and up gradation By others ACFS Patching in Data Guard New features in 11gR2 RAC concepts Eviction scenarios
2006 IBM Corporation 2 2006 IBM Corporation
INTRODUCTION
Interconnect
Instance 2
Node 2
Shared Storage
4
Local Disk
2006 IBM Corporation 2006 IBM Corporation
Contd
Contents similar to single instance database except One redo thread per instance
ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 3 SIZE 51200K, GROUP 4 SIZE 51200K; ALTER DATABASE ENABLE PUBLIC THREAD 2;
If using Automatic Undo Management also require one UNDO tablespace per instance
CREATE UNDO TABLESPACE "UNDOTBS2" DATAFILE SIZE 25600K AUTOEXTEND ON MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL;
Additional dynamic performance views (V$, GV$ but not X$) created by $ORACLE_HOME/rdbms/admin/catclust.sql
2006 IBM Corporation
Availability
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 Cluster is frozen during part of this process Instance 1 Node 1 Local Disk
7th Sept, 2011
Interconnect
Instance 2 Node 2
Shared Storage
10
Local Disk
2006 IBM Corporation 2006 IBM Corporation
Can also be configured using SRVCTL (Oracle Cluster Registry only) SQL*Plus (Data Dictionary only)
In Oracle 10.1 and above, each service has Preferred Nodes (used by default) Available Nodes (used if preferred node fails)
11
12
13
14
What is VIP???
Node application introduced in Oracle 10.1 Allows Virtual IP address to be defined for each node All applications connect using Virtual IP addresses If node fails Virtual IP address is automatically relocated to another node Only applies to newly connecting sessions
15
16
17
18
What is TAF???
TAF is Transparent Application Failover
Requires additional coding in client
19
20
Contd
Can still get data corruptions Human errors / software errors Only one logical copy of data Only one logical copy of application / Oracle software Lots of possibility for human errors Power / network cabling / storage configuration Upgrades and patches are more complex Can upgrade software on subset of nodes If database is affected then still need downtime
21
Manageability
22
23
Parameters
Some parameters must be same on each instance including :
ACTIVE_INSTANCE_COUNT ARCHIVE_LAG_TARGET CLUSTER_DATABASE CONTROL_FILES DB_BLOCK_SIZE DB_DOMAIN DB_FILES DB_NAME DB_RECOVERY_FILE_DEST DB_RECOVERY_FILE_DEST_SIZE DB_UNIQUE_NAME TRACE_ENABLED UNDO_MANAGEMENT
24
Contd
Some parameters, if used, must be different on each instance including :
THREAD INSTANCE_NUMBER INSTANCE_NAME UNDO_TABLESPACE ROLLBACK_SEGMENTS
25
DBCA
Can be used to Create RAC database and instances Create ASM instance Manage ASM instance (10.2) Add RAC instances Create RAC database Create clone RAC database (10.2) Create, Manage and Drop Services Drop instances and database
26
What is SRVCTL?
Utility used to manage cluster database Configured in Oracle Cluster Registry (OCR) Controls Database Instance ASM Listener Node Applications Services Options include Start / Stop Enable / Disable Add / Delete Show current configuration Show current status
2006 IBM Corporation
27
SRVCTL - Examples
Starting and Stopping a Database
srvctl start database -d RAC srvctl stop database -d RAC
28
What is CLUVFY?
Introduced in Oracle 10.2
Supplied with Oracle Clusterware Can be downloaded from OTN (Linux and Windows) Written in Java - requires JRE (supplied) Also works with 10.1 (specify -10gR1 option) Checks cluster configuration stages - verifies all steps for specified stage have been completed components - verifies specified component has been correctly installed
2006 IBM Corporation
29
CLUVFY
Stages include -post hwos -pre cfs -post cfs -pre crsinst -post crsinst -pre dbinst -pre dbcfg post check for hardware and operating system pre-check for CFS setup post-check for CFS setup pre-check for Oracle Clusterware installation post-check for Oracle Clusterware installation pre-check for database installation pre-check for database configuration
30
contd..
Components include
nodereach nodecon cfs ssa space sys clu clumgr ocr crs Checks reachability between nodes Checks node connectivity Checks CFS integrity Checks shared storage accessibility Checks space availability Checks minimum system requirements Checks cluster integrity Checks cluster manager integrity Checks OCR integrity Checks Oracle Clusterware (CRS) integrity
nodeapp
admprv peer
31
contd..
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
If any checks fail append -verbose to display more information
2006 IBM Corporation
32
Other Utilities
Additional RAC utilities and diagnostics include OCRCONFIG OCRCHECK OCRDUMP CRSCTL CRS_STAT Additional RAC diagnostics can be obtained using ORADEBUG utility DUMP option LKDEBUG option Events
33
34
35
contd
Losing one Voting Disk Voting disks are used in a RAC configuration for maintaining nodes membership. They are critical pieces in a cluster configuration. Starting with ORACLE 10gR2, it is possible to mirror the OCR and the voting disks. Using the default mirroring template, the minimum number of voting disks necessary for a normal functioning is two. Scenario Setup
Identify Votings:
crsctl query css votedisk /dev/raw/raw1 /dev/raw/raw2
/dev/raw/raw3
2006 IBM Corporation
36
contd
corrupt one of the voting disks (as root):
dd if=/dev/zero /dev/raw/raw3 bs=1M
Recoverability Steps
check the $CRS_HOME/log/[hostname]/alert[hostname].log file. The following message should be written there which allows us to determine which voting disk became corrupted:
[cssd(9120)]CRS-1604:CSSD voting file is offline: /opt/oracle/product/10.2.0/crs_1/Voting1. Details in /opt/oracle/product/10.2.0/crs_1/log/ractest2/cssd/ocssd.log.
37
contd
According to the above listing the Voting1 is the corrupted disk. Shutdown the CRS stack:
srvctl stop database -d fitstest -o immediate srvctl stop asm -n ractest1 srvctl stop asm -n ractest2 srvctl stop nodeapps -n ractest1 srvctl stop nodeapps -n ractest2 crs_stat t
38
contd
Pick a good voting from the remaining ones and copy it over the corrupted one:
dd if=/dev/raw/raw4 of=/dev/raw/raw3 bs=1M
39
contd
After a couple of minutes check the status of the whole CRS stack:
[oracle@ractest1 ~]$ crs_stat -t
40
41
Instance 2
2 Request granted
Instance 3
1318
42
1318
Instance 2
Instance 3
N X
1320
Instance 1 Instance 1 requests exclusive read on block
4 Resource status
Instance 4
1318
43
1318
Instance 2
N X N
N X
1320
3 Block and resource status Instance 1 Instance 4 requests exclusive read on block
1323
Instance 4
1318
Note that Instance 1 will create a past image (PI) of the dirty block
2006 IBM Corporation
44
Past Images
When an instance passes a dirty block to another instance it Flushes redo buffer to redo log Retains past image (PI) of block in buffer cache PI is retained until another instance writes block to disk Used to reduce recovery times Recorded in V$BH.STATUS as PI Based on X$BH.STATE (value 8 in Oracle 10.2)
45
contd..
Buffer Cache UPDATE t1 SET c1 = 1324; 1328; 1327; 1326; 1325; COMMIT; Buffer Cache UPDATE t1 SET c1 = 1329; COMMIT;
1328 1329
Instance 1
Instance 2
1323
1324
1328
1329
1324
1325 1326 1327
1325
1326 1327 1328
1329 1323
BlockUndo/Redoapplied froma DBWR hasis 1makesperform to Instance 42updates column Block 421table t1 contains Assume2subsequentlyto 42 Instance notmustrecovery Undo/redoupdated in to GCS transferswritten from Block 1needs block Instance is2 written buffer Undo/redo Crasheswritten 42 is Instance written changes block Block 42 is read from disk ContentsPastdisk Instance 2 lost Instance 42cachePast Image toInstance usesInstance yet recovery1 to by block 2 backof 1 Imageto disk blocktobuffer cache 42 single row in block are a Redo Log 1 1327 DBWR 1324 2 1329 1328 1326 1325 for back
Redo Log 2
2006 IBM Corporation 46 2006 IBM Corporation
Redo Log 1
47
Back
2006 IBM Corporation
50
Back
2006 IBM Corporation 2006 IBM Corporation