Wednesday, November 25, 2009

ASMCMD

In this post I will provide you with some commonly used ASM commands and how to use it to perform some day to day activities.

Before invoking the ASM command, set the following environmental variables,

$ Export ORACLE_SID=+ASM1
$ Export ORACLE_HOME=/oracle/app/oracle/product/10.2.0.1/db_1

To invoke the ASMCMD

$ asmcmd –p
If the –p option is used, it displays the path in the prompt.



To navigate the directories (same as in Unix) case insensitive



To Create a File alias

$ asmcmd
ASMCMD> cd asmdb/gcprod/datafile
ASMCMD> mkalias +asmdb/gcprod/datafile/USERS.259.661355087 users_01.dbf

To remove a file alias

ASMCMD> rmalias +asmdb/gcprod/datafile/users_01.dbf

To check space usage

du – displays disk usage in MB. Similar to du command in unix.



lsdg – lists the disk group usage.



To find the RDBMS instances connected to ASM
lsct – lists the ASM Client information



To create and delete directories and files

ASMCMD> mkdir dummydir
ASMCMD> rm dummydir
ASMCMD> rm +asmdb/gcprod/datafile/USERS.259.661355087

Note: The file must be closed before deleting it otherwise the rm command will throw error.

Searching through the ASM directories



Thanks

Top Blogs

No comments:

Followers

Powered By Blogger
 

Oracle Database Administration. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com