Monday, September 15, 2014

Oracle ASM :How to Manage DiskGroup in ASM

How to Manage DiskGroup in ASM


How to Add/Remove/Manage ASM Configuration

1.       Use the following syntax to add configuration information about an existing ASM instance:
srvctl add asm -n node_name -i +asm_instance_name -o oracle_home

2.       Use the following syntax to remove an ASM instance:
srvctl remove asm -n node_name [-i +asm_instance_name]

3.       Use the following syntax to enable an ASM instance:
srvctl enable asm -n node_name [-i ] +asm_instance_name

4.       Use the following syntax to disable an ASM instance:
srvctl disable asm -n node_name [-i +asm_instance_name]

5.       Use the following syntax to start an ASM instance:
srvctl start asm -n node_name [-i +asm_instance_name] [-o start_options]

6.       Use the following syntax to stop an ASM instance:
srvctl stop asm -n node_name [-i +asm_instance_name] [-o stop_options]

7.       Use the following syntax to show the configuration of an ASM instance:
srvctl config asm -n node_name

8.       Use the following syntax to obtain the status of an ASM instance:
srvctl status asm -n node_name

Note: For all of the SRVCTL commands in this section for which the option is not required, if you do not specify an instance name, then –i the command applies to all of the ASM instances on the node.


Some Useful Queries

Note: While adding or dropping disks will initiate a rebalance of the data on the disks. The status of these processes can be shown by selecting from v$asm_operation.

1.       Quering ASM Disk Groups
col name format a25
col DATABASE_COMPATIBILITY format a10
col COMPATIBILITY format a10
select * from v$asm_diskgroup;
Or

select name, state, type, total_mb, free_mb from v$asm_diskgroup;

2.       Querying ASM Disks
col PATH format a55
col name format a25
select name, path, group_number, TOTAL_MB, FREE_MB, READS, WRITES, READ_TIME,
WRITE_TIME from v$asm_disk order by 3,1;

Or

col PATH format a50
col HEADER_STATUS  format a12
col name format a25
--select INCARNATION,
select name, path, MOUNT_STATUS,HEADER_STATUS, MODE_STATUS, STATE, group_number,
OS_MB, TOTAL_MB, FREE_MB, READS, WRITES, READ_TIME, WRITE_TIME, BYTES_READ,
BYTES_WRITTEN, REPAIR_TIMER, MOUNT_DATE, CREATE_DATE from v$asm_disk;


No comments:

Post a Comment