Atikh's DBA blog
  • Home
  • Oracle
  • MySQL
  • MongoDB
  • PostgreSQL
  • Snowflake
  • About Me
  • Contact Us
Showing posts with label Oracle ASM. Show all posts
Showing posts with label Oracle ASM. Show all posts

Oracle ASM Basic Commands

 Atikh Shaikh     oracle, Oracle ASM     No comments   

Below are basic commands used in ASM for day to day activities

To start/enter into ASM command prompt
     hssrvr_prod-+ASM $ asmcmd
     ASMCMD>
To list diskgroups in ASM (asm diskgroups)
hssrvr_prod-+ASM $ asmcmd
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 307196 307129 0 307129 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 204798 204743 0 204743 0 N DATA1/
ASMCMD>
To list disks present on server
hssrvr_prod-+ASM $ /etc/init.d/oracleasm listdisks
ASMDISK01
ASMDISK02
hssrvr_prod-+ASM $
hssrvr_prod-+ASM $ asmcmd
ASMCMD> lsdsk
Path
ORCL:ASMDISK01
ORCL:ASMDISK02
ASMCMD>
 
To check Cluster Synchronization Services(CSS) status
hssrvr_prod-+ASM $ crsctl check cssd
CRS-272: This command remains for backward compatibility only
Cluster Synchronization Services is online
hssrvr_prod-+ASM $
To check High Availability Services(HAS) status
hssrvr_prod-+ASM $ crsctl check has
CRS-4638: Oracle High Availability Services is online
hssrvr_prod-+ASM $
To Stop High Availability Services
This will shutdown ASM instance, make sure databases are being shutdown before shutting down ASM instance
hssrvr_prod-+ASM $ crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘hssrvr_prod’CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ‘hssrvr_prod’CRS-2673: Attempting to stop ‘ora.evmd’ on ‘hssrvr_prod’CRS-2673: Attempting to stop ‘ora.DATA.dg’ on ‘hssrvr_prod’CRS-2673: Attempting to stop ‘ora.DATA1.dg’ on ‘hssrvr_prod’CRS-2677: Stop of ‘ora.DATA.dg’ on ‘hssrvr_prod’ succeededCRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ‘hssrvr_prod’ succeededCRS-2677: Stop of ‘ora.DATA1.dg’ on ‘hssrvr_prod’ succeededCRS-2673: Attempting to stop ‘ora.asm’ on ‘hssrvr_prod’CRS-2677: Stop of ‘ora.evmd’ on ‘hssrvr_prod’ succeededCRS-2677: Stop of ‘ora.asm’ on ‘hssrvr_prod’ oracle asmca-2673: Attempting to stop ‘ora.cssd’ on ‘hssrvr_prod’CRS-2677: Stop of ‘ora.cssd’ on ‘hssrvr_prod’ succeededCRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘hssrvr_prod’ has completedCRS-4133: Oracle High Availability Services has been stopped.hssrvr_prod-+ASM $


To start High Availability Services
hssrvr_prod-+ASM $ crsctl start has
CRS-4123: Oracle High Availability Services has been started.
hssrvr_prod-+ASM $
To Check status of resources (crsctl)
hssrvr_prod-+ASM $ crsctl stat res -t
——————————————————————————–
Name Target State Server State details
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
ONLINE ONLINE hssrvr_prod STABLE
ora.DATA1.dg
ONLINE ONLINE hssrvr_prod STABLE
ora.LISTENER.lsnr
ONLINE ONLINE hssrvr_prod STABLE
ora.asm
ONLINE ONLINE hssrvr_prod Started,STABLE
ora.ons
OFFLINE OFFLINE hssrvr_prod STABLE
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.cssd
1 ONLINE ONLINE hssrvr_prod STABLE
ora.diskmon
1 OFFLINE OFFLINE STABLE
ora.evmd
1 ONLINE ONLINE hssrvr_prod STABLE
——————————————————————————–
hssrvr_prod-+ASM $
To start databases and listener, registered with srvctl utility
srvctl start database -d <db_unique_name>
srvctl start listener -l <Listener>
To stop databases and listener, registered with srvctl utility
srvctl stop database -d <db_unique_name>
srvctl stop listener -l <LISTENER>
To check utilization of Diskgroups via sqlplus
SQL> SELECT name, free_mb, total_mb, free_mb/total_mb*100 as percentage FROM v$asm_diskgroup;
NAME FREE_MB TOTAL_MB PERCENTAGE
—————————— ———- ———- ———-
DATA 102345 102398 99.9482412
DATA1 409527 409596 99.9831541
To check disks related to Disk groups
SQL>select dgrp.name dg_name, dgrp.state dg_state, dgrp.type, dsk.disk_number dsk_no,
dsk.path, dsk.mount_status, dsk.state
from v$asm_diskgroup dgrp, v$asm_disk dsk
where dgrp.group_number=dsk.group_number
order by dg_name, dsk_no;
DG_NAME DG_STATE TYPE DSK_NO PATH MOUNT_S STATE
————— ———- —— ———- ————— ——- ——–
DATA MOUNTED EXTERN 0 ORCL:ASMDISK01 CACHED NORMAL
DATA1 MOUNTED EXTERN 1 ORCL:ASMDISK02 CACHED NORMAL
To identify databases using diskgroups managed by ASM instance
select INSTANCE_NAME,DB_NAME,STATUS,SOFTWARE_VERSION from v$asm_client;
INSTANCE_NAME DB_NAME STATUS SOFTWARE_VERSION
——————– ——————– ——————– ————————————————————
TEST1 TEST1 CONNECTED 11.2.0.4.0
+ASM +ASM CONNECTED 12.1.0.2.0
STAGE1 STAGE1 CONNECTED 12.1.0.2.0
To take backup of ASM Diskgroups
md_backup is command to take backup of current diskgroups, it will take backup under /tmp/backup_asm.bck as shown in below example, we can provide any location with -b option
hssrvr_prod-+ASM $ asmcmd
ASMCMD> md_backup -b /tmp/backup_asm.bck
WARNING:option ‘b’ is deprecated for ‘md_backup’
Disk group metadata to be backed up: DATA
Disk group metadata to be backed up: DATA1
Current alias directory path: ASM/PASSWORD
Current alias directory path: ASM
Current alias directory path: ASM/ASMPARAMETERFILE
ASMCMD>
 To restore ASM Diskgroups
    md_restore -b /tmp/backup_asm.bck
