oracle 10g automatic storage management overview of asm as a storage option for oracle 10g

26
Oracle 10 Oracle 10 g g Automatic Automatic Storage Management Storage Management Overview of ASM as a Storage Overview of ASM as a Storage Option for Oracle 10g Option for Oracle 10g

Upload: priscilla-king

Post on 18-Jan-2016

234 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

Oracle 10Oracle 10gg Automatic Automatic Storage ManagementStorage Management

Overview of ASM as a Storage Overview of ASM as a Storage Option for Oracle 10gOption for Oracle 10g

Page 2: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ObjectivesObjectivesAt the end of this module the student will At the end of this module the student will understand the following tasks and concepts.understand the following tasks and concepts.

Understand the role of ASMUnderstand the role of ASM Understand ASM componentsUnderstand ASM components Understand how ASM handles disk redundancyUnderstand how ASM handles disk redundancy Understand ASM Disk GroupsUnderstand ASM Disk Groups Understand ASM Directories and FilesUnderstand ASM Directories and Files Understand the uses of the ASMCMD commandUnderstand the uses of the ASMCMD command Understand how OEM interfaces with ASMUnderstand how OEM interfaces with ASM

Page 3: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

Automatic Storage Automatic Storage ManagementManagement

ASM is a storage management system for ASM is a storage management system for Oracle data Oracle data ASM is designed to simplify DBA storage tasksASM is designed to simplify DBA storage tasks Simply assign disks and walk away – no data Simply assign disks and walk away – no data

layout decisionslayout decisions Allows Oracle to manage thousands of files Allows Oracle to manage thousands of files

automaticallyautomatically Organizes available disks into disk groupsOrganizes available disks into disk groups

Page 4: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ASM and Oracle Managed ASM and Oracle Managed FilesFiles

ASM extends the power of Oracle ASM extends the power of Oracle Managed FilesManaged Files Creates and manages files automaticallyCreates and manages files automatically

Understands different Oracle file typesUnderstands different Oracle file types

Offers built-in data mirroring and striping Offers built-in data mirroring and striping capabilitiescapabilities

Automatically balances I/O load across disk Automatically balances I/O load across disk group(s)group(s)

Functionally like an LVM (Logical Volume Functionally like an LVM (Logical Volume Manager)Manager)

Page 5: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ASM DatabaseASM Database When ASM is enabled, Oracle When ASM is enabled, Oracle

automatically creates a small database automatically creates a small database for storing ASM-related meta-datafor storing ASM-related meta-data

The default database name is “+ASM”The default database name is “+ASM” The default RAC instances are “+ASMn”, The default RAC instances are “+ASMn”,

where n is the node numberwhere n is the node number The ASM database may be managed with The ASM database may be managed with

srvctl commandssrvctl commands Normally auto-managed by OracleNormally auto-managed by Oracle

Page 6: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ASM ComponentsASM Components Disk GroupsDisk Groups

Oracle may provide disk mirroring (optional)Oracle may provide disk mirroring (optional) Oracle will stripe files across all available disksOracle will stripe files across all available disks Using ASM striping across a group of hardware striped Using ASM striping across a group of hardware striped

LUNs can be beneficial to performanceLUNs can be beneficial to performance

Disks assigned to ASM Disk groups become Disks assigned to ASM Disk groups become ASM ASM DisksDisks

Files written on ASM disks become Files written on ASM disks become ASM filesASM files Files are named with an Oracle-defined formatFiles are named with an Oracle-defined format File name aliases may be defined for convenienceFile name aliases may be defined for convenience A hierarchical directory structure may be defined for A hierarchical directory structure may be defined for

file aliasesfile aliases

Page 7: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ASM ComponentsASM Components TemplatesTemplates may be used to may be used to

associate file attributes such as associate file attributes such as redundancy and striping with ASM redundancy and striping with ASM filesfiles

ASM is implemented through an ASM is implemented through an ASM instanceASM instance that runs as a that runs as a service on each nodeservice on each node

Page 8: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ASM Disk Group ASM Disk Group RedundancyRedundancy ASM Disk Groups may be defined with ASM Disk Groups may be defined with

different levels of redundancydifferent levels of redundancy NORMALNORMAL redundancy indicates that Oracle redundancy indicates that Oracle

will create a software mirror for each diskwill create a software mirror for each disk HIGHHIGH redundancy indicates that Oracle will redundancy indicates that Oracle will

create two mirror disks per data diskcreate two mirror disks per data disk Disk mirrors may be segregated into different Disk mirrors may be segregated into different

locations by designating Failure Groupslocations by designating Failure Groups

