Monday, February 6, 2012

Reference summary of asmcmd commands

asmcmd is a various nice feature of ASM.It helps us understand and do things from command line itself.I find this utility very useful.Thanks to Oracle again for making things easy.

Reference summary of asmcmd commands:

cd Changes the current directory to the specified directory.

du Displays the total disk space occupied by ASM files in the
specified ASM directory and all its subdirectories, recursively.

exit Exits ASMCMD.

find Lists the paths of all occurrences of the specified name (with
wildcards) under the specified directory.

help Displays the syntax and description of ASMCMD commands.

ls Lists the contents of an ASM directory, the attributes of the
specified file, or the names and attributes of all disk groups.

lsct Lists information about current ASM clients.

lsdg Lists all disk groups and their attributes.

mkalias Creates an alias for a system-generated filename.

mkdir Creates ASM directory.

pwd Displays the path of the current ASM directory.

rm Deletes the specified ASM files or directories.

rmalias Deletes the specified alias, retaining the file that the alias points to.

asm.sh, a Linux shell script, that demonstrates some of the asmcmd functionality.

lsct :list all connected Oracle instances

ASMCMD> lsct
DB_Name Status Software_Version Compatible_version Instance_Name Disk_Group
+ASM CONNECTED 11.2.0.1.0 11.2.0.1.0 +ASM1 GRID_DATA_01
+ASM CONNECTED 11.2.0.1.0 11.2.0.1.0 +ASM1 TESTDB_DATA_01
TESTDB CONNECTED 11.2.0.1.0 11.2.0.0.0 TESTDB1 TESTDB_FRA_01
TESTDB CONNECTED 11.2.0.1.0 11.2.0.0.0 TESTDB1 TESTDB_DATA_01
ICMQB CONNECTED 11.2.0.1.0 11.2.0.0.0 ICMQB1 TESTDB_FRA_01
ICMQB CONNECTED 11.2.0.1.0 11.2.0.0.0 ICMQB1 TESTDB_REDO_01
ICMQB CONNECTED 11.2.0.1.0 11.2.0.0.0 ICMQB1 TESTDB_REDO_02

lsdg:List Diskgroup status and type.

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 NORMAL N 512 4096 1048576 5934 5002 173 2414 0 N GRID_DATA_01/
MOUNTED EXTERN N 512 4096 1048576 2161538 112220 0 112220 0 N TESTDB_DATA_01/
MOUNTED EXTERN N 512 4096 1048576 654684 560350 0 560350 0 N TESTDB_FRA_01/
MOUNTED EXTERN N 512 4096 1048576 32652 11922 0 11922 0 N TESTDB_REDO_01/
MOUNTED EXTERN N 512 4096 1048576 32652 11954 0 11954 0 N TESTDB_REDO_02/


ASMCMD> iostat
Group_Name Dsk_Name Reads Writes
GRID_DATA_01 GRID_DATA_01_0000 3121340416 0
GRID_DATA_01 GRID_DATA_01_0001 3616768 0
GRID_DATA_01 GRID_DATA_01_0002 4354048 4096
GRID_DATA_01 GRID_DATA_01_0003 2061918208 4096
GRID_DATA_01 GRID_DATA_01_0004 3616768 0
GRID_DATA_01 GRID_DATA_01_0005 3731456 4096
TESTDB_DATA_01 TESTDB_DATA_01_0000 1868196700160 205746507776
TESTDB_DATA_01 TESTDB_DATA_01_0001 1860077395968 203464622080
TESTDB_DATA_01 TESTDB_DATA_01_0002 1860528062464 204175556608

Reference :MY ORACLE SUPPORT and Oracle Documentations

Hope is helps...

Happy ASM learning...

No comments:

Post a Comment