Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider...

32
Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies

Transcript of Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider...

Page 1: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Bare Bones ASMWhat Every DBA Needs to Know

Jay Caviness

Sr. Systems Engineer

McKesson Provider Technologies

Page 2: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Topics

What is ASM?

Using ASM

Caveats and Issues

New Features in 11gR2

Page 3: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

McKesson Provider Technologies

Largest Healthcare IS Company

Oracle Solutions Partner

McKesson Clinicals Applications17 Applications Suites

Meds ManagerERBilling/Revenue ManagementNursingNICU/PICU

Page 4: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

About Me

Oracle DBA for 20 years

Senior Engineering DBA and Oracle Infrastructure Architect for McKesson Provider Technologies

Administered Oracle from v5.1 – 11g

Beta team for 11gR2

Oracle Certified Professional

Known as the “Grumpy DBA”

Page 5: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

McKesson Horizon Clinicals and ASM

Over 800 hospital deploy McKesson applications

ASM deployed starting in late 2005 (10gR1)

As of today more than 475 hospitals run Oracle ASM

- Most run Oracle RAC - over 700 clusters

- Linux, HP/UX and IBM-AIX

Page 6: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

McKesson Horizon Clinicals Client

Starting disk space per installation: 400GB+

Growth 20%–30% year over year

Retention requirements vary by HIPAA rules, typically 7-10 years

Page 7: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Automated Storage Management

Page 8: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Why ASM

Why choose ASM?

Setup and Management

Simplicity

Scalability & Performance

Robust and Stable

Page 9: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

What is ASM?

Automatic StorageManagement

Replaces conventional file systems and volume managers

Capacity on demand Add/drop disks online

Automatic I/O load balancing Stripes data across disks to balance

load

Automatic mirroring

Easy to set up and use

Works with SAN, NAS or filesystems

Page 10: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

What ASM does do…

Stripe & mirror data across multiple disks

Reduces management overhead

Provides 0, 2 or 3-way mirroring

Can store almost all types of database related files*

Page 11: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

What ASM does not do…

Not an I/O broker or controller – I/O is still managed by the individual instances

Not a database – INSTANCE_TYPE=‘asm’

Acts as the mediator and definer

Not foolproof, luns can be removed out from under ASM!

Page 12: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

ASM - Setup

Install in own Oracle Home

Determine redundancy/mirroring

Determine LUN/Disk size

Partition devices

Install ASM software and start the “mini-cluster”

Page 13: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

The “mini-cluster”

The Oracle Cluster Synchronization Services Daemon is required for ASM – even for a single (non-RAC) database

Used for communication between ASM and database instances

Root.sh will create an entry in /etc/inittab to respawn cssd

Page 14: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

ASMlib

Defines disk/luns for use with ASM

Only available on Linux

service oracleasm

/dev/oracleasm

------------------------------------ ----------- ------------------------------asm_diskgroups string DGROUP1asm_diskstring string ORCL:VOL*

Page 15: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

init+ASM.ora

Only one ASM instance per node

*.asm_diskgroups=‘DATA'*.asm_diskstring='ORCL:*‘ -- linux*.asm_diskstring=‘/dev/asm_disk*’ -- unix*.asm_diskstring=‘/dev/c0t1d1*’ – unix*.asm_diskstring=‘/dev/sda1’*.instance_type='asm'*.processes=500 - Set to minimum of 25 + 15 * number of databases uses ASM for storage

------------------------------------ ----------- ------------------------------asm_diskgroups string DGROUP1asm_diskstring string ORCL:VOL*

Page 16: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Diskgroups

Diskgroups are the logical storage units for ASM

One or more for all databases on a server or cluster

Often, two diskgroups are created, one for tablespace and

another for FRA

Diskgroups may also be created by SAN speed (fast, middle,

slow)

Page 17: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Redundancy

ASM supports three types of redundancy

External – no mirroring within ASM, all at the OS level

Normal – the default – two way mirroring, each stripe is written to two extents

High – three way mirroring – each stripe written to one primary and two mirrored extents

Page 18: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Failgroups

Failgroups cannot be removed without recreating the diskgroup.

If one failgroup is lost or offline for a period of time, it will be re-synced when available again

Fail groups should be across different controllers or SANs

Page 19: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Tools to Manage ASM

SQL*Plus

ASMCMD

Grid Control / Database Control

SRVCTL – RAC only

Page 20: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Basic ASM Commands

Create a diskgroup:CREATE DISKGROUP dgroup1 DISK ’orcl:vol001’,’orcl:vol002’;

Drop a diskgroupDROP DISKGROUP dgroup1;

To drop a diskgroup which still contains data:DROP DISKGROUP dgroup1 INCLUDING CONTENTS;

Page 21: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Basic ASM Commands

Add luns to a diskgroup: ALTER DISKGROUP dgroup1 ADD DISK ‘orcl:vol006’;

Remove luns from a diskgroup:ALTER DISKGROUP dgroup1 REMOVE DISK ‘vol006’;

Do both at the same time:ALTER DISKGROUP dgroup1

ADD DISK'ORCL:VOL003','ORCL:VOL004'DROP DISK'VOL005'REBALANCE POWER 6;

Page 22: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Rebalancing

Redistribution only occurs when adding or dropping disk

Change the asm_power_limit, default 1, 0 up to 11

To modify the power limit for a disk group: alter diskgroup dgroup1 rebalance power 11;

Check on the status via V$ASM_OPERATION

Page 23: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Basic ASM Commands – Database level

Set for default diskgroup

db_create_file_dest=‘+DGROUP1’

Create tablespaces without names using OMF

CREATE TABLESPACE testts DATAFILE SIZE 5g;

ALTER TABLESPACE testts ADD DATAFILE SIZE 10g;

Page 24: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Basic ASM Commands – Database level

Set for default diskgroup for logfiles:

db_create_online_log_dest_1=‘+DGROUP1’

db_create_online_log_dest_2=‘+DGROUP1’

Create redo logs without names using OMF

ALTER SYSTEM ADD LOGFILE SIZE 200m;

Page 25: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Caveats

If ASM goes down, all instance that use ASM will immediately crash.

Normal or high redundancy may not show the actual disk use

Databases can remain unnoticed if not dropped

Loss of a disk (when using external redundancy) will result in the loss of the diskgroup

Page 26: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

ASM Myths and Legends

ASM will automatically rebalance hot spots

ASM controls file I/O

ASM must run on RAID 10

Disks/Luns must be added to a diskgroup in multiples of 4 or 8

Page 27: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Quick Guide to 11gR2

New Features

Page 28: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

3rd Party FSApplication

Automatic Storage Management (ASM)

ASM Instance Managing

Oracle DB Files

ASM Cluster & Single Node File System

(ACFS)

Database RAC

ACFS Snapshot

ASM Files

Dynamic Volume Manager

Dynamic Volumes

ACFS FSOracle

Bin

3rd PartyFS

DB DatafilesDB DatafilesDB DatafilesDB Datafiles

DB DatafilesDB Datafiles

OCR & Voting filesOCR & Voting files

ASM

Disk

Group

Page 29: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Oracle Database 11g Release 2Automatic Storage Management (ASM)

`

The foundation for Grid Storage

SiebelSiebelWebWeb

PSFTPSFT

DWDWODSODS

SOASOAIMDBIMDBOC4JOC4J

APACHEAPACHE

EBSEBS

DB Datafiles

DB Datafiles

OCR &Voting Files

OCR &Voting Files

BinariesBinaries

FileSystem

FileSystem

Au

tom

ati

c S

tora

ge

Man

ag

eme

nt

Au

tom

ati

c S

tora

ge

Man

ag

eme

nt

Page 30: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

New in 11gR2

ASM part of the clusterware

ACFS

ASMCA, ASMCMD

RAC - OCR/Voting disks in ASM

Diskgroup rename

Page 31: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

Recommended Reading

www.oracle.com/technology/asm - Oracle White Papers

www.oracleracsig.com – Oracle RAC SIG

www.oracle-base.com/articles/10g/ASMUsingASMLibAndRawDevices.php

www.juliandyke.com – Author Julian Dyke

www.idevelopment.info – Jeff Hunter

Page 32: Bare Bones ASM What Every DBA Needs to Know Jay Caviness Sr. Systems Engineer McKesson Provider Technologies.

More information

Contact: [email protected]

Corporate: www.mckesson.com/clinicals

Personal: www.grumpy-dba.com