administering storage in rac parti

Upload: -

Post on 07-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Administering Storage in RAC PartI

    1/58

    Administering Storage in RAC(Part I)

  • 8/6/2019 Administering Storage in RAC PartI

    2/58

    Objectives

    After completing this lesson, you shouldbeable to do the following: Describe automatic storage management(ASM)

    Install the ASM software Set up initialization parameter files forASM and database instances Start up and shut down ASM instancesAdd ASM instances to the target list of

    Database Control Use Database Control to administer ASM ina RAC environment

  • 8/6/2019 Administering Storage in RAC PartI

    3/58

    What Is Automatic StorageManagement?

    Is a purpose-built cluster file system andvolume manager

    Manages Oracle database files Spreads data across disksto balance load

    Provides integrated mirroringacross disks

    Solves many storagemanagement challenges

    ASMFilesystem

    Logical

    volumemanager

    Operatingsystem

    Application

    Database

  • 8/6/2019 Administering Storage in RAC PartI

    4/58

    ASM: Key Features and Benefits

    Stripes files rather than logical volumes Enables online disk reconfiguration anddynamic rebalancing

    Provides adjustable rebalancing speed Provides redundancy on a file basis Supports only Oracle files Is cluster aware Is automatically installed as part of thebase code set

  • 8/6/2019 Administering Storage in RAC PartI

    5/58

    ASM: New Concepts

    Database

    Tablespace

    Segment

    Extent

    Oracleblock

    Data file

    Physicalblock

    ASMdisk group

    ASM disk

    ASM file

    Allocation

    unit

    File system

    fileorraw device

  • 8/6/2019 Administering Storage in RAC PartI

    6/58

    ASM: General Architecture

    ASM

    InstanceSID=ant

    ASM

    InstanceSID=bee

    ASM disks ASM disks ASM disks ASM disks ASM disks ASM disks

    ASM Disk group Tom ASM Disk groupDick

    ASM Disk groupHarry

    DBInstanceSID=sale

    s

    DBInstanc

    e

    SID=test

    DBInstanceSID=sale

    s

    DBInstanc

    e

    SID=test

    ASMB

    ASMB

    FG

    FG FG

    FG

    Node2Node1

    GroupServicestom=antdick=antharry=ant

    GroupServicestom=beedick=beeharry=bee

    DBW0

    DBW0DBW0

    DBW0ASMB

    RBAL RBAL

    ARB0

    ARBA

    ARB0

    ARBA

    ASMB

    RBAL

    RBAL RBAL

    RBAL

  • 8/6/2019 Administering Storage in RAC PartI

    7/58

    Notes only slide

  • 8/6/2019 Administering Storage in RAC PartI

    8/58

    ASM Instance and Crash Recovery inRAC

    Disk groupA

    Node2

    +ASM2

    Node1

    +ASM1

    Both instancesmount

    disk group

    Disk groupA

    Node2

    +ASM2

    Node1

    +ASM1

    ASM instancefailure

    Disk groupA

    Node2

    +ASM2

    Node1

    Disk grouprepaired

    by survivinginstance

    Disk Group A

    Node2

    +ASM2

    Node1

    +ASM1

    Only oneinstance

    mounts diskgroup

    Disk Group A

    Node2

    +ASM2

    Node1

    +ASM1

    ASM instancefailure

    Disk Group A

    Node2

    +ASM2

    Node1

    Disk grouprepaired

    when nextmounted

    ASM crashrecovery

    ASM instancerecovery

  • 8/6/2019 Administering Storage in RAC PartI

    9/58

    ASMLibs

    An ASMLib is a storage-managementinterface between Oracle kernel and diskstorage.

    You can load multiple ASMLibs. Purpose built drivers can provide:

    o Device discoveryoMore efficient I/O interfaceo Increased performance and reliability

    Oracle freely delivers an ASMLib on Linux.

    Several participating storage vendors suchas EMC and HP are joining this initiative.

  • 8/6/2019 Administering Storage in RAC PartI

    10/58

    Oracle Linux ASMLib Installation:Overview

    1. Install the ASMLib packages on eachnode:o http://otn.oracle.com/tech/linux/asmlibo Install oracleasm-support, oracleasmlib, and

    kernel-related packages2. Configure ASMLib on each node:o Load ASM driver and mount ASM driver filesystem

    o Use the oracleasm script with the configureoption

    3. Make disks available to ASMLibbymarking disks using oracleasm creatediskon one node.4. Make sure that disks are visible onother nodes using oracleasm scandisks.5. Use appropriate discovery strings forthis ASMLib.

  • 8/6/2019 Administering Storage in RAC PartI

    11/58

    Oracle Linux ASMLib Installation

    Install the packages as the root user:

    Run oracleasm with the configure option:

    o Provide oracle UID as the driver owner.o Provide dba GID as the group of the driver.o Load the driver at system startup.

    # rpm -i oracleasm-support-version.arch.rpm \oracleasm-kernel-version.arch.rpm \oracleasmlib-version.arch.rpm

    # /etc/init.d/oracleasm configure

  • 8/6/2019 Administering Storage in RAC PartI

    12/58

    Notes only page

  • 8/6/2019 Administering Storage in RAC PartI

    13/58

    ASM Library Disk Creation

    Identify the device name for the disksthat you want to use with the fdisk lcommand.

    Create a single whole-disk partition onthe disk device with fdisk.

    Enter a command similar to the followingto mark the shared disk as an ASM disk:

    To make the disk available on the othernodes, enter the following as root on eachnode:

    Set the ASM_DISKSTRING parameter

    /etc/init.d/oracleasm createdisk disk1 /dev/sdbn

    # /etc/init.d/oracleasm scandisks

  • 8/6/2019 Administering Storage in RAC PartI

    14/58

    Notes only page

  • 8/6/2019 Administering Storage in RAC PartI

    15/58

    ASM Administration

    ASM instance

    Disk groups and disks

    Files

    00100010

  • 8/6/2019 Administering Storage in RAC PartI

    16/58

    ASM Instance Functionalities

    CREATE DISKGROUP

    ALTER DISKGROUP DR OP DISKGROUP

    ALTER SYSTEM RESTRICTED SESSION

    ASMinstance

    Databaseinstance

  • 8/6/2019 Administering Storage in RAC PartI

    17/58

    ASM Instance Creation

  • 8/6/2019 Administering Storage in RAC PartI

    18/58

    ASM Instance InitializationParameters

    INSTANCE_TYPE = ASMDB_UNIQUE_NAME = +ASMASM_POWER_LIMIT = 1ASM_DISKSTRING = '/dev/rdsk/*s2', '/dev/rdsk/c1*'

    ASM_DISKGROUPS = dgroupA, dgroupBLARGE_POOL_SIZE = 8MB

    PROCESSES = 25 + 15*

  • 8/6/2019 Administering Storage in RAC PartI

    19/58

    RAC and ASM Instances Creation

  • 8/6/2019 Administering Storage in RAC PartI

    20/58

    ASM Instance InitializationParameters and RAC

    CLUSTER_DATABASE: This parameter must beset to TRUE.

    ASM_DISKGROUP:oMultiple instances can have different

    values.o Shared disk groups must be mountedby eachASM instance.

    ASM_DISKSTRING:oMultiple instances can have differentvalues.

    o With shared disk groups, every instanceshouldbe able to see the common pool of

    physical disks.ASM_POWER_LIMIT: Multiple instances canhave different values.

  • 8/6/2019 Administering Storage in RAC PartI

    21/58

    Discovering New ASM Instances withEM

    If new ASM targets are not discovered:

    $ emctl config agent addtarget

    $ emctl stop agent

    $ emctl start agent

  • 8/6/2019 Administering Storage in RAC PartI

    22/58

    Accessing an ASM Instance

    Diskgroup

    Diskgroup

    Storagesystem

    AS SYSDBA ASMinstanc

    e

    Alloperations

  • 8/6/2019 Administering Storage in RAC PartI

    23/58

    Dynamic Performance View Additions

    Storagesystem

    V$ASM_DISKGROUPV$ASM_CLIENT

    V$ASM_DISK

    V$ASM_FILE

    V$ASM_TEMPLATE

    V$ASM_ALIAS

    V$ASM_OPERATION

    Disk groupA

    Disk groupB

  • 8/6/2019 Administering Storage in RAC PartI

    24/58

    ASM Home Page

  • 8/6/2019 Administering Storage in RAC PartI

    25/58

    ASM Performance Page

  • 8/6/2019 Administering Storage in RAC PartI

    26/58

    ASM Configuration Page

  • 8/6/2019 Administering Storage in RAC PartI

    27/58

    Starting Up an ASM Instance

    $ sqlplus /nologSQL> CONNECT / AS sysdbaConnected to an idle instance.SQL> STARTUP;

    ASM instance startedTotal System Global Area 147936196 bytesFixed Size 324548 bytesVariable Size 96468992 bytesDatabase Buffers 50331648 bytesRedo Buffers 811008 bytesASM diskgroups mounted

  • 8/6/2019 Administering Storage in RAC PartI

    28/58

    Shutting Down an ASM Instance

    ASM

    SHUTDOWN NORMAL

    DB

    SHUTDOWN

    ASM

    SHUTDOWN IMMEDIATE

    DB instanceimmediatelyaborted

  • 8/6/2019 Administering Storage in RAC PartI

    29/58

    ASM Administration

    ASM instance

    Disk groups and disks

    Files

    00100010

  • 8/6/2019 Administering Storage in RAC PartI

    30/58

    ASM Disk Group

    Is a pool of disks managedasa logical unit

    Partitions total diskspace into uniform-sizedunits

    Spreads each file evenlyacross all disks

    Provides coarse- or fine-

    grain striping based onfile type

    Administers disk groups,not files

    Diskgroup

    ASMinstanc

    e

  • 8/6/2019 Administering Storage in RAC PartI

    31/58

    Failure Group

    Controller1

    Controller2

    Failuregroup 1

    Failuregroup 2

    Disk groupA

    Controller3

    Failuregroup 3

    1 7 13

    1 7 13

    1 7 13

    1 7 13

    1 7 13

    1 7 13

    1 7 13

    1 7 13

    1 7 13

    2

    3

    4

    5

    6

  • 8/6/2019 Administering Storage in RAC PartI

    32/58

    Disk Group Mirroring

    Mirror at AU levelMix primary and mirrorAUs on each disk External redundancy:

    Defers to hardwaremirroringNormal redundancy:

    o Two-way mirroringoAt least two failure groups

    High redundancy:o Three-way mirroringoAt least three failure groups

  • 8/6/2019 Administering Storage in RAC PartI

    33/58

    Disk Group Dynamic Rebalancing

    Automatic onlinerebalancing wheneverstorage configurationchanges

    Only move dataproportional tostorage added

    No need for manualI/O tuning

    Online migration tonew storage

  • 8/6/2019 Administering Storage in RAC PartI

    34/58

    ASM Administration Page

  • 8/6/2019 Administering Storage in RAC PartI

    35/58

    Create Disk Group Page

  • 8/6/2019 Administering Storage in RAC PartI

    36/58

    ASM Disk Groups with EM in RAC

  • 8/6/2019 Administering Storage in RAC PartI

    37/58

    Disk Group Performance Page andRAC

  • 8/6/2019 Administering Storage in RAC PartI

    38/58

    Create or Delete Disk Groups

    CREATE DISKGROUP dgroupA NORMAL REDUNDANCYFAILGROUP controller1 DISK'/devices/A1' NAME diskA1 SIZE 120G FORCE,'/devices/A2','/devices/A3'FAILGROUP controller2 DISK'/devices/B1','/devices/B2','/devices/B3';

    DROP DISKGROUP dgroupA INCLUDING CONTENTS;

  • 8/6/2019 Administering Storage in RAC PartI

    39/58

    Adding Disks to Disk Groups

    ALTER DISKGROUP dgroupA ADD DISK'/dev/rdsk/c0t4d0s2' NAME A5,'/dev/rdsk/c0t5d0s2' NAME A6,'/dev/rdsk/c0t6d0s2' NAME A7,'/dev/rdsk/c0t7d0s2' NAME A8;

    ALTER DISKGROUP dgroupA ADD DISK '/devices/A*';

    Diskformatting

    Disk grouprebalancing

  • 8/6/2019 Administering Storage in RAC PartI

    40/58

    Miscellaneous Alter Commands

    ALTER DISKGROUP dgroupADROP DISKA5;

    ALTER DISKGROUP dgroupADROP DISKA6ADD FAILGROUP fred

    DISK '/dev/rdsk/c0t8d0s2' NAME A9;

    ALTER DISKGROUP dgroupB REBALANCE POWER 5;

    ALTER DISKGROUP dgroupAUNDROP DISKS;

    ALTER DISKGROUP dgroupADISMOUNT;

    ALTER DISKGROUP dgroupACHECK ALL;

  • 8/6/2019 Administering Storage in RAC PartI

    41/58

    Notes only page

  • 8/6/2019 Administering Storage in RAC PartI

    42/58

    Monitoring Long-Running OperationsUsing V$ASM_OPERATION

    Estimated amount of time (in minutes)for operation termination

    EST_MINUTES

    Estimated number of allocation unitsmoved per minute

    EST_RATE

    Estimated number of remainingallocation units

    EST_WORK

    Number of allocation units moved sofar

    SOFAR

    Power allocated to this operationACTUAL

    Power requested for this operationPOWERState of operation: QUEUED or RUNNINGSTATE

    Type of operation: REBALOPERATION

    Disk groupGROUP_NUMBER

    DescriptionColumn

  • 8/6/2019 Administering Storage in RAC PartI

    43/58

    ASM Administration

    ASM instance

    Disk groups and disks

    Files

    00100010

  • 8/6/2019 Administering Storage in RAC PartI

    44/58

    ASM Files

    Databasefile

    ASM file automatically spread insidedgroupA

    CREATE TABLESPACE sample DATAFILE '+dgroupA';

    1

    23

    4

    1 2 3 4

    Automatic

    ASM filemanagement

    RMAN

    Mandatoryfor

    backups

  • 8/6/2019 Administering Storage in RAC PartI

    45/58

    ASM File Names

    ASMfilename

    Fullyqualifie

    d

    Incomplete

    with

    template

    Numeric Alias Aliaswithtemplate

    Incomplete

    Reference

    Single-file

    creation

    Multiple-file

    creation

  • 8/6/2019 Administering Storage in RAC PartI

    46/58

    ASM File Name Syntax

    +///..

    +..

    +////

    +

    +()

    +////()

    1

    2

    3

    4

    5

    6

  • 8/6/2019 Administering Storage in RAC PartI

    47/58

    Notes only slide

  • 8/6/2019 Administering Storage in RAC PartI

    48/58

  • 8/6/2019 Administering Storage in RAC PartI

    49/58

  • 8/6/2019 Administering Storage in RAC PartI

    50/58

    ALTER DISKGROUP dgroupAADD TEMPLATE reliable ATTRIBUTES (MIRROR);ALTER DISKGROUP dgroupA DROP TEMPLATE reliable;

    ALTER DISKGROUP dgroupADROP FILE '+dgroupA.268.8675309';

    ALTER DISKGROUP dgroupAADD DIRECTORY '+dgroupA/mydir';ALTER DISKGROUP dgroupAADD ALIAS '+dgroupA/mydir/datafile.dbf'FOR '+dgroupA.274.38745';ALTER DISKGROUP dgroupADROP ALIAS '+dgroupA/mydir/datafile.dbf';

    Template and Alias: Examples

  • 8/6/2019 Administering Storage in RAC PartI

    51/58

    Retrieving Aliases

    SELECT reference_index INTO :alias_idFROM V$ASM_ALIASWHERE name = '+dgroupA';

    SELECT reference_index INTO :alias_idFROM V$ASM_ALIASWHERE parent_index = :alias_id AND name = 'mydir';

    SELECT name

    FROM V$ASM_ALIASWHERE parent_index = :alias_id;

  • 8/6/2019 Administering Storage in RAC PartI

    52/58

    SQL Commands and File Naming

    CREATE CONTROLFILE DATABASE sampleRESETLOGS ARCHIVELOGMAXLOGFILES 5 MAXLOGHISTORY 100MAXDATAFILES 10 MAXINSTANCES 2LOGFILE GROUP 1 ('+dgroupA','+dgroupB') SIZE 100M,GROUP 2 ('+dgroupA','+dgroupB') SIZE 100MDATAFILE '+dgroupA.261.12345678' SIZE 100M,'+dgroupA.262.12345678' SIZE 100M;

  • 8/6/2019 Administering Storage in RAC PartI

    53/58

    DBCA and Storage Options

  • 8/6/2019 Administering Storage in RAC PartI

    54/58

    Database Instance ParameterChanges

    INSTANCE_TYPE = RDBMSLOG_ARCHIVE_FORMATDB_BLOCK_SIZEDB_CREATE_ONLINE_DEST_n

    DB_CREATE_FILE_DEST_nDB_RECOVERY_FILE_DESTCONTROL_FILESLOG_ARCHIVE_DEST_nLOG_ARCHIVE_DESTSTANDBY_ARCHIVE_DEST

  • 8/6/2019 Administering Storage in RAC PartI

    55/58

    Database Instance ParameterChanges

    Add at least 600 KB to LARGE_POOL_SIZEAdd the following to SHARED_POOL_SIZE:

    SELECT d+l+t DB_SPACEFROM (SELECT SUM(bytes)/(1024*1024*1024) dFROM v$datafile),(SELECT SUM(bytes)/(1024*1024*1024) lFROM v$logfile a, v$log bWHERE a.group#=b.group#),

    (SELECT SUM(bytes)/(1024*1024*1024) tFROM v$tempfile WHERE status='ONLINE');

    Add at least 16 to PROCESSES

    (DB_SPACE/100+2)*#_External_RedOR(DB_SPACE/50+4)*#_Normal_RedOR(DB_SPACE/33+6)*#_High_Red

  • 8/6/2019 Administering Storage in RAC PartI

    56/58

    Summary

    In this lesson, you should have learned howto: Use the DBCA to create an ASM instance Start up and shut down ASM instances Create and maintain ASM disk groups Create database files using ASM

  • 8/6/2019 Administering Storage in RAC PartI

    57/58

    Practice 5 Overview

    This practice covers the following topics: Installing ASMLib. Using the DBCA to create ASM instances. Discovering ASM instances in Database

    Control. Creating new ASM disk groups usingDatabase Control.

    Generating automatic disk grouprebalancing operations.

  • 8/6/2019 Administering Storage in RAC PartI

    58/58