In another post, we learned how to exploit all the ASMCA GUI features. asmca can be invoked with the -silent option and can effectively become a great command line interface.
You can create disk groups with the ASMCA configuration tool (ASMCA) or asmcmd command line interface as shown in this blog entry:
New ways to create disk groups in Oracle Database 11g Release 2
Another useful Oracle Database 11g Release 2 feature is the capability to add disk(s) to an existing disk group using asmca. In our example, we will add ORCL:DATA3 ASMLIB disk to the DATA diskgroup. Before we add the disk group, let’s look at the disks that make up the DATA disk group:
[oracle@jin1 ~]$ asmcmd lsdsk -G data Path ORCL:DATA1 ORCL:DATA2
Adding disks to an existing disk group:
Now, using ASM configuration assistant, let’s add a disk to the DATA disk group:
[oracle@jin1 ~]$ asmca -silent -adddisk -diskgroupname DATA -disk 'ORCL:DATA3' Disks added successfully to diskgroup DATA
Let’s confirm that ORCL:DATA3 disk is added:
[oracle@jin1 ~]$ asmcmd lsdsk -G data Path ORCL:DATA1 ORCL:DATA2 ORCL:DATA3
Create ASM Volumes with asmca
You can leverage asmca to create volumes out of existing disk groups. Once you create volumes, you can use them to create ASM cluster file systesm. Let’s go through the process of creating a volume of the DATA disk group and creating an ASM cluster file system and mounting the file system for end users.
[oracle@jin1 tmp]$ ksh cr_asmca_volume.txt Volume vol_lob created successfully.
The contents of the file cr_asmca_volume.txt looks like this:
[oracle@jin1 tmp]$ cat cr_asmca_volume.txt
asmca -silent \
-createVolume \
-volumeName vol_lob \
-volumeDiskGroup LOBDATA \
-volumeSizeGB 4
Listing the /dev/asm directory, you can see that our volume that was create is vol_lob-484:
[oracle@jin1 tmp]$ ls -ltr /dev/asm total 0 brwxrwx--- 1 root oinstall 252, 174081 Sep 9 00:45 vol_rpts-340 brwxrwx--- 1 root oinstall 252, 174082 Sep 11 06:58 vol_logfile-340 brwxrwx--- 1 root oinstall 252, 247809 Sep 12 13:29 vol_lob-484
Create ASM cluster file system (ACFS) with asmca
Using the vol_lob-484 volume, let’s create an ACFS file system:
[oracle@jin1 tmp]$ asmca -silent -createACFS -acfsVolumeDevice /dev/asm/vol_lob-484 ACFS creation on /dev/asm/vol_lob-484 completed successfully. The ACFS should be mounted for use.
For the final step, login as root and mount the ASM file system:
[root@jin1 acfsmounts]# pwd /apps/oracle/acfsmounts [root@jin1 acfsmounts]# mkdir lobdata [root@jin1 acfsmounts]# mount -t acfs /dev/asm/vol_lob-484 /apps/oracle/acfsmounts/lobdata
Verify that the newly created file system is mounted:
[root@jin1 acfsmounts]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
122G 11G 106G 9% /
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 1.1G 154M 874M 15% /dev/shm
.host:/ 163G 149G 15G 91% /mnt/hgfs
/dev/asm/vol_rpts-340
5.0G 49M 5.0G 1% /apps/oracle/acfsmounts/data_vol_rpts
/dev/asm/vol_logfile-340
3.0G 221M 2.8G 8% /apps/oracle/acfsmounts/data_vol_logfile
/dev/asm/vol_lob-484 4.0G 45M 4.0G 2% /apps/oracle/acfsmounts/lobdata
Posted by Charles Kim, Oracle ACE



















