Please see my other blog for Oracle EBusiness Suite Posts - EBMentors

Search This Blog

Note: All the posts are based on practical approach avoiding lengthy theory. All have been tested on some development servers. Please don’t test any post on production servers until you are sure.

Monday, November 29, 2010

Using ASMCMD Utility

After creating you will want to manage your asm disksgroups , the task can be done with the help of sql connecting through ASM instance, but it will be good to know about the asmcmd utility also to do the asm managment.

Step1: set ORACLE_HOME on prompt
C:\Documents and Settings\inam>set ORACLE_HOME=D:\oracle\product\10.2.0\db_1

Step 2: set ORACLE_SID
C:\Documents and Settings\inam>set ORACLE_SID=+ASM

Step 3: Run the utility and use some commands
C:\Documents and Settings\inam>asmcmd
ASMCMD>
ASMCMD> pwd
+DB_DATA
ASMCMD> ls
ASMDB/
ASMCMD> pwd
+DB_DATA
ASMCMD> cd asmdb
ASMCMD> pwd
+DB_DATA/asmdb
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
TEMPFILE/
ASMCMD> cd datafile
ASMCMD> pwd
+DB_DATA/asmdb/datafile
ASMCMD> ls
SYSAUX.261.733408851
SYSTEM.259.733408841
UNDOTBS1.260.733408851

Copying files from ASM to file system (11g)
ASMCMD> ls -lt
State    Type    Rebal  Name
MOUNTED  EXTERN  N      DBDATA/
MOUNTED  EXTERN  N      DBFLASH/
ASMCMD> pwd
+dbdata/dbrac/datafile
ASMCMD> ls -lt
Type      Redund  Striped  Time             Sys  Name
                                            N    db_ts04.dbf => +DBDATA/DBRAC/DATAFILE/DB.272.766401017
                                            N    db_ts03.dbf => +DBDATA/DBRAC/DATAFILE/DB.271.766400995
                                            N    db_ts02.dbf => +DBDATA/DBRAC/DATAFILE/DB.270.766400973
                                            N    db_ts01.dbf => +DBDATA/DBRAC/DATAFILE/DB.269.766400951
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    USERS.259.766393285
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    UNDOTBS2.265.766393499
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    UNDOTBS1.280.767361619
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    UNDOTBS1.258.766393285
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    SYSTEM.256.766393283
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    SYSAUX.257.766393285
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    DB.272.766401017
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    DB.271.766400995
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    DB.270.766400973
DATAFILE  UNPROT  COARSE   APR 07 13:00:00  Y    DB.269.766400951
                                            N    test_netbkup.dbf => +DBDATA/DBRAC/DATAFILE/TESTT_NETBKUP.279.76640125
3
                                            N    recop1.dbf => +DBDATA/DBRAC/DATAFILE/RECOP1.278.766401249
                                            N    dblog02.dbf => +DBDATA/DBRAC/DATAFILE/DBLOG.274.766632369
                                            N    dblog01.dbf => +DBDATA/DBRAC/DATAFILE/DBLOG.275.766632361
                                            N    examcont01.dbf => +DBDATA/DBRAC/DATAFILE/EXAMCONT.276.766401211
                                            N    exam1425_01.dbf => +DBDATA/DBRAC/DATAFILE/EXAM14251426.277.766401221
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    UNDOTBS2.281.767362637
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    TESTT_NETBKUP.279.766401253
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    RECOP1.278.766401249
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    DBLOG.275.766632361
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    DBLOG.274.766632369
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    DB.273.766401039
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    EXAMPLE.264.766393395
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    EXAMCONT.276.766401211
DATAFILE  UNPROT  COARSE   APR 07 12:00:00  Y    EXAM14251426.277.766401221
ASMCMD>
ASMCMD> cp test_netbkup.dbf d:\temp
copying +dbdata/dbrac/datafile/test_netbkup.dbf -> d:\temp/test_netbkup.dbf



lsct: Lists information about current Oracle ASM clients from the V$ASM_CLIENT view.
ASMCMD> lsct
ASMCMD> lsct
DB_Name  Status     Software_Version  Compatible_version  Instance_Name  Disk_Group
+ASM     CONNECTED        11.2.0.3.0          11.2.0.3.0  +asm1          DBDATA
+ASM     CONNECTED        11.2.0.3.0          11.2.0.3.0  +asm1          DBFLASH
TESTDB   CONNECTED        11.2.0.3.0          11.2.0.0.0  homedb         DBDATA

du: Total space in MB used by files – particular directory can also be specified
ASMCMD> du
Used_MB      Mirror_used_MB
  63576               63576
 
find: we can use the wildcard or can specify a particular file type by using 
the ‘–type’ clause
ASMCMD> find --type ONLINELOG +DATA *
ASMCMD> find +DATA example*

iostat: Uses the V$ASM_DISK_IOSTAT view to display I/O statistics of disks in mounted ASM disk groups
ASMCMD> iostat -G DATA

lsdg: Uses V$ASM_DISKGROUP_STAT view to list information about a particular disk group
ASMCMD> lsdg DATA

lsattr: List attributes of a disk group
ASMCMD> lsattr -l -G DATA

Use the setattr command to change an attribute
ASMCMD> setattr -G data compatible.rdbms 11.2.0.0.0
ASMCMD> lsattr -l -G DATA


 

No comments: