Oracle ASM commands on Linux

 

grid

  1. Automatic Storage Management (ASM) commands
    1. Start asm daemon and create ASM disk
      1. /usr/sbin/oracleasm init
      2. fdisk /dev/sdb
        1. n –>create new disk
        2. p —>primary partition
        3. w —>save conf.
      3. oracleasm createdisk DATA /dev/sdb1
      4. oracleasm listdisks
    2.  Change  grid user:
      1.  [root@exa01dbadm01 ~]# su – grid
        [grid@exa01dbadm01 ~]$ asmcmd
        ASMCMD> ls -l
        State Type Rebal Name
        MOUNTED NORMAL N DATAC1/
        MOUNTED NORMAL N DBFS_DG/
        MOUNTED NORMAL N RECOC1/
        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 4194304 14315520 10306736 1192960 4556888 0 N DATA1/
        MOUNTED NORMAL N 512 4096 4194304 207648 197960 34608 81676 0 Y DBFS/
        MOUNTED NORMAL N 512 4096 4194304 2665536 1009240 222128 393556 0 N RECO/
        ASMCMD> pwd
        +ASMCMD> cd RECO
        ASMCMD> pwd
        +RECOC
        ASMCMD>
    3. ASMCMD Key Commands
      COMMAND DESCRIPTION
      cd Change directory
      cp Copy file
      du Disk space used by a directory and its subdirectories
      exit Exit the utility
      find Locate the path for all occurrences of the specified filename
      help Displays command assistance
      ls List the contents of a directory
      lsct List info about ASM clients
      lsdg List all disk groups and their attributes
      lsdsk List all physical disks visible to ASM
      md_backup Create a backup of the mounted diskgroups
      md_restore Restore the diskgroups from a backup
      mkalias Create an alias for a system generated filename
      mkdir Create directory
      pwd Print working directory (i.e. list current directory location)
      remap Repair a range of blocks on a disk
      rm Remove (i.e. delete) the specified files or directories
      rmalias Remove (i.e. delete) the specified alias

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s