Sunday, August 16, 2020

Oracle ASMCMD commands

 

Oracle ASMCMD commands


Introduction


Oracle ASMCMD commands used in linux in command line utility


$export ORACLE_SID=+ASM

$cd $ORACLE_HOME/bin

$asmcmd

ASMCMD>exit


The asmcmd utility "-p" option used in it will display the current path 


$asmcmd -p

ASMCMD[+]>cd FLASH

ASMCMD[+FLASH]>



cd command is used to changes to a specific directory


ASMCMD [+diskgroup2/crm] >cd+diskgroup1/hrms

ASMCMD[+diskgroup1/hrms]> cd DATAFILE

ASMCMD[+diskgroup1/hrms/DATAFILE]>cd..

ASMCMD[+]>cd +diskgroup1/sample/C*



pwd command is used for absolute path for current directory


ASMCMD>pwd


help command is used to display all the lists of the ASMCMD commands and general information on ASCMD utility


ASMCMD>help

ASMCMD>help lsct

ASMCMD>?

ASMCMD> ? mkgrp


du command is used to display the total space in the files and directories 


ASMCMD[+diskgroup1/prod]>du

Used_MB   Mirror_Used_MB

1300                3200



Find Command is used to display the absolute path of all occurances of the specified name pattern  wild cards can also be used in specified directories and its subdirectories


ASMCMD>find +diskgroup1 undo *

+diskgroup1/crm/DATAFILE/UNDOTBS1.347.4444421853

+diskgroup1/crm/DATAFILE/UNDOTBS1.361.4461812843


ASMCMD>find -t CONTROLFILE +diskgroup_data/hrms *

+diskgroup_data/hrms/CONTROLFILE/Current.150.44421274

+diskgroup_data/hrms/CONTROLFILE/Current.151.44421764


ASMCMD[+]>find--type CONTROLFILE +data/devdb *

+data/devdb/CONTROLFILE/Current.150.582466152



ls commands is used to display the list of contents of an ASM directory


ASMCMD[+diskgroup1/sample/DATAFILE]>ls

SYSAUX .346.666621122

SYSTEM.345.666621122

UNDOTBS1.347.66621123

UNDOTBS1.365.666211239

USERS.369.66621123

EXAMPLE.349.66662


how many databases are using an ASM instance 


ASMCMD[+DG1_FRA]>lsct

DB_NAME Status Software_version Compatible_version  instance_Name

DEV CONNECTED  10.2.0.1.0         10.2.0.1.0                                      DEV

TEST CONNECTED 10.2.0.1.0          10.2.0.1.0                                      TEST



mkdir is used to create the ASM directories under current Directory


ASMCMD[+diskgroup1]> mkdir subd1 subd2



rm command used to delete the specified ASM files and directories


ASMCMD[+diskgroup1/sample/DATAFILE]>rm alias382.f

ASMCMD>rm -rf +dg/orcl/DATAFILE

ASMCMD>rm -rf fradg/*


chown command is used changes the owner of a file or list of files


ASMCMD[+fra/orcl/archivelog/flashback]>chown asmdba1:asm_fra log_8.153.576541269

ASMCMD>chown oracle1:asm_users+data/hrms/controlfile/current.164.543781436


mount command will used to mount the specific diskgroups one or more diskgroups


ASMCMD[+]> mount -f data

ASMCMD[+]> mount --restrict data

ASMCMD[+]>mount -a


unmount command will be used dismount the specified diskgroup


dismounted all the diskgroups mounted in the oracle ASM instance

ASMCMD[+] unmount -a


force the dismount of the data in diskgroup

ASMCMD[+] unmount -f data


SQL equivalent for unmount command as

sql>ALTER DISKGROUP  diskgroup_name DISMOUNT;



ASMCMD> lsdg

ASMCMD>lsdg -g

ASMCMD>lsct

ASMCMD>lsattr -G DATA

ASMCMD>lsattr -G DATA -1

exit

sqlplus /as sysasm

sql> alter diskgroup



Note: Info on OracleASMCMD commands it may differ from your environment like production,testing,dev,and naming conventions directories


THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME 


 





ITIL Process

ITIL Process Introduction In this Blog i am going to explain  ITIL Process, ITIL stands for Information Technology Infrastructure Library ...