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.
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:
SQLPLUS> ALTER SYSTEM START ROLLING MIGRATION TO 11.1.2; /*Then each ASM instance can be taken down and upgraded. After all the upgrades have been completed the migration just needs to be stopped.*/ SQLPLUS> ALTER SYSTEM STOP ROLLING MIGRATION;
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.