Create ASM Disk Group
Step1:
Set ASM Environment and Login to your ASM instance as sysasm
[oracle@node2 ~]$ export ORACLE_HOME=/u01/app/12.2.0.2/grid
[oracle@node2 ~]$ export PATH=$PATH:$ORACLE_HOME/bin
[oracle@node2 ~]$ export ORACLE_SID=+ASM2
[oracle@node2 ~]$ sqlplus "/as sysasm"
[oracle@node2 ~]$ export PATH=$PATH:$ORACLE_HOME/bin
[oracle@node2 ~]$ export ORACLE_SID=+ASM2
[oracle@node2 ~]$ sqlplus "/as sysasm"
Step2:
Identify the availiable Candidate/Provisioned disks
set line 200
col path for a50
select MOUNT_STATUS,HEADER_STATUS,STATE,PATH from v$asm_disk
col path for a50
select MOUNT_STATUS,HEADER_STATUS,STATE,PATH from v$asm_disk
MOUNT_S HEADER_STATU STATE PATH
------- ------------ -------- ------------------------------------------------------------
CLOSED PROVISIONED NORMAL /dev/oracleasm/disks/DISK5
CLOSED PROVISIONED NORMAL /dev/oracleasm/disks/DISK6
CLOSED PROVISIONED NORMAL /dev/oracleasm/disks/DISK8
CLOSED PROVISIONED NORMAL /dev/oracleasm/disks/DISK7CACHED MEMBER NORMAL /dev/oracleasm/disks/DISK4
CACHED MEMBER NORMAL /dev/oracleasm/disks/DISK3
CACHED MEMBER NORMAL /dev/oracleasm/disks/DISK2
CACHED MEMBER NORMAL /dev/oracleasm/disks/DISK1
------- ------------ -------- ------------------------------------------------------------
CLOSED PROVISIONED NORMAL /dev/oracleasm/disks/DISK5
CLOSED PROVISIONED NORMAL /dev/oracleasm/disks/DISK6
CLOSED PROVISIONED NORMAL /dev/oracleasm/disks/DISK8
CLOSED PROVISIONED NORMAL /dev/oracleasm/disks/DISK7CACHED MEMBER NORMAL /dev/oracleasm/disks/DISK4
CACHED MEMBER NORMAL /dev/oracleasm/disks/DISK3
CACHED MEMBER NORMAL /dev/oracleasm/disks/DISK2
CACHED MEMBER NORMAL /dev/oracleasm/disks/DISK1
8 rows selected.
Step3:
create diskgroup DATA normal redundancy FAILGROUP FG1 disk '/dev/oracleasm/disks/DISK5' FAILGROUP FG2 disk '/dev/oracleasm/disks/DISK6';
Diskgroup created.
Note:- if you are creating diskgroup on RAC ensure the diskgroup is mounted on 2nd node. If it is not mounted you must mount it.
select INST_ID,NAME,STATE from gv$asm_diskgroup;
INST_ID NAME STATE
---------- ------------------------------ -----------
1 DATA_MGMT MOUNTED
1 OCR_VOT MOUNTED
1 DATA MOUNTED
2 DATA DISMOUNTED
2 DATA_MGMT MOUNTED
2 OCR_VOT MOUNTED
---------- ------------------------------ -----------
1 DATA_MGMT MOUNTED
1 OCR_VOT MOUNTED
1 DATA MOUNTED
2 DATA DISMOUNTED
2 DATA_MGMT MOUNTED
2 OCR_VOT MOUNTED
6 rows selected.
SQL> alter diskgroup DATA mount;
Diskgroup altered.
SQL> select INST_ID,NAME,STATE from gv$asm_diskgroup;
INST_ID NAME STATE
---------- ------------------------------ -----------
1 DATA_MGMT MOUNTED
1 OCR_VOT MOUNTED
1 DATA MOUNTED
2 DATA_MGMT MOUNTED
2 OCR_VOT MOUNTED
2 DATA MOUNTED
6 rows selected.
How to Change the Compatible Attribute of ASM Diskgroup
ALTER DISKGROUP DATA SET ATTRIBUTE 'compatible.asm' = '12.1';
Diskgroup altered.
ALTER DISKGROUP DATA SET ATTRIBUTE 'compatible.rdbms' = '12.1';
Diskgroup altered.
Awesome Post.
ReplyDeleteYou share valuable information here.
Thanks for Sharing With us.