Anda di halaman 1dari 15

6

Oracle Clusterware

Copyright 2006, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to


describe:
CRS resources
RAC resources
Virtual IP addresses and RAC
OCR architecture
CRS framework
Cluster Verify

6-2

Copyright 2006, Oracle. All rights reserved.

Oracle Clusterware: Overview

Portable cluster infrastructure that provides high


availability to RAC databases and/or other applications:
Monitor applications health
Restart applications on failure
Can fail over applications on node failure
Protected App A
RAC DB Inst

RAC DB Inst

Listener

Listener

ORACLE_HOME

ORACLE_HOME

Protected App B

ORA_CRS_HOME

ORA_CRS_HOME

ORA_CRS_HOME

Oracle Clusterware
system files

6-3

Copyright 2006, Oracle. All rights reserved.

CRS Resources

A resource is a CRS-managed application.


Application profile attributes are stored in OCR:
Check interval
Failure policies

Action script
Privileges

Dependencies

An action script must do a:


Start of the application
Stop of the application
Check of the application

Life cycle of a resource:


crs_profile

crs_register

crs_start

crs_relocate
6-4

crs_stat

crs_stop

Copyright 2006, Oracle. All rights reserved.

crs_unregister

RAC Resources
$ $CRS_HOME/crs_stat -t
Name
Type
Target State Host
---------------------------------------------------------------ora.atlhp8.ASM1.asm
application ONLINE ONLINE atlhp8
ora.atlhp8.LISTENER_ATLHP8.lsnr application ONLINE ONLINE atlhp8
ora.atlhp8.gsd
application ONLINE ONLINE atlhp8
ora.atlhp8.ons
application ONLINE ONLINE atlhp8
ora.atlhp8.vip
application ONLINE ONLINE atlhp8
ora.atlhp9.ASM2.asm
application ONLINE ONLINE atlhp9
ora.atlhp9.LISTENER_ATLHP9.lsnr application ONLINE ONLINE atlhp9
ora.atlhp9.gsd
application ONLINE ONLINE atlhp9
ora.atlhp9.ons
application ONLINE ONLINE atlhp9
ora.atlhp9.vip
application ONLINE ONLINE atlhp9
ora.xwkE.JF1.cs
application ONLINE ONLINE atlhp8
ora.xwkE.JF1.xwkE1.srv
application ONLINE ONLINE atlhp8
ora.xwkE.JF1.xwkE2.srv
application ONLINE ONLINE atlhp9
ora.xwkE.db
application ONLINE ONLINE atlhp9
ora.xwkE.xwkE1.inst
application ONLINE ONLINE atlhp8
ora.xwkE.xwkE2.inst
application ONLINE ONLINE atlhp9

6-6

Copyright 2006, Oracle. All rights reserved.

Virtual IP Addresses and RAC


clnode-1 clnode-2

clnode-1vip

clnode-2vip
2

ERP=(DESCRIPTION=
4 1 ((HOST=clusnode-1))
((HOST=clusnode-2))
6
(SERVICE_NAME=ERP))
Timeout
5
wait

Clients

ERP=(DESCRIPTION=
5 1 ((HOST=clusnode-1vip))
((HOST=clusnode-2vip))
6
(SERVICE_NAME=ERP))
7

7
3

clnode-1 clnode-2

6-7

Copyright 2006, Oracle. All rights reserved.

clnode-2vip

4 clnode-1vip

OCR Architecture

Node1

Node2

Node3

OCR cache

OCR cache

OCR cache

CRS
process

CRS
process

CRS
process

Client
process
Shared
storage

6-8

OCR
primary
file

Client
process

OCR
mirror
file

Copyright 2006, Oracle. All rights reserved.

Automatic OCR Backups


The OCR content is critical to Oracle Clusterware.
OCR is automatically backed up physically:
Every four hours: CRS keeps the last three.
At the end of every day: CRS keeps the last two.
At the end of every week: CRS keeps the last two.
$ cd$ORACLE_BASE/Crs/cdata/jfv_clus
$ ls -lt
-rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--

1
1
1
1
1
1
1

root
root
root
root
root
root
root

root
root
root
root
root
root
root

4784128
4784128
4784128
4784128
4784128
4784128
4005888

Jan 9
Jan 9
Jan 8
Jan 8
Jan 8
Jan 6
Dec 30

02:54
02:54
22:54
18:54
02:54
02:54
14:54

backup00.ocr
day_.ocr
backup01.ocr
backup02.ocr
day.ocr
week_.ocr
week.ocr

Change the default automatic backup location:


# ocrconfig backuploc /shared/bak
6 - 10

Copyright 2006, Oracle. All rights reserved.

Third-Party Application Protection: Overview


High availability framework:
Command-line tools to register applications with CRS
Calls control application agents to manage applications
OCR used to describe CRS attributes for the applications

High availability C API:


Modify CRS attributes directly in OCR
Modify CRS attributes at run time

Application VIPs:
Used for applications accessed by network means
NIC redundancy
NIC failover

OCFS:
Store application configuration files
Share files between cluster nodes
6 - 11

Copyright 2006, Oracle. All rights reserved.

Use CRS Framework: Overview

1. Create an application VIP if necessary:


a)
b)
c)
d)

Create a profile: Network data + usrvip predefined script


Register the application VIP.
Set user permissions on the application VIP.
Start the application VIP by using crs_start.

2. Write an application action script that accepts three


parameters:

6 - 12

start: Script should start the application.


check: Script should confirm the application is up.
stop: Script should stop the application.

Copyright 2006, Oracle. All rights reserved.

Use CRS Framework: Overview

3. Create an application profile:

Action script location


Check interval
Failover policies
Application VIP if necessary

4. Set permissions on your application.


5. Register the profile with Oracle Clusterware.
6. Start your application using crs_start.

6 - 13

Copyright 2006, Oracle. All rights reserved.

Cluster Verify: Overview

To verify that you have a well-formed cluster for Oracle


Clusterware and RAC, check the:
Installation
Configuration
Operation

Full stack verification


Non-intrusive verification
Diagnostic mode seeks to establish a reason for the
failure of any verification task.
Easy-to-use interface:
Stage commands
Component commands
6 - 14

Copyright 2006, Oracle. All rights reserved.

Cluster Verify Stages


-pre dbcfg

$ cluvfy stage -list

Configures
RAC DB

-pre dbinst
Installs
RAC

-pre crsinst

Installs
CRS

-pre cfs

-post crsinst
Sets up OCFS
( OPT )

-post cfs
User sets up the
hardware,
network, & storage

6 - 15

-post hwos

Copyright 2006, Oracle. All rights reserved.

Demos

Apache
Xclock
http://www.oracle.com/technology/obe/demos/admin/demos.html

6 - 16

Copyright 2006, Oracle. All rights reserved.

Summary

In this lesson, you should have learned about:


CRS resources
RAC resources
Virtual IP addresses and RAC
OCR architecture
CRS framework
Cluster Verify

6 - 17

Copyright 2006, Oracle. All rights reserved.

Anda mungkin juga menyukai