ASM Configuration Assistant ASMCA commands in Oracle
Check version of ASMCMD
-- Check ASM version
$asmcmd -V
asmcmd version 18.0.0.0.0
-- Check patch version
ASMCMD [+] > showversion --active
Oracle ASM active version on the cluster is [18.0.0.0.0]. The cluster upgrade state
is [NORMAL]. The cluster active patch level is [0].
--Check the attribute of data diskgroup
ASMCMD [+] > lsattr -lm -G data
-l display name with value
-m add additiona value
General ASMCMD commands
--List the directory
ASMCMD> ls
data/
fra/
--Make the directory
ASMCMD> mkdir +data/orcl/mydir
--Change directory
ASMCMD [+] > cd data/orcl
ASMCMD [+data/orcl] >
--Lists mounted disk groups and their information
ASMCMD [+] > lsdg data
-- List oracle ASM disk
ASMCMD [+] > lsdsk -t -G data
Configure and Manage the ASM instance with ASMCA
-- Create the ASM instance
asmca -silent
-configureASM
-diskString '/devices/disk*'
–sysAsmPassword my_sysasm_password
-asmsnmpPassword my_asmsnmp_passwd
-- configure the parameter of ASM instance
asmca -silent
-configureParameter
–param
asm_power_limit=3
–sysAsmPassword my_sysasm_password
--Delete the ASM instance
asmca -silent
-deleteASM
–sysAsmPassword my_sysasm_password
-force
List the operation going on disk
displays information from the V$ASM_OPERATION view
ASMCMD [+] > lsop
Group_Name Dsk_Num State Power
DATA REBAL WAIT 2
Manage the Diskgroup and disk with ASMCA
-- Create the diskgroup
asmca -silent -createDiskGroup
-diskGroupName mynewdg
-disk '/devices/diske*'
-disk '/devices/diskk*'
-redundancy NORMAL
-au_size 64
-compatible.asm '18.0.0.0.0'
-compatible.rdbms '18.0.0.0.0'
-compatible.advm '18.0.0.0.0
-- Add disk to diskGroup
asmca -silent
-addDisk
-diskGroupName mynewdg
-disk '/devices/diskl1'
-disk '/devices/diskl2'
-- Edit the diskgroup attribute
asmca -silent
-editDiskGroupAttributes
(-diskGroupName disk_group)
(-attribute value)
--Check ASM Disk Attribute
ASMCMD +> lsattr
--Set the ASM Attribute
ASMCMD +>setattr
-- Create the diskgroup
Creates a disk group based on an XML configuration file.
ASMCMD +> MKDG
--Drop the diskGroup
ASMCMD [+] > dropdg -r -f dat
-f force option
-r recursive like linux
-- For altering the disk group
ASMCMD +> chdg
--Rename the disk-group
renamedg dgname=fra1 newdgname=fra2 asm_diskstring='/devices/disk*' verbose=true
Handle file group or Quota group
ASMCA also supports commands to manage and track file and quota groups. These commands include:
-- create the filegroup
asmca -silent
-createFileGroups
(-diskGroupName disk_group)
(-fileGroupNames file_group_name_list)
(-fileGroupUsages file_group_usages_list)
(-fileGroupUsageIDs file_group_usagesID_list)
--Drop fileGroup
asmca -silent
-dropFileGroups
(-diskGroupName disk_group)
(-fileGroupNames file_group_name_list)
--Create quota
asmca -silent
-createQuotaGroups
(-diskGroupName disk_group)
(-quotaGroupNames quota_group_name_list)
(-quotaGroupSizes quota_group_size_list)
--Drop quota
asmca -silent
-dropQuotaGroups
(-diskGroupName disk_group)
(-quotaGroupNames quota_group_names_list)
--modify a file group or quota group
chfg and chqg
--list file groups or quota groups
lsfg and lsqg
--create a file group or quota group
mkfg and mkqg
-- Delete a file group or quota group
rmfg and rmqg
--to move a file group
mvfg
Managing the ADVM Volume
-- Create volume in DATA diskgroup
ASMCMD [+] > volcreate -G data -s 10G --width 1M --column 8 volume1
-- Check the list of volume
ASMCMD [+] > volinfo -G data volume1
-- List all volume in specific disk -a option
ASMCMD [+] > volinfo -G data -a
-- Delete the Volume
ASMCMD [+] > voldelete -G diskgroup volume
-- Disable the volume
ASMCMD [+] > voldisable -G diskgroup volume
-- Enable the volume
ASMCMD [+] > volenable -G diskgroup volume
--Resize operation on volume
ASMCMD [+] > volresize -G data -s 20G volume1