EXTERNALEXTERNAL redundancy indicates that Oracle redundancy indicates that Oracle will not create any software mirrors. will not create any software mirrors. Hardware mirrors (if any) will be used insteadHardware mirrors (if any) will be used instead External redundancy is recommended for any External redundancy is recommended for any

system with a highly available storage arraysystem with a highly available storage array

Page 9: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ASM Performance TipsASM Performance Tips ASM performance is sensitive to the ASM performance is sensitive to the

number of disk spindles utilizednumber of disk spindles utilized Just like traditional storage, the number of Just like traditional storage, the number of

IOs/second that can be sustained is directly IOs/second that can be sustained is directly proportional to the number of disks in the disk proportional to the number of disks in the disk groupgroup

Always use External Redundancy if you Always use External Redundancy if you are using RAID-capable storage hardwareare using RAID-capable storage hardware Multiple RAID 1 disks can be utilized in a Disk Multiple RAID 1 disks can be utilized in a Disk

GroupGroup ASM will provide the disk stripingASM will provide the disk striping

Another option is to use multiple four disk Another option is to use multiple four disk RAID 10 groups as the building block for ASM RAID 10 groups as the building block for ASM Disk GroupsDisk Groups ASM will stripe on top of the hardware stripe, ASM will stripe on top of the hardware stripe,

creating a stripe “plaid”, very desirable for OLTP and creating a stripe “plaid”, very desirable for OLTP and random I/O performancerandom I/O performance

Page 10: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

Creating ASM Disk Creating ASM Disk GroupsGroups ASM disk groups may be created as part of the ASM disk groups may be created as part of the

installation processinstallation process Raw device files may be used though their file name Raw device files may be used though their file name

aliasesaliases As an alternative to raw files, ASMLIB may be used to As an alternative to raw files, ASMLIB may be used to

stamp raw device filesstamp raw device files Creates a name alias for the raw device filesCreates a name alias for the raw device files

The “CREATE DISKGROUP” SQL statement may The “CREATE DISKGROUP” SQL statement may be used to create disk groups:be used to create disk groups: CREATE DISKGROUP dgroup_01 EXTERNAL CREATE DISKGROUP dgroup_01 EXTERNAL

REDUNDANCY DISK ‘C:\ASM*'; REDUNDANCY DISK ‘C:\ASM*'; The disk group created in this example will be referred The disk group created in this example will be referred

to as “+dgroup_01”to as “+dgroup_01”

Page 11: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ASM File CreationASM File Creation ASM files will be created automatically by ASM files will be created automatically by

Oracle when a new object is created:Oracle when a new object is created: ALTER SYSTEM SET DB_CREATE_FILE_DEST = ALTER SYSTEM SET DB_CREATE_FILE_DEST =

'+dgroup_01'; '+dgroup_01'; CREATE TABLESPACE mytspace1;CREATE TABLESPACE mytspace1;

Note: ASM files are only visible to Oracle Note: ASM files are only visible to Oracle through SQL, ASMCMD, Grid Control, or through SQL, ASMCMD, Grid Control, or OEMOEM Not visible as an OS level file – looks like a raw Not visible as an OS level file – looks like a raw

device to the OS device to the OS

Page 12: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ASM File FormatsASM File Formats ASM files have the following format:ASM files have the following format:

+group/dbname/file_type/+group/dbname/file_type/file_type_tag.file.incarnationfile_type_tag.file.incarnation

Where:Where: +group+group is the disk group name is the disk group name dbname dbname is the DB_UNIQUE_NAME of the databaseis the DB_UNIQUE_NAME of the database file_typefile_type is the Oracle file type is the Oracle file type tagtag is a descriptor appropriate to the file type is a descriptor appropriate to the file type file.incarnationfile.incarnation is the file/incarnation pair, used to is the file/incarnation pair, used to

ensure uniquenessensure uniqueness

An example of a fully qualified ASM filename is:An example of a fully qualified ASM filename is:+dgroup_01/oradb/controlfile/CF.248.1 +dgroup_01/oradb/controlfile/CF.248.1

Page 13: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

Creating ASM DirectoriesCreating ASM Directories Before creating an alias for an ASM file, Before creating an alias for an ASM file,

you must first create a directory you must first create a directory hierarchy to contain the file:hierarchy to contain the file: ALTER DISKGROUP dgroup_01 ADD ALTER DISKGROUP dgroup_01 ADD

DIRECTORY '+dgroup_01/newdir';DIRECTORY '+dgroup_01/newdir';

Page 14: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ASM File AliasesASM File Aliases An alias may be created in SQL for An alias may be created in SQL for

an ASM file name:an ASM file name: ALTER DISKGROUP dgroup_01 ADD ALTER DISKGROUP dgroup_01 ADD

