ASM TOOLS and Configuration Basic Commands.

1. check the asm process running:

[oracle@asm ~]$ ps -ef|grep smon
oracle 8648 23558 0 16:52 pts/0 00:00:00 grep –color=auto smon
oracle 9349 1 0 09:50 ? 00:00:00 ora_smon_oraasm
oracle 30582 1 0 Jan01 ? 00:00:02 asm_smon_+ASM
[oracle@asm ~]$ ps -ef|grep d.bin
oracle 10968 23558 0 16:54 pts/0 00:00:00 grep –color=auto d.bin
oracle 26445 1 0 Jan01 ? 00:09:46 /u01/app/grid/bin/ohasd.bin reboot
oracle 26662 1 0 Jan01 ? 00:12:17 /u01/app/grid/bin/oraagent.bin
oracle 26733 1 0 Jan01 ? 00:04:50 /u01/app/grid/bin/evmd.bin
oracle 26796 26733 0 Jan01 ? 00:04:47 /u01/app/grid/bin/evmlogger.bin -o /u01/app/grid/log/[HOSTNAME]/evmd/evmlogger.info -l /u01/app/grid/log/[HOSTNAME]/evmd/evmlogger.log
oracle 27085 1 0 Jan01 ? 00:00:02 /u01/app/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit
oracle 30264 1 0 Jan01 ? 00:05:25 /u01/app/grid/bin/cssdagent
oracle 30302 1 0 Jan01 ? 00:05:13 /u01/app/grid/bin/ocssd.bin
[oracle@asm ~]$ hostname
asm.localdomain
[oracle@asm ~]$ uname -r
3.10.0-957.el7.x86_64

2. check cluster resource status:

[oracle@asm ~]$ export PATH=$GRID_HOME/bin:$PATH
[oracle@asm ~]$ crsctl stat res -t
——————————————————————————–
Name Target State Server State details
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
ONLINE ONLINE asm STABLE
ora.LISTENER.lsnr
ONLINE ONLINE asm STABLE
ora.asm
ONLINE ONLINE asm Started,STABLE
ora.ons
OFFLINE OFFLINE asm STABLE
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.cssd
1 ONLINE ONLINE asm STABLE
ora.diskmon
1 OFFLINE OFFLINE STABLE
ora.evmd
1 ONLINE ONLINE asm STABLE
ora.oraasm.db
1 ONLINE ONLINE asm Open,HOME=/u01/app/o
racle/product/19.0.0
/dbhome_1,STABLE
——————————————————————————–

3. check database running status and start stop database:

[oracle@asm ~]$ srvctl status database -d oraasm
Database is running.
[oracle@asm ~]$

srvctl stop database -d oraasm
srvctl start database -d oraasm

4. check oracle home in grid:

[oracle@asm ~]$ . grid.env
[oracle@asm ~]$ env |grep ORA
ORACLE_SID=+ASM
ORACLE_BASE=/u01/app/oracle
ORACLE_HOSTNAME=asm.localdomain
ORACLE_TERM=xterm
ORACLE_HOME=/u01/app/grid
[oracle@asm ~]$

5. check oracle home in database:

[oracle@asm ~]$ . db.env
[oracle@asm ~]$ env |grep ORA
ORACLE_SID=oraasm
ORACLE_BASE=/u01/app/oracle
ORACLE_HOSTNAME=asm.localdomain
ORACLE_TERM=xterm
ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1
[oracle@asm ~]$

6. List the disks:

[root@asm ~]# cd /dev/
[root@asm dev]# ll sd*
brw-rw—-. 1 root disk 8, 0 Dec 31 10:45 sda
brw-rw—-. 1 root disk 8, 1 Dec 31 10:45 sda1
brw-rw—-. 1 root disk 8, 2 Dec 31 10:45 sda2
brw-rw—-. 1 root disk 8, 3 Dec 31 10:45 sda3
brw-rw—-. 1 root disk 8, 4 Dec 31 10:45 sda4
brw-rw—-. 1 root disk 8, 5 Dec 31 10:45 sda5
brw-rw—-. 1 root disk 8, 16 Dec 31 11:57 sdb
brw-rw—-. 1 root disk 8, 17 Dec 31 12:00 sdb1
brw-rw—-. 1 root disk 8, 32 Dec 31 11:58 sdc
brw-rw—-. 1 root disk 8, 33 Dec 31 12:00 sdc1

ASM TOOLS:
INSTALLATION TOOLS -oracleasm
ADMINSTRATION – asmcmd
DEBUGGING – kfod kfed ocrcheck

7. scan and list the disk using oracleasm:
[root@asm dev]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks…
Scanning system for ASM disks…
[root@asm dev]# oracleasm listdisks
DISK1
DISK2
[root@asm dev]#

8. asmcmd tool:

[oracle@asm ~]$ asmcmd
ASMCMD>
ASMCMD>

I. list the disk group
ASMCMD> lsdg
State Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 512 4096 4194304 30712 25860 0 25860 0 N DATA/
ASMCMD>

II. list datafile,controlfile

ASMCMD> cd DATA/
ASMCMD> ls
ASM/
ORAASM/
orapwasm
ASMCMD> cd ORAASM
ASMCMD> ls
86B637B62FE07A65E053F706E80A27CA/
CONTROLFILE/
D47CB418C2B91B66E053867EA8C0C5A0/
D47CEAB72C2F2513E053867EA8C0538D/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
ASMCMD> cd DATAFILE
ASMCMD> ls
SYSAUX.258.1092813853
SYSTEM.257.1092813819
UNDOTBS1.259.1092813869
USERS.260.1092813869
ASMCMD> pwd
+DATA/ORAASM/DATAFILE
ASMCMD>

9. check css,has status:

[oracle@asm ~]$ crsctl check has
CRS-4638: Oracle High Availability Services is online
[oracle@asm ~]$ crsctl check css
CRS-4529: Cluster Synchronization Services is online
[oracle@asm ~]$

10. check has version:

[oracle@asm ~]$ crsctl query has releaseversion
Oracle High Availability Services release version on the local node is [19.0.0.0.0]
[oracle@asm ~]$ crsctl query has softwareversion
Oracle High Availability Services version on the local node is [19.0.0.0.0]
[oracle@asm ~]$

11. asmca —> GUI for create and manage diskgroup:

12. KFOD – discovering disks with the help of asm disk strings:
KFED – discovering disk headers

[oracle@asm ~]$ cd $ORACLE_HOME/bin
[oracle@asm bin]$ pwd
/u01/app/grid/bin
[oracle@asm bin]$ ll kfod
-rwxrwxr-x. 1 oracle oinstall 11453 Dec 31 12:22 kfod
[oracle@asm bin]$ ll kfed
-rwxrwxr-x. 1 oracle oinstall 142432 Dec 31 12:20 kfed

[oracle@asm bin]$ kfod status=TRUE disks=ALL
——————————————————————————–
Disk Size Header Path User Group
================================================================================
1: 20479 MB MEMBER /dev/oracleasm/disks/DISK1 oracle oinstall
2: 10239 MB MEMBER /dev/oracleasm/disks/DISK2 oracle oinstall
——————————————————————————–
ORACLE_SID ORACLE_HOME
================================================================================
+ASM /u01/app/grid
[oracle@asm bin]$

[oracle@asm bin]$ kfed read /dev/oracleasm/disks/DISK1 | egrep ‘name|size|type’
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfdhdb.dskname: DATA_0000 ; 0x028: length=9
kfdhdb.grpname: DATA ; 0x048: length=4
kfdhdb.fgname: DATA_0000 ; 0x068: length=9
kfdhdb.secsize: 512 ; 0x0b8: 0x0200
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000
kfdhdb.ausize: 4194304 ; 0x0bc: 0x00400000
kfdhdb.dsksize: 5119 ; 0x0c4: 0x000013ff
[oracle@asm bin]$

13. check olr and ocr location :
[oracle@asm ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 4
Total space (kbytes) : 491684
Used space (kbytes) : 82368
Available space (kbytes) : 409316
ID : 786336035
Device/File Name : /u01/app/grid/cdata/localhost/local.ocr
Device/File integrity check succeeded

Device/File not configured

Device/File not configured

Device/File not configured

Device/File not configured

Cluster registry integrity check succeeded

Logical corruption check bypassed due to non-privileged user

[oracle@asm ~]$
[oracle@asm ~]$ ocrcheck -local
Status of Oracle Local Registry is as follows :
Version : 4
Total space (kbytes) : 491684
Used space (kbytes) : 83496
Available space (kbytes) : 408188
ID : 476403298
Device/File Name : /u01/app/oracle/crsdata/asm/olr/asm_19.olr
Device/File integrity check succeeded

Local registry integrity check succeeded

Logical corruption check bypassed due to non-privileged user

[oracle@asm ~]$ ocrcheck -local -config
Oracle Local Registry configuration is :
Device/File Name : /u01/app/oracle/crsdata/asm/olr/asm_19.olr
[oracle@asm ~]$

14. Check the asm status in sysasm admin:

[oracle@asm ~]$ sqlplus / as sysasm

SQL*Plus: Release 19.0.0.0.0 – Production on Sun Jan 2 17:57:52 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
Version 19.3.0.0.0

15. check instance type:

SQL> show parameter INSTANCE_TYPE

NAME TYPE VALUE
———————————— ———– ——————————
instance_type string ASM

16. spfile location:

SQL> show parameter spfile

NAME TYPE VALUE
———————————— ———– ——————————
spfile string +DATA/ASM/ASMPARAMETERFILE/reg
istry.253.1092745689

17. pfile creation:
SQL> create pfile from spfile;

File created.

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
Version 19.3.0.0.0
[oracle@asm ~]$ cd $ORACLE_HOME/dbs
[oracle@asm dbs]$ ls
ab_+ASM.dat hc_+ASM.dat init+ASM.ora init.ora
[oracle@asm dbs]$ cat init+ASM.ora
+ASM.__oracle_base=’/u01/app/oracle’#ORACLE_BASE set from in memory value
.asm_diskstring=’/dev/oracleasm/disks’
.asm_power_limit=1
.large_pool_size=12M
.remote_login_passwordfile=’EXCLUSIVE’
[oracle@asm dbs]$ sqlplus / as sysasm

SQL*Plus: Release 19.0.0.0.0 – Production on Sun Jan 2 18:01:05 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
Version 19.3.0.0.0

18. instance type and status:

SQL> select instance_name,status from v$instance;

INSTANCE_NAME STATUS
—————- ————
+ASM STARTED

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
Version 19.3.0.0.0
[oracle@asm dbs]$ crsctl stat res -t
——————————————————————————–
Name Target State Server State details
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
ONLINE ONLINE asm STABLE
ora.LISTENER.lsnr
ONLINE ONLINE asm STABLE
ora.asm
ONLINE ONLINE asm Started,STABLE
ora.ons
OFFLINE OFFLINE asm STABLE
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.cssd
1 ONLINE ONLINE asm STABLE
ora.diskmon
1 OFFLINE OFFLINE STABLE
ora.evmd
1 ONLINE ONLINE asm STABLE
ora.oraasm.db
1 ONLINE ONLINE asm Open,HOME=/u01/app/o
racle/product/19.0.0
/dbhome_1,STABLE
——————————————————————————–
[oracle@asm dbs]$

19. ASMCMD check datafile and controlfile:

[oracle@asm dbs]$ asmcmd
ASMCMD>
ASMCMD>
ASMCMD>
ASMCMD> lsdg
State Type Rebal Sector Logical_Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 512 4096 4194304 30712 25852 0 25852 0 N DATA/
ASMCMD> cd +DATA/oraasm/datafile
ASMCMD> ls
SYSAUX.258.1092813853
SYSTEM.257.1092813819
UNDOTBS1.259.1092813869
USERS.260.1092813869
ASMCMD> ls -l
Type Redund Striped Time Sys Name
DATAFILE UNPROT COARSE JAN 02 17:00:00 Y SYSAUX.258.1092813853
DATAFILE UNPROT COARSE JAN 02 17:00:00 Y SYSTEM.257.1092813819
DATAFILE UNPROT COARSE JAN 02 17:00:00 Y UNDOTBS1.259.1092813869
DATAFILE UNPROT COARSE JAN 02 17:00:00 Y USERS.260.1092813869
ASMCMD>

ASMCMD> cd +DATA/oraasm/parameterfile

ASMCMD> ls -l
Type Redund Striped Time Sys Name
PARAMETERFILE UNPROT COARSE JAN 02 17:00:00 Y spfile.274.1092815069
ASMCMD>

ASMCMD> ls -l
Type Redund Striped Time Sys Name
ASMPARAMETERFILE UNPROT COARSE DEC 31 12:00:00 Y REGISTRY.253.1092745689
ASMCMD> pwd
+DATA/ASM/ASMPARAMETERFILE
ASMCMD>

20. query to check asm_disk and asm disk_group:

SQL> select disk_number,name,path,header_status,mode_status,state,total_mb,free_mb from v$asm_disk;

DISK_NUMBER NAME PATH HEADER_STATU MODE_ST STATE TOTAL_MB FREE_MB
—————————————————————————————————-
0 DATA_0000 /dev/oracleasm/disks/DISK1 MEMBER ONLINE NORMAL 20476 17228

1 DATA_0001 /dev/oracleasm/disks/DISK2 MEMBER ONLINE NORMAL 10236 8624

 

SQL> select group_number,name,state,type from v$asm_diskgroup;

GROUP_NUMBER NAME STATE TYPE
———— —————————— ———– ——
1 DATA MOUNTED EXTERN

SQL>

 

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8