Wednesday, February 25, 2009

Oracle RAC handson Part 5 Managing RAC

Managing RAC database

Voting disk and Oracle cluster Registry device administration

Voting disk ocr file location (/etc/sysconfig/rawdevices)

#voting.dat

/dev/raw/raw1 /dev/sda1

#ocr.dat

/dev/raw/raw2 /dev/sdb1

Backing up Voting Disks

blade1:/etc/sysconfig >dd if=/dev/raw/raw1 of=/tmp/voting.dmp

196969+0 records in

196969+0 records out

blade1:/etc/sysconfig >ls -l /tmp/voting.dmp

-rw-r--r-- 1 oracle oinstall 100848128 Jun 28 15:55 /tmp/voting.dmp

blade1:/etc/sysconfig >

Recovering Voting Disks

dd if=/tmp/voting.dmp of=/dev/raw/raw1

Adding or Deleting Voting disk (must be odd number of copies)

$CRS_HOME/bin/crsctl add css votedisk /dev/raw/raw3

$CRS_HOME/bin/crsctl delete css votedisk /dev/raw/raw3

Adding an Oracle Cluster Registry (up to two OCR, must to be root)

ocrconfig -replace ocr /dev/raw/raw4

Adding OCR mirror

ocrconfig -replace ocrmirror /dev/raw/raw4

Repair OCR

ocrconfig -repair ocrmirror /dev/raw/raw4

Remove OCR

ocrconfig -replace ocr

Restore OCR

ocrconfig –restore /dev/raw/raw4

Verify the OCR integrity

blade1:/dev/raw >cluvfy comp ocr -n blade1

Verifying OCR integrity

Checking OCR integrity...

Checking the absence of a non-clustered configuration...

All nodes free of non-clustered, local-only configurations.

Uniqueness check for OCR device passed.

Checking the version of OCR...

OCR of correct Version "2" exists.

Checking data integrity of OCR...

Data integrity check for OCR passed.

OCR integrity check passed.

Verification of OCR integrity was successful.

Show OCR backup

blade1:/dev/raw >ocrconfig -showbackup

blade1 2007/06/28 15:54:20 /u01/app/10.2/crs/cdata/crs

blade1 2007/06/28 11:54:18 /u01/app/10.2/crs/cdata/crs

blade1 2007/06/28 07:54:16 /u01/app/10.2/crs/cdata/crs

blade1 2007/06/27 07:54:04 /u01/app/10.2/crs/cdata/crs

blade1 2007/06/19 03:52:25 /u01/app/10.2/crs/cdata/crs

Check content of OCR (run as root)

ocrdump -backupfile backup00.ocr

vi OCRDUMPFILE

Other OCR commands

ocrconfig –overwrite

ocrconfig -export file_name

ocrconfig -import file_name

ocrconfig –upgrade

ocrconfig –downgrade

Interconnect Admin

Multiple Cluster Interconnects on UINIX

CLUSTER_INTERCONNECTS=129.34.137.212: 129.34.137.213

Create ASM as RAC storage

Enterprise Manager

dbca

dbca -silent -nodeList nodelist -configureASM -asmPassword asm_pwd [-diskList disk_list] [-redundancy redundancy_option] [-diskGroupName dgname] [-diskString disk_discovery_string] [-recoveryGroupName recovery_dgname] [-recoveryRedundancy redundancy_option]

srvctl

srvctl add asm -n node_name -i asm_instance_name -o oracle_home

srvctl remove asm -n node_name [-i asm_instance_name]

srvctl enable asm -n node_name [-i ] asm_instance_name

srvctl disable asm -n node_name [-i asm_instance_name]

srvctl start asm -n node_name [-i asm_instance_name] [-o start_options] [-c | -q]

srvctl stop asm -n node_name [-i asm_instance_name] [-o stop_options] [-c | -q]

srvctl config asm -n node_name

srvctl status asm -n node_name

RAC database management tool

Enterprise Manager

sqlplus

srvctl

