less05 asm instance

Download Less05 asm instance

Post on 13-May-2015

1.976 views

Category:

Documents

1 download

Embed Size (px)

DESCRIPTION

ORACLE 11g

TRANSCRIPT

  • 1.5Managing the ASM Instance Copyright 2009, Oracle. All rights reserved.

2. ObjectivesAfter completing this lesson, you should be able to: Describe the benefits of using ASM Manage the ASM instance Create and drop ASM disk groups Extend ASM disk groups Retrieve ASM metadata by using various utilities5-2Copyright 2009, Oracle. All rights reserved. 3. ASM Benefits for AdministratorsASM eliminates: ASM significantly reduces: I/O performance tuning Logical Unit Number (LUN) Data file movements and management reorganizations Fewer, larger LUNs File name management Database administrator Logical volume dependence on system management administrator File system management Likelihood of errorsassociated with manual Cluster file systemmaintenance tasks management Raw device management5-3 Copyright 2009, Oracle. All rights reserved. 4. ASM InstanceThe ASM Instance is a combination of the process and memorycomponents for ASM.System Global Area (SGA) memorySharedLarge ASMFree Pool Pool CacheMemory Processes CPU componentsRBAL ARBn GMON OnnnPZ9nMARKOther misc. processesASM Instance5-4Copyright 2009, Oracle. All rights reserved. 5. ASM Components:ASM InstancePrimary Processes The ASM instance primary processes are responsible for ASM- related activities.Process DescriptionRBAL Opens all device files as part of discovery and coordinates the rebalance activityARBn One or more slave processes that do the rebalance activityGMON Responsible for managing the disk-level activities such as drop or offline and advancing the ASM disk group compatibilityMARK Marks ASM allocation units as stale when neededOnnn One or more ASM slave processes forming a pool of connections to the ASM instance for exchanging messagesPZ9n One or more parallel slave processes used in fetching data on clustered ASM installation from GV$ views5-6Copyright 2009, Oracle. All rights reserved. 6. ASM Instance Initialization ParametersThe ASM instance uses a small subset of the parameters thatan Oracle Database instance uses. INSTANCE_TYPE = ASM ASM_POWER_LIMIT = 1 ASM_DISKSTRING = /dev/sda1,/dev/sdb* ASM_DISKGROUPS = DATA2, FRA ASM_PREFERRED_READ_FAILURE_GROUPS = DATA.FailGroup2 DIAGNOSTIC_DEST = /u01/app/oracle LARGE_POOL_SIZE = 12M REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE5-7 Copyright 2009, Oracle. All rights reserved. 7. Interaction Between Database Instancesand ASM ASM InstanceSystem Global Area Database InstanceCreate FileSystem Global Area 1 Shared LargeASM3 PoolPoolCacheShared Large BufferExtent Map PoolPoolCacheProcessesGMON Processes CommitRBAL PZ9nARBn SMON56MARKOnnnOther PMONCKPTDBWR Close LGWR Other Snnn 2 4 Initialize Allocation ASM Storage5-9Copyright 2009, Oracle. All rights reserved. 8. ASM Instance: Dynamic Performance Views The ASM instance hosts memory-based metadata tables presented as dynamic performance views. Accessed by ASM utilities to retrieve metadata-only information using the SQL language Contains many dedicated ASM-related views such as: V$ASM_ALIAS V$ASM_ATTRIBUTEV$ASM_CLIENT V$ASM_DISKV$ASM_DISK_IOSTATV$ASM_DISK_STAT V$ASM_DISKGROUP V$ASM_DISKGROUP_STAT V$ASM_FILE V$ASM_OPERATION V$ASM_TEMPLATE5 - 10 Copyright 2009, Oracle. All rights reserved. 9. ASM System PrivilegesAn ASM instance does not have a data dictionary, so the only way to connect to ASM is by using these system privileges.ASM Privilege Privilege Group Privilege(Suggested)SYSASMOSASM Full administrative privilege(asmadmin)SYSDBAOSDBA Access to data stored on ASM, and SYSASM(asmdba)in the current releaseSYSOPER OSOPERLimited privileges to start and stop the ASM(asmoper) instance along with a set of nondestructiveALTER DISKGROUP commandsThe SYS user is automatically created with the SYSASM privilege.5 - 11 Copyright 2009, Oracle. All rights reserved. 10. Using Enterprise Manager to Manage ASM Users5 - 12 Copyright 2009, Oracle. All rights reserved. 11. Starting and Stopping ASM Instances Using SQL*Plus Using SQL*Plus to start and stop ASM instances is similar to the way in which you start and stop database instances.$ . oraenvORACLE_SID = [orcl] ? +ASMThe Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/gridis /u01/app/oracle$ sqlplus / AS SYSASMSQL*Plus: Release 11.2.0.1.0 - Production on Wed Jul 8 20:46:46 2009Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to an idle instance.SQL> startupASM instance startedTotal System Global Area 284565504 bytesFixed Size1336028bytesVariable Size 258063652bytesASM Cache25165824bytesASM diskgroups mountedASM diskgroups volume enabledSQL> shutdown abort5 - 13 Copyright 2009, Oracle. All rights reserved. 12. Starting and Stopping ASM Instances Using srvctl The Server Control utility (srvctl) can be used to start and stop ASM instances.$ . oraenvORACLE_SID = [orcl] ? +ASMThe Oracle base forORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is/u01/app/oracle$ srvctl start asm -o mount$ srvctl stop asm -f The Sever Control utility (srvctl) can be used to check the status of ASM instances.$ srvctl status asmASM is running on edrsr25p15 - 15 Copyright 2009, Oracle. All rights reserved. 13. Starting and Stopping ASM InstancesUsing asmcmd The asmcmd utility provides a command-line interface to ASM without using the SQL language.$ . oraenvORACLE_SID = [orcl] ? +ASMThe Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/gridis /u01/app/oracle$ asmcmdConnected to an idle instance.ASMCMD> startupASM instance startedTotal System Global Area 284565504 bytesFixed Size1336028bytesVariable Size 258063652bytesASM Cache25165824bytesASM diskgroups mountedASM diskgroups volume enabledASMCMD> shutdown --abortASM instance shut downConnected to an idle instance.5 - 16 Copyright 2009, Oracle. All rights reserved. 14. Screen reader hint: This slidecontains a diagram that is explained in the speaker notes.Disk Group OverviewOracle DBOracle DB Oracle DB Oracle DBOracle DB Instance InstanceInstanceInstance Instance ASM InstanceASM Instance ASM Instance ASM Instance ASM InstanceOracle RACServers Database Database Database ASM Clustered Pool of StorageDisk 1Disk 2Disk 3Disk 4 Disk 5Disk 6 File 3 File 4 File 1 File 2 Disk Group A Disk Group B5 - 17Copyright 2009, Oracle. All rights reserved. 15. ASM Disks ASM disks: Are the storage devices provisioned to ASM disk groups Are accessed through normal O/S interfaces Must be read and write accessible by the ASM owner Must be accessible by all nodes in a cluster May have different O/S names or paths on different nodes May be: An entire physical disk or partition of a physical disk A disk or partition from a storage array Logical volumes (LV) or logical units (LUN) Network-attached files (NFS)5 - 18Copyright 2009, Oracle. All rights reserved. 16. Allocation Units ASM disks are divided into allocation units (AU): AU size is configurable at disk group creation. Default AU size is 1 MB: Small enough to be cached by database and large enough for efficient sequential accessAllowable AU sizes: 1, 2, 4, 8, 16, 32, or 64 MB Large AUs may be useful in very large database (VLDB) scenarios or when using specialized storage hardware5 - 19 Copyright 2009, Oracle. All rights reserved. 17. ASM Files ASM files: Are a collection of ASM extents composed of AUs Variable sized extents support large filesAppear as normal files to the database kernelHave file names that start with + For example, +DATA/orcl/datafile/system.256.689832921May be associated with an optional alias file name For example, +DATA/dbfiles/mydb/system01.dbfAre evenly distributed across disks in a disk groupAre mirrored according to the policies defined in the disk group5 - 20Copyright 2009, Oracle. All rights reserved. 18. Extent MapsDisk GroupASM FileDisk A15 ExtentMapDisk B26Disk C37Disk DFile Extent485 - 21 Copyright 2009, Oracle. All rights reserved. 19. Striping Granularity ASM separates striping for load balance and striping for latency: Coarse-grain striping concatenates allocation units for loadbalancing. For example: ASM Disk Group5 - 22Copyright 2009, Oracle. All rights reserved. 20. Fine-Grained Striping Fine-grain striping puts 128 KB stripe units across groups of allocation units to improve latency. Disk group with 8 disks and external redundancy Default AU size of 1 MB in use First 1 MB extent written as 128 KB stripes across 8 AUsASM Disk Group5 - 23Copyright 2009, Oracle. All rights reserved. 21. Fine-Grained Striping Example: Disk group with 8 disks and external redundancy Default AU size of 1 MB in use Next 1 MB extent written as 128 KB stripes across thesame 8 allocation units until they are full ASM Disk Group5 - 24 Copyright 2009, Oracle. All rights reserved. 22. ASM Failure GroupsA set of disks sharing a common resource whose failure needs to be toleratedMirrored extent copies stored in separate failure groupsStorage hardware dictates failure group boundaries Example based on isolating disk controllers:5 - 25Copyright 2009, Oracle. All rights reserved. 23. Stripe and Mirror Example Normal redundancy disk group with eight disks in total, spread across two failure groups.5 - 26Copyright 2009, Oracle. All rights reserved. 24. Failure Example If disk H fails, then the extents it contained are re-created on surviving disks from surviving mirrors.5 - 27 Copyright 2009, Oracle. All rights reserved. 25. Managing Disk GroupsCREATE DISKGROUPASMDROP DISKGROUPinstance Database instanceALTER DISKGROUP5 - 28Copyright 2009, Oracle. All rights reserved. 26. Creating and Dropping Disk Groups Using SQL*Plus$ . oraenvORACLE_SID = [orcl] ? +ASMThe Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/gridis /u01/app/oracle$ sqlplus / AS SYSASMSQL*Plus: Release 11.2.0.1.0 - Production on Wed Jul 8 20:46:46 2009Copyright (c) 1982, 2009, Oracle. All rights reserved...SQL> CREATE DISKGROUP dgroupA NORMAL REDUNDANCYFAILGROUP controller1 DISK /devices/A1 NAME diskA1 SIZE 120G FORCE, /devices/A2,FAILGROUP controller2 DISK /devices/B1, /devices/B2;SQL> DRO