Manage Learn to apply best practices and optimize your operations.

How to manage an ASM instance with ASMCMD and ASMLIB

Managing ASM instances can be done through Oracle Enterprise Manager, as well as using the command line in sqlplus and ASMCMD, which is the ASM commandline utility. Oracle 11g ASMCMD has new commands to copy files, back up and restore metadata, and list and remap ASM files.

There are several new commands for the ASMCMD with Oracle 11g. The new commands are listed next:

  • cp This copies files between ASM disk groups and copies files from disk groups to the operating system, for example:

    ASMCMD >cp +DISKGRP1/MMDB.CTF1 /backups
  • Lsdsk This lists disk information, which is good for creating a list of disks an ASM instance uses.
  • md_backup This creates a backup file containing the metadata for one or more disk groups to enable you to re-create the disk groups in the future.
  • md_restore This restores a disk group using the backup from md_backup.
  • remap This recovers bad blocks on a disk by moving a good copy to a different location on disk.

    Next are other commands; this is not a complete list and you will start to see these are similar to linux/unix commands:

  • cd This changes the directory.
  • du This displays the total disk space.
  • exit This exits out of ASMCMD command line.
  • find This lists occurrences for the specified name.
  • ls This lists the contents of the ASM directory (when logging into ASM, it starts in the / root directory).
  • mkdir This creates ASM directories.
  • pwd This displays the path of the current directory.
  • lsct This lists information about current ASM clients.
Along with managing the ASM instances, there are performance improvements with Oracle 11g ASM, such as the Fast Mirror Resync. The time to recover from a failure is reduced because of improvements here. There are attributes for disk groups for these settings. DISK_REPAIR_TIME has a default of 3.6 hours, with the value determining how much faster the recovery time of the disks is. Faster rebalancing is also possible using RESTRICTED mode for the disk groups. ASM can be configured to read from a preferred mirror copy, which in a RAC environment means that nodes can read from their local storage mirrors instead of possibly having to go through a network with higher latencies.

As mentioned earlier, the rolling patching can be applied to the ASM instances as well as database instances when clustering ASM instances. Since ASM is dependent on the Oracle Clusterware, the clusterware must first be upgraded on all nodes before upgrading ASM. During the patching, normal database functions are possible, but changes to the disk group configurations are limited:

To start patching:

/*Then each ASM instance can be taken down and upgraded. After all the
upgrades have been completed the migration just needs to be stopped.*/

CRITICAL SKILL 8.8 Taking an instance from regular storage to ASM is actually a simple task, but this is making the assumption that the ASM instance has already been created. Using Oracle Enterprise Manager is probably the most straightforward way to do this.

Start by opening up Oracle Enterprise Manager and choosing the option to migrate to ASM. The screen shown in the following illustration is what comes up after you select to migrate to ASM. Migration requires to you to first choose the files to be migrated, which of course include database files, but can also include recovery type files, such as archive logs, backup, and control file copies. If not chosen, the log files and control files will remain on the current disk.

Create Oracle Enterprise Manager

This was last published in May 2010

Dig Deeper on Oracle database backup and recovery

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.