ASM simplifies the administration of oracle related files in disk groups which provides secure storage with striping and mirroring capabilities. All disks in an ASM disk group should be of same size and have similar performance characteristics. As per ASM best practices, two disk groups are recommended.
DATADG - spfile, control file, redo log member and datafiles.
FRADG - control file, redo log member, archived logs, flashback logs, RMAN backups and Data Pump dump file sets.
When the Storage Administrator presents the LUNs to OS as disk devices, the DBA can create the ASM disk groups.
Connect to ASM instance.
$ sqlplus / as sysasm
SQL> set pages 200 lines 150
SQL> col path form a50
SQL> SELECT name, path, header_status, os_mb FROM v$asm_disk;
NAME PATH HEADER_STATUS OS_MB
----------- ---------------------------- --------------------------- ------------
/dev/rdsk/emcpower1a CANDIDATE 17399
/dev/rdsk/emcpower2a CANDIDATE 17399
/dev/rdsk/emcpower3a CANDIDATE 17399
/dev/rdsk/emcpower4a CANDIDATE 17399
/dev/rdsk/emcpower5a FORMER 34807
/dev/rdsk/emcpower6a CANDIDATE 34807
SQL> CREATE DISKGROUP datadg EXTERNAL REDUNDANCY
DISK '/dev/rdsk/emcpower1a', '/dev/rdsk/emcpower2a', '/dev/rdsk/emcpower3a';
SQL> SELECT name, path, header_status, os_mb FROM v$asm_disk;
NAME PATH HEADER_STATUS OS_MB
---------------------- ---------------------------- --------------------------- ----------------
DATADG_0000 /dev/rdsk/emcpower1a MEMBER 17399
DATADG_0001 /dev/rdsk/emcpower2a MEMBER 17399
DATADG_0002 /dev/rdsk/emcpower3a MEMBER 17399
/dev/rdsk/emcpower4a CANDIDATE 17399
/dev/rdsk/emcpower5a FORMER 34807
/dev/rdsk/emcpower6a CANDIDATE 34807
Add same size candidate disk to the disk group.
SQL> ALTER DISKGROUP datadg ADD DISK '/dev/rdsk/emcpower4a';
To drop the disk from disk group.
SQL> ALTER DISKGROUP datadg DROP DISK DATADG_0003;
SQL> SELECT operation, state, power, est_minutes FROM v$asm_operation;
OPERATION STATE POWER EST_MINUTES
------------------ ---------- ----------- ---------------------
REBAL DROP 1 23
Watch the state of DATADG_0003 device as DROPPING and free_mb is changing with the time.
SQL> SELECT name, path, total_mb, free_mb, state FROM v$asm_disk;
Alternatively at command prompt.
$ asmcmd lsdg
ASM instance startup mounts the disk groups and shutdown unmounts those.
To manually mount and unmount the disk group(s).
SQL> ALTER DISKGROUP DATADG mount;
SQL> ALTER DISKGROUP DATADG dismount;
SQL> ALTER DISKGROUP ALL mount;
SQL> ALTER DISKGROUP ALL dismount;
To view disk group compatibility.
SQL> SELECT name, compatibility, database_compatibility FROM v$asm_diskgroup;
No comments:
Post a Comment