ALIAS ALIAS '+dgroup_011/newdir/control_2.dbf' '+dgroup_011/newdir/control_2.dbf' FOR FOR '+dgroup_01/oradb/controlfile/CF.248.2''+dgroup_01/oradb/controlfile/CF.248.2'; ;

Oracle Enterprise Manager may be Oracle Enterprise Manager may be used to assign file aliasesused to assign file aliases An SQL statement is still required to An SQL statement is still required to

create the directory (as of Oracle 10g create the directory (as of Oracle 10g R1)R1)

Page 15: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

Creating a Tablespace with Creating a Tablespace with ASMASM Creating a Tablespace in ASM: Creating a Tablespace in ASM:

Example 1Example 1 Let Automatic Storage Management create Let Automatic Storage Management create

and manage the tablespace datafile for you:and manage the tablespace datafile for you: Assume the following initialization parameter Assume the following initialization parameter

setting:setting: DB_CREATE_FILE_DEST = '+dgroup2' DB_CREATE_FILE_DEST = '+dgroup2'

The following statement creates the The following statement creates the tablespace and its datafile:tablespace and its datafile: CREATE TABLESPACE tspace2; CREATE TABLESPACE tspace2;

Page 16: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

Creating a Tablespace with Creating a Tablespace with ASMASM Creating a Tablespace in ASM: Creating a Tablespace in ASM:

Example 2Example 2 The following statements create a tablespace The following statements create a tablespace

that uses a user defined template to specify that uses a user defined template to specify the redundancy and striping attributes of the the redundancy and striping attributes of the datafile:datafile: SQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST = SQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST =

'+dgroup1(my_template)'; '+dgroup1(my_template)'; SQL> CREATE TABLESPACE tspace3; SQL> CREATE TABLESPACE tspace3;

Page 17: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

Creating a Tablespace with Creating a Tablespace with ASMASM Creating a Tablespace in ASM: Creating a Tablespace in ASM:

Example 3Example 3 The following statement creates an The following statement creates an

undo tablespace with a datafile that undo tablespace with a datafile that has an alias name, and with attributes has an alias name, and with attributes that are set by the user defined that are set by the user defined template my_undo_template (not template my_undo_template (not Oracle Managed Files).Oracle Managed Files). CREATE UNDO TABLESPACE myundo CREATE UNDO TABLESPACE myundo

DATAFILE DATAFILE '+dgroup3(my_undo_template)/myfiles/my_'+dgroup3(my_undo_template)/myfiles/my_undo_ts' SIZE 200M; undo_ts' SIZE 200M;

Page 18: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ASMCMDASMCMD ASMCMD is a command-line utility for ASMCMD is a command-line utility for

viewing and manipulating files and viewing and manipulating files and directories within ASM disk groups.directories within ASM disk groups. Can be used in interactive modeCan be used in interactive mode Commands can be placed in OS scripts Commands can be placed in OS scripts

Available with 10g R2Available with 10g R2 ASMCMD can be used to: ASMCMD can be used to:

List the contents of disk groupsList the contents of disk groups Perform searchesPerform searches Create and remove directories and aliasesCreate and remove directories and aliases Display space utilizationDisplay space utilization And more.And more.

Page 19: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ASMCMD SyntaxASMCMD SyntaxCommandCommand DescriptionDescription cdcd Changes the current directory to the specified Changes the current directory to the specified

directory.directory. dudu Displays the total disk space occupied by ASM Displays the total disk space occupied by ASM

files in the specified ASM files in the specified ASM directory and all its directory and all its subdirectories, subdirectories, recursively.recursively.

exitexit Exits ASMCMD.Exits ASMCMD. findfind Lists the paths of all occurrences of the Lists the paths of all occurrences of the

specified name (with wildcards) specified name (with wildcards) under the under the specified directory.specified directory.

helphelp Displays the syntax and description of ASMCMD Displays the syntax and description of ASMCMD commands.commands.

lsls Lists the contents of an ASM directory, the Lists the contents of an ASM directory, the attributes attributes of the specified file, or the names of the specified file, or the names and attributes of and attributes of all disk groups.all disk groups.

lsctlsct Lists information about current ASM clients.Lists information about current ASM clients. lsdglsdg Lists all disk groups and their attributes.Lists all disk groups and their attributes. mkaliasmkalias Creates an alias for a system-generated filename.Creates an alias for a system-generated filename. mkdirmkdir Creates ASM directories.Creates ASM directories. pwdpwd Displays the path of the current ASM directory.Displays the path of the current ASM directory. rmrm Deletes the specified ASM files or directories.Deletes the specified ASM files or directories. rmaliasrmalias Deletes the specified alias, retaining the file that Deletes the specified alias, retaining the file that

the alias the alias points to.points to.

Page 20: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ASMCMD ExampleASMCMD Example In the following example, the rm command In the following example, the rm command

operates on the file undotbs1.272.557429239, operates on the file undotbs1.272.557429239, which in this case is a relative path. which in this case is a relative path.

ASMCMD prepends the current directory to the ASMCMD prepends the current directory to the command argument to obtain the absolute path command argument to obtain the absolute path to the fileto the file

ASMCMD [+] > cd +dgroup1 ASMCMD [+] > cd +dgroup1 ASMCMD [+DGROUP1] > cd sample/datafile ASMCMD [+DGROUP1] > cd sample/datafile ASMCMD [+DGROUP1/SAMPLE/DATAFILE] > ls ASMCMD [+DGROUP1/SAMPLE/DATAFILE] > ls EXAMPLE.269.555342243 EXAMPLE.269.555342243 SYSAUX.257.555341961 SYSAUX.257.555341961 SYSTEM.256.555341961 SYSTEM.256.555341961 UNDOTBS1.258.555341963 UNDOTBS1.258.555341963 UNDOTBS1.272.557429239 UNDOTBS1.272.557429239 USERS.259.555341963 USERS.259.555341963 ASMCMD [+DGROUP1/SAMPLE/DATAFILE] > rm ASMCMD [+DGROUP1/SAMPLE/DATAFILE] > rm

undotbs1.272.557429239 undotbs1.272.557429239

Page 21: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

OEM (Grid Control) ASM Home OEM (Grid Control) ASM Home PagePage In Grid Control In Grid Control

or Database or Database Control (OEM) Control (OEM) you can log you can log into an ASM into an ASM instance target instance target (usually (usually +ASM+ASMnn)) Check overall Check overall

Disk Group Disk Group healthhealth

Specific tabs Specific tabs for:for: PerformancePerformance AdministrationAdministration MaintenanceMaintenance

Page 22: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

OEM (Grid Control) ASM OEM (Grid Control) ASM Performance PagePerformance Page

Performance Performance Graphs for Disk Graphs for Disk Group metrics:Group metrics: Disk Group I/O Disk Group I/O

response Timeresponse Time Disk Group I/O Disk Group I/O

OperationsOperations Disk Group I/O Disk Group I/O

ThroughputThroughput

Page 23: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

OEM (Grid Control) ASM OEM (Grid Control) ASM Administration PageAdministration Page Provides Provides

administrative administrative access to disk access to disk groupsgroups Mount Disk Mount Disk

GroupsGroups Dismount Disk Dismount Disk

GroupsGroups Create Disk Create Disk

GroupsGroups Drill down to Drill down to

more detailmore detail

Page 24: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

OEM (Grid Control) ASM OEM (Grid Control) ASM Configuration PageConfiguration Page Configure Configure

parameters for parameters for Disk GroupsDisk Groups Data Discovery Data Discovery

Path – path for Path – path for discovering Disk discovering Disk GroupsGroups

Auto Mount Disk Auto Mount Disk Groups – list of Groups – list of Disk Groups to Disk Groups to mount mount automatically at automatically at startupstartup

Rebalance Power – Rebalance Power – affects speed of affects speed of Disk Group Disk Group rebalancing. High rebalancing. High numbers are numbers are faster, with more faster, with more I/O overhead (1-I/O overhead (1-11)11)

Page 25: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

ReviewReview Should you use normal redundancy Should you use normal redundancy

for a RAC system on a SAN?for a RAC system on a SAN? What ASM component associates What ASM component associates

redundancy and file striping redundancy and file striping attributes with a file type?attributes with a file type?

Do you have to create a file name Do you have to create a file name for each new Oracle object?for each new Oracle object?

List the format of a fully qualified List the format of a fully qualified ASM fileASM file

Give an example of an ASCMD Give an example of an ASCMD command.command.

Page 26: Oracle 10g Automatic Storage Management Overview of ASM as a Storage Option for Oracle 10g

SummarySummary ASM provides an easy-to-administer option for ASM provides an easy-to-administer option for

allocating storageallocating storage ASM extends the concept of Oracle Managed ASM extends the concept of Oracle Managed

FilesFiles ASM can provide both disk striping and disk ASM can provide both disk striping and disk

redundancyredundancy ASM components include Disk Groups, ASM ASM components include Disk Groups, ASM

Disks, Templates and ASM instancesDisks, Templates and ASM instances ASM Directories, Files and File Aliases may be ASM Directories, Files and File Aliases may be

optionally createdoptionally created ASMCMD may be used to simulate a traditional ASMCMD may be used to simulate a traditional

file system command line interfacefile system command line interface Grid Control (OEM) provides several useful Grid Control (OEM) provides several useful

ASm oriented screensASm oriented screens