Tuesday, December 29, 2015

11gR2 ASM Commands and Details

ASM
ASM Parameters:
==> There are three groupings of parameters for an ASM instance, they are below.
- INSTANCE_TYPE=ASM is the only mandatory parameter setting.
- There are a number of ASM-specific parameters, These have names starting with ASM_.
- Some database parameters are valid for ASM.
  For example, MEMORY_TARGET


ASM_DISKGROUPS:
- ASM_DISKGROUPS specifies a list of disk group names that ASM automatically mounts at instance startup.
- Is automatically modified when disk groups are added, deleted, mounted, or unmounted if using an SPFILE
- Must be manually adjusted if using a PFILE(Except when ASMCA is used to create a new disk group)

Disk Groups Mounted at ASM startup:

==> At startup, the Oracle ASM instance attempts to mount the following disk groups:
- Disk groups specified in the ASM_DISKGROUPS initialization parameter
- Disk group used by Cluster Synchronization Services (CSS) for voting files
- Disk groups used by Oracle Clusterware for the Oracle Cluster Registry (OCR)
- Disk group used by the Oracle ASM instance to store the ASM server parameter file (SPFILE)

ASM_POWER_LIMIT:

- The ASM_POWER_LIMIT initialization parameter specifies the default power for disk rebalancing.
 - Default is 1.
 - Meaning ASM conducts rebalancing operations using minimal system resources
- Allowable range is 0 to 11.
- 0 disables rebalancing operations.
- Lower values use fewer system resources but result in slower rebalancing operations.
- Higher values use more system resources to achieve faster rebalancing operations.
- It can be set dynamically using ALTER SYSTEM or ALTER SESSION.

CLUSTER_DATABASE:

- CLUSTER_DATABASE specifies whether or not storage clustering is enabled.
- Set CLUSTER_DATABASE = TRUE for multiple ASM instances to access the same ASM disks concurrently.
- Clustered ASM can support clustered (RAC) and single-instance (non-RAC) databases.

MEMORY_TARGET:

- MEMORY_TARGET specifies the total memory used by an ASM instance.
- Oracle strongly recommends that you use automatic memory management for ASM.
- All other memory-related instance parameters are automatically adjusted based on MEMORY_TARGET.
- The default value of 272 MB is suitable for most environments. It can be increased dynamically using ALTER SYSTEM.

Adjusting ASM Instance Parameters in SPFILEs:

- The server parameter file (SPFILE) is a binary file that cannot be edited using a text editor.
- Use Oracle Enterprise Manager or the ALTER SYSTEM SQL command to adjust ASM instance parameter settings in an SPFILE.
Eg:
SQL> ALTER SYSTEM SET ASM_DISKSTRING='ORCL:*' SID='*' SCOPE=SPFILE;

Note: In a clustered ASM environment, SPFILEs should reside in ASM or a cluster file system.
- For example, to adjust your SPFILE so that your ASM environment discovers only Oracle ASMLib disks, you could execute:
SQL> ALTER SYSTEM SET ASM_DISKSTRING='ORCL:*' SID='*' SCOPE=SPFILE;

Starting and Stopping ASM Instances by Using srvctl:

- The Sever Control utility (srvctl) can be used to start and stop ASM instances.
One node at a time:
$ srvctl start asm -n host01$ srvctl start asm -n host02
$ srvctl status asm -n host01
ASM is running on host01.
$ srvctl status asm -n host02
ASM is running on host02.

All nodes simultaneously:
$ srvctl stop asm
$ srvctl status asm -n host01
ASM is not running on host01.
$ srvctl status asm
ASM is not running on host01,host02.

Starting and Stopping ASM Instances by Using ASMCA and ASMCMD:

- The ASMCA utility shown in the slide allows you to start and stop an ASM instance. The ASMCMD utility also includes the ability to start and start ASM instances with the following
commands:
asmcmd start asm
$ asmcmd
ASMCMD [+] > shutdown
ASMCMD [+] > shutdown --immediate
ASMCMD [+] > shutdown --abort
ASMCMD> startup --nomount --pfile asm_init.ora
ASMCMD> startup --mount

Note: Oracle Clusterware is a client of ASM when the OCR files and voting files are in ASM disk groups. Stopping the Oracle Clusterware services includes stopping ASM.

Starting and Stopping the ASM Listeners:

Using the lsnrctl utility:
$ lsnrctl start listener
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 08-OCT-2009 22:44:22
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
Starting /u01/app/11.2.0/grid/bin/tnslsnr: please wait...
... Intermediate output removed ...
The command completed successfully
$

Using the srvctl utility:

$ srvctl start listener -n host01
$

ASM Dynamic Performance Views:

- The ASM instance hosts memory-based metadata tables presented as dynamic performance views.
- Is 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_ATTRIBUTE
V$ASM_CLIENT
V$ASM_DISK
V$ASM_DISK_IOSTAT
V$ASM_DISK_STAT
V$ASM_DISKGROUP
V$ASM_DISKGROUP_STAT
V$ASM_FILE
V$ASM_OPERATION
V$ASM_TEMPLATE
V$ASM_ACFSVOLUME
V$ASM_FILESYSTEM
Note: The V$ASM_* views exist in both ASM and database instances. The rows returned will vary.


- Following is a typical example of a query that retrieves information about disks in a particular disk group:


SQL> SELECT G.NAME DISK_GROUP, D.NAME, D.STATE, D.TOTAL_MB,
2 D.FREE_MB
3 FROM V$ASM_DISK D, V$ASM_DISKGROUP G
4 WHERE D.GROUP_NUMBER = G.GROUP_NUMBER
5 AND G.NAME = 'DATA';
DISK_GROUP NAME STATE TOTAL_MB FREE_MB
---------- ------ -------- ---------- ----------
DATA SDE5 NORMAL 977 136
DATA SDE6 NORMAL 977 134
DATA SDE7 NORMAL 977 135
DATA SDE10 NORMAL 977 150
DATA SDE8 NORMAL 977 150
DATA SDE9 NORMAL 977 150

No comments:

Post a Comment