srvctl start instance -d db_name -i "inst_name_list" [-o start_options] [-c connect_str | -q]

srvctl stop instance -d name -i "inst_name_list" [-o stop_options] [-c connect_str | -q]

srvctl start database -d name [-o start_options] [-c connect_str | -q]

srvctl stop database -d name [-o stop_options] [-c connect_str | -q]

-o = mount, immediate, abort

Initialization Parameters must set to be the same

ACTIVE_INSTANCE_COUNT

ARCHIVE_LAG_TARGET

CLUSTER_DATABASE

CLUSTER_DATABASE_INSTANCES

CONTROL_FILES

DB_BLOCK_SIZE

DB_DOMAIN

DB_FILES

DB_NAME

DB_RECOVERY_FILE_DEST

DB_RECOVERY_FILE_DEST_SIZE

DB_UNIQUE_NAME

UNDO_MANAGEMENT

Initialization Parameters for RAC

CLUSTER_DATABASE

CLUSTER_DATABASE_INSTANCES

CLUSTER_INTERCONNECTS

INSTANCE_NAME

THREAD

Change VIP address

srvctl modify nodeapps

ASM management tool

sqlplus

asmcmd

Oracle Clusterware Management Tool

Add Oracle Clusterware home to new node

CRS_home/oui/bin/addNode.sh

CRSCTL (run as root)

crsctl debug log crs "CRSRTI:1,CRSCOMM:2"

crsctl stop crs

crsctl start crs

crsctl enable crs

crsctl disable crs

crsctl check crs

crsctl check daemon

OIFCFG Oracle Interface Configuration

oifcfg iflist

oifcfg getif [ [-global | -node nodename] [-if if_name[/subnet]] [-type if_type] ]

oifcfg setif -global hme0/139.185.141.0:cluster_interconnect

Glossary

· Cluster Synchronization Services (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.

· Cluster Ready Services (CRS)—The primary program for managing high availability operations within a cluster. Anything that the crs process manages is known as a cluster resource which could be a database, an instance, a service, a Listener, a virtual IP (VIP) address, an application process, and so on.

· Event Management (EVM)—A background process that publishes events that crs creates.

· Oracle Notification Service (ONS)—A publish and subscribe service for communicating Fast Application Notification (FAN) events.

· RACG—Extends clusterware to support Oracle-specific requirements and complex resources. Runs server callout scripts when FAN events occur.

· Process Monitor Daemon (OPROCD)—This process is locked in memory to monitor the cluster and provide I/O fencing. OPROCD performs its check, stops running, and if the wake up is beyond the expected time, then OPROCD resets the processor and reboots the node. An OPROCD failure results in Oracle Clusterware restarting the node. OPROCD uses the hangcheck timer on Linux platforms.

· Voting Disk—Manages cluster membership by way of a health check and arbitrates cluster ownership among the instances in case of network failures.

· Oracle Cluster Registry (OCR)—Maintains cluster configuration information as well as configuration information about any cluster database within the cluster.

· Services—Services enable you to group database workloads and route the work to the optimal instances that are assigned to process the service.

· Cluster Verification Utility (CVU)—CVU is a command-line tool that you can use to verify a range of cluster and RAC-specific components such as shared storage devices, networking configurations, system requirements, and Oracle Clusterware, as well as operating system groups and users.

· Server Control (SRVCTL)—SRVCTL is a command-line interface that you can use to manage a RAC database from a single point. You can use SRVCTL to start and stop the database and instances and to delete or move instances and services. You can also use SRVCTL to manage configuration information.

· Cluster Ready Services Control (CRSCTL)—CRSCTL is a command-line tool that you can use to manage Oracle Clusterware. You can use CRSCTL to start and stop.

· Oracle Interface Configuration Tool (OIFCFG)—OIFCFG is a command-line tool for both single-instance Oracle databases and RAC environments that you can use to allocate and de-allocate network interfaces to components.

Reference

Oracle® Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide 10g Release 2 (10.2) Part Number B14197-03 http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/toc.htm

No comments:

Post a Comment