Few Other commands
cp – to copy files from one diskgroup to other
rm – to remove files or directories
mkdir – to create directory
pwd – to check current location
cd – to navigate through directories
help – to get syntax and description of asm commands


Comment below if addition information is required
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Instagram
  •  Pin
  •  linkedin
  •  reddit
Older Posts Home

Author

Atikh Shaikh
View my complete profile

Categories

  • MongoDB (18)
  • Oracle 12c (30)
  • Oracle12cR2 New Feature (3)
  • PostgreSQL (20)
  • RMAN (10)
  • Snowflake (8)
  • mysql (23)
  • oracle (73)

Blog Archive

  • ►  2018 (38)
    • ►  November (25)
    • ►  December (13)
  • ►  2019 (33)
    • ►  January (15)
    • ►  February (6)
    • ►  March (2)
    • ►  April (5)
    • ►  May (5)
  • ►  2020 (5)
    • ►  April (1)
    • ►  May (2)
    • ►  July (2)
  • ►  2021 (8)
    • ►  June (3)
    • ►  July (3)
    • ►  August (1)
    • ►  December (1)
  • ►  2022 (33)
    • ►  May (3)
    • ►  June (10)
    • ►  July (3)
    • ►  August (4)
    • ►  September (8)
    • ►  October (3)
    • ►  November (2)
  • ►  2023 (14)
    • ►  February (1)
    • ►  April (5)
    • ►  May (2)
    • ►  June (1)
    • ►  September (1)
    • ►  October (1)
    • ►  December (3)
  • ►  2024 (5)
    • ►  January (2)
    • ►  March (3)
  • ▼  2025 (5)
    • ►  March (1)
    • ►  April (3)
    • ▼  May (1)
      • Oracle 23ai : The all new Hybrid Read-Only for plu...

Popular Posts

  • ORA-29283: invalid file operation: unexpected "LFI" error (1509)[29437]
    I was trying to export the schema in my windows PC, it got stuck with below error    C:\Users\shaik\Videos\technodba exp>expdp userid...
  • Oracle Dataguard Broker Configuration (DGMGRL)
    Data Guard Broker is a command-line interface that makes managing primary and standby databases easy. DBA can use a single command to switch...
  • ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
    In previous articles, we have learned about user creation and grants  in MySQL in detail, but there are a few privileges called global priv...
  • PostgreSQL : How to get data directory location for PostgreSQL instance
    Sometimes, you start working on a PostgreSQL instance but forget about the data directory, here we will discuss different methods to know th...
  • Oracle 23ai : The all new Hybrid Read-Only for pluggable databases (PDBs)
      The latest Oracle database version, Oracle 23ai, introduced a new open mode called Hybrid Read-Only for pluggable databases (PDBs). Local ...

Labels

oracle Oracle 12c mysql PostgreSQL MongoDB oracle 19c Oracle23c oracle19c Orale PDB-CDB oracle12c python AWS Oracle ASM Virtualbox pluggable database storage engine

Pages

  • Disclaimer
  • Privacy Policy

Follow TechnoDBA

Copyright © Atikh's DBA blog | Powered by Blogger