Provided by Charles Kim, Oracle ACE Director
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Feb | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 | ||||
Provided by Charles Kim, Oracle ACE Director
To support all the greatest ASM cluster file system functionality in Oracle Database 11g Release 2, Oracle provides set of command-line tools available for all Unix and Windows platforms. Here’s a summary of all the available commands:
acfsdbg Debugs an Oracle ACFS file system. acfsutil info Displays various Oracle ACFS file system information. acfsutil registry Registers an Oracle ACFS file system with the Oracle ACFS mount registry. acfsutil rmfs Removes an Oracle ACFS file system. acfsutil size Resizes an Oracle ACFS file system. acfsutil snap create Creates a read-only snapshot of an Oracle ACFS file system. acfsutil snap delete Deletes a read-only snapshot of an Oracle ACFS file system. acfsutil tune Modifies or displays Oracle ACFS tuneables. advmutil tune Modifies or displays Oracle ADVM parameters. advmutil volinfo Displays information about Oracle ADVM volumes.
Let’s start with the acfsutil command. If you are not logged in as root, acfsutil may not be in your path. acfs is located in the /sbin directory. If you are logged in as oracle, you will have to add /sbin to your environment $PATH variable or fully qualify the path of the executable.
You can get the complete list of all the option by displaying the help page with the -h or -help option as shown here:
[root@jin1 ~]# acfsutil -h
Usage: acfsutil [-h] command ... # (Version 11.2.0.1.0.0)
-h - help
Command Subcmd Arguments
-------- ------ ----------------------------------------------------------------
help - display this message
version - display ACFS version information
info fs - Display all ACFS file systems
info fs [<path> ...] - Display specific ACFS file sys
info fs -o <item> <path> - Display specific file sys item:
info fs -o freespace, totalspace,
info fs -o mountpoints, volumes,
info fs -o available, ismountpoint,
info fs -o isavailable, iscorrupt,
info fs -o isadvm, diskgroup,
info fs -o redundancy, resizeincrement,
info fs -o stripewidth, stripecolumns,
info fs -o primaryvolume
info file <path> [<path> ...] - Display specific file info
info id <file-identifier> <mountpoint> -
info id Display the pathname associated with the given
info id ACFS file identifier and mountpoint.
rmfs <device> - Remove unmounted ACFS file sys
size [-|+]nnn[K|M|G|T|P] [-d <device>] <path> - Resize file system
registry [-l] - Display registry contents
registry -l <mountpoint> - Display a specific mount point
registry -l <device> - Display a specific device
registry -m <device> - Display a specific mount point associated with a device
registry -a [-f] [-o <opts>] [-n <nodes>] <device> <mountpoint> - Add a mount point
registry -d [<mountpoint> | <device>] - Delete a mount point or a device
tune AcfsMaxOpenFiles - Maximum number of open files
tune (Windows only)
snap create <snap_name> <mountpoint> - create a file system snapshot
snap delete <snap_name> <mountpoint> - delete a file system snapshot
[root@jin1 ~]# acfsutil version acfsutil version: 11.2.0.1.0.0
[root@jin1 ~]# acfsutil info fs
/apps/oracle/acfsmounts/data_vol_rpts
ACFS Version: 11.2.0.1.0.0
flags: MountPoint,Available
mount time: Wed Sep 9 00:45:39 2009
volumes: 1
total size: 5368709120
total free: 5317926912
primary volume: /dev/asm/vol_rpts-340
label:
flags: Primary,Available,ADVM
on-disk version: 39.0
allocation unit: 4096
major, minor: 252, 174081
size: 5368709120
free: 5317926912
ADVM diskgroup DATA
ADVM resize increment: 268435456
ADVM redundancy: unprotected
ADVM stripe columns: 4
ADVM stripe width: 131072
number of snapshots: 0
snapshot space usage: 0
/apps/oracle/acfsmounts/data_vol_logfile
ACFS Version: 11.2.0.1.0.0
flags: MountPoint,Available
mount time: Fri Sep 11 07:21:55 2009
volumes: 1
total size: 3221225472
total free: 2990030848
primary volume: /dev/asm/vol_logfile-340
label: Log Volume
flags: Primary,Available,ADVM
on-disk version: 39.0
allocation unit: 4096
major, minor: 252, 174082
size: 3221225472
free: 2990030848
ADVM diskgroup DATA
ADVM resize increment: 268435456
ADVM redundancy: unprotected
ADVM stripe columns: 4
ADVM stripe width: 131072
number of snapshots: 3
snapshot space usage: 106496
/apps/oracle/acfsmounts/lobdata
ACFS Version: 11.2.0.1.0.0
flags: MountPoint,Available
mount time: Sat Sep 12 13:47:06 2009
volumes: 1
total size: 4294967296
total free: 4248444928
primary volume: /dev/asm/vol_lob-484
label:
flags: Primary,Available,ADVM
on-disk version: 39.0
allocation unit: 4096
major, minor: 252, 247809
size: 4294967296
free: 4248444928
ADVM diskgroup LOBDATA
ADVM resize increment: 268435456
ADVM redundancy: unprotected
ADVM stripe columns: 4
ADVM stripe width: 131072
number of snapshots: 0
snapshot space usage: 0
[root@jin1 ~]# acfsutil info fs /apps/oracle/acfsmounts/data_vol_rpts
/apps/oracle/acfsmounts/data_vol_rpts
ACFS Version: 11.2.0.1.0.0
flags: MountPoint,Available
mount time: Wed Sep 9 00:45:39 2009
volumes: 1
total size: 5368709120
total free: 5317926912
primary volume: /dev/asm/vol_rpts-340
label:
flags: Primary,Available,ADVM
on-disk version: 39.0
allocation unit: 4096
major, minor: 252, 174081
size: 5368709120
free: 5317926912
ADVM diskgroup DATA
ADVM resize increment: 268435456
ADVM redundancy: unprotected
ADVM stripe columns: 4
ADVM stripe width: 131072
number of snapshots: 0
snapshot space usage: 0
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o freespace -o totalspace /apps/oracle/acfsmounts/data_vol_rpts 5368709120 [oracle@jin1 ~]$ /sbin/acfsutil info fs -o freespace -o totalspace -o volumes /apps/oracle/acfsmounts/data_vol_rpts 1 [oracle@jin1 ~]$ /sbin/acfsutil info fs -o volumes /apps/oracle/acfsmounts/data_vol_rpts1 [oracle@jin1 ~]$ /sbin/acfsutil info fs -o redundancy /apps/oracle/acfsmounts/data_vol_rpts unprotected [oracle@jin1 ~]$ /sbin/acfsutil info fs -o diskgroup /apps/oracle/acfsmounts/data_vol_rpts DATA [oracle@jin1 ~]$ /sbin/acfsutil info fs -o mountpoints /apps/oracle/acfsmounts/data_vol_rpts /apps/oracle/acfsmounts/data_vol_rpts [oracle@jin1 ~]$ /sbin/acfsutil info fs -o stripewidth /apps/oracle/acfsmounts/data_vol_rpts 131072 [oracle@jin1 ~]$ /sbin/acfsutil info fs -o stripecolumns /apps/oracle/acfsmounts/data_vol_rpts 4 [oracle@jin1 ~]$ /sbin/acfsutil info fs -o resizeincrement /apps/oracle/acfsmounts/data_vol_rpts 268435456 [oracle@jin1 ~]$ /sbin/acfsutil info fs -o freespace /apps/oracle/acfsmounts/data_vol_rpts 5317926912
[oracle@jin1 ~]$ /sbin/acfsutil info fs -o primaryvolume /apps/oracle/acfsmounts/data_vol_rpts /dev/asm/vol_rpts-340 [oracle@jin1 ~]$ /sbin/acfsutil info fs -o totalspace /apps/oracle/acfsmounts/data_vol_rpts 5368709120
In this example, we will shrink the file system by 2G down to 3G:
[oracle@jin1 ~]$ /sbin/acfsutil size -2G -d /dev/asm/vol_rpts-340 /apps/oracle/acfsmounts/data_vol_rpts
acfsutil size: new file system size: 3221225472 (3072MB)
[oracle@jin1 ~]$ 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 92% /mnt/hgfs
/dev/asm/vol_rpts-340
3.0G 49M 3.0G 2% /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
In this example, we will increase the file system by 2G and put the file system back to 5G.
[oracle@jin1 ~]$ /sbin/acfsutil size +2G -d /dev/asm/vol_rpts-340 /apps/oracle/acfsmounts/data_vol_rpts
acfsutil size: new file system size: 5368709120 (5120MB)
[oracle@jin1 ~]$ 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 92% /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
[oracle@jin1 ~]$ /sbin/acfsutil registry -h
Usage: acfsutil [-h] registry [-l] - Display registry contents
-l <mountpoint> - Display a specific mount point
-l <device> - Display a specific device
-m <device> - Display a specific mount point associated with a device
-a [-f] [-o <opts>] [-n <nodes>] <device> <mountpoint> - Add a mount point
-d [<mountpoint> | <device>] - Delete a mount point or a device
[oracle@jin1 ~]$ /sbin/acfsutil registry -l
Device : /dev/asm/vol_rpts-340 : Mount Point : /apps/oracle/acfsmounts/data_vol_rpts : Options : none : Nodes : all : Disk Group : DATA : Volume : VOL_RPTS
Device : /dev/asm/vol_logfile-340 : Mount Point : /apps/oracle/acfsmounts/data_vol_logfile : Options : none : Nodes : all : Disk Group : DATA : Volume : VOL_LOGFILE
[oracle@jin1 ~]$ /sbin/acfsutil registry -l /apps/oracle/acfsmounts/data_vol_rpts
Device : /dev/asm/vol_rpts-340 : Mount Point : /apps/oracle/acfsmounts/data_vol_rpts : Options : none : Nodes : all : Disk Group : DATA : Volume : VOL_RPTS
[oracle@jin1 ~]$ /sbin/acfsutil registry -m /dev/asm/vol_rpts-340
/apps/oracle/acfsmounts/data_vol_rpts
[oracle@jin1 ~]$ /sbin/acfsutil registry -l /dev/asm/vol_rpts-340
Device : /dev/asm/vol_rpts-340 : Mount Point : /apps/oracle/acfsmounts/data_vol_rpts : Options : none : Nodes : all : Disk Group : DATA : Volume : VOL_RPTS
[oracle@jin1 ~]$ /sbin/acfsutil snap create -h Usage: acfsutil [-h] snap create <snap_name> <mountpoint> - create a file system snapshot [oracle@jin1 ~]$ /sbin/acfsutil snap create 13Sep2009_rpts /apps/oracle/acfsmounts/data_vol_rpts acfsutil snap create: Snapshot operation is complete.
[root@rac9 bin]# ./acfsload start -s
[root@rac9 bin]# lsmod |grep -i ora
oracleacfs 781476 0
oracleadvm 212736 0
oracleoks 224864 2 oracleacfs,oracleadvm
oracleasm 46356 1
Create the file: /etc/init.d/acfsload
The file will contain the runlevel configuration, and the acfsload command. Place in the file the following lines
#!/bin/sh
# chkconfig: 2345 30 21
# description: Load Oracle ACFS drivers at system boot
/apps/oracle/product/11.2.0/grid/bin/acfsload start -s
[root@rac9 init.d]# chmod u+x /etc/init.d/acfsload
[root@rac9 init.d]# chkconfig –add acfsload
[root@rac9 init.d]# chkconfig –list acfsload
acfsload 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ASMCMD> volcreate -G lobdata -s 4g vol_lob2
Note:
You can not create a mirror or high redundancy volume on an external redundant disk group.
ASMCMD> volcreate -G lobdata -s 4g --redundancy mirror vol_lob2 ORA-15032: not all alterations performed ORA-15471: volume redundancy incompatible with diskgroup redundancy (DBD ERROR: OCIStmtExecute)
With the -a option (and do not specify a diskgroup and volume), you will get a detailed information about every volume for every diskgroup
ASMCMD> volinfo -a
Diskgroup Name: DATA
Volume Name: VOL_LOGFILE
Volume Device: /dev/asm/vol_logfile-340
State: ENABLED
Size (MB): 3072
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage: ACFS
Mountpath: /apps/oracle/acfsmounts/data_vol_logfile
Volume Name: VOL_RPTS
Volume Device: /dev/asm/vol_rpts-340
State: ENABLED
Size (MB): 5120
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage: ACFS
Mountpath: /apps/oracle/acfsmounts/data_vol_rpts
Diskgroup Name: LOBDATA
Volume Name: VOL_LOB
Volume Device: /dev/asm/vol_lob-484
State: ENABLED
Size (MB): 4096
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage: ACFS
Mountpath: /apps/oracle/acfsmounts/lobdata
Volume Name: VOL_LOB2
Volume Device: /dev/asm/vol_lob2-484
State: ENABLED
Size (MB): 4096
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage:
Mountpath:
To display volume information for a specific diskgroup, use the -G option:
ASMCMD> volinfo -G lobdata -a
Diskgroup Name: LOBDATA
Volume Name: VOL_LOB
Volume Device: /dev/asm/vol_lob-484
State: ENABLED
Size (MB): 4096
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage: ACFS
Mountpath: /apps/oracle/acfsmounts/lobdata
Volume Name: VOL_LOB2
Volume Device: /dev/asm/vol_lob2-484
State: ENABLED
Size (MB): 4096
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage:
Mountpath:
To display volume information for a specific volume, use the -G option followed by the volume name of interest:
ASMCMD> volinfo -G DATA VOL_RPTS
Diskgroup Name: DATA
Volume Name: VOL_RPTS
Volume Device: /dev/asm/vol_rpts-340
State: ENABLED
Size (MB): 5120
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage: ACFS
Mountpath: /apps/oracle/acfsmounts/data_vol_rpts
You can reverse query based on a volume device and lookup the volume information:
ASMCMD> volinfo --show_volume /dev/asm/vol_lob2-484 vol_lob2
Likewise, you can reverse lookup the disk group information based on the volume device:
ASMCMD> volinfo --show_diskgroup /dev/asm/vol_lob2-484 lobdata
ASMCMD> volstat -G data
DISKGROUP NUMBER / NAME: 1 / DATA
---------------------------------------
VOLUME_NAME
READS BYTES_READ READ_TIME READ_ERRS
WRITES BYTES_WRITTEN WRITE_TIME WRITE_ERRS
-------------------------------------------------------------
VOL_LOGFILE
49862 3219816448 37565 0
3349 167577600 80043 0
VOL_RPTS
125 71168 306 0
10 12288 90 0
If the –show_volume is not specified, I/O statistics for all volumes of the disk group are displayed. To display a specific volume, use the show_volume parameter as shown below:
ASMCMD> volstat -G data --show_volume vol_logfile
DISKGROUP NUMBER / NAME: 1 / DATA
---------------------------------------
VOLUME_NAME
READS BYTES_READ READ_TIME READ_ERRS
WRITES BYTES_WRITTEN WRITE_TIME WRITE_ERRS
-------------------------------------------------------------
VOL_LOGFILE
49862 3219816448 37565 0
3349 167577600 80043 0
ASMCMD> voldisable -G lobdata vol_lob2 ASMCMD> ASMCMD> volenable -G lobdata vol_lob2 ASMCMD> voldisable -G lobdata vol_lob2
Use the -a option to enable all the volumes for the disk gruop
ASMCMD> volenable -G lobdata -a
Note:
You cannot disable a volume that is currently being accessed:
ASMCMD> voldisable -G lobdata vol_lob ORA-15032: not all alterations performed ORA-15468: volume 'VOL_LOB' in diskgroup 'LOBDATA' is currently being accessed (DBD ERROR: OCIStmtExecute) Resizing an existing volume [code language='sql'] ASMCMD> volresize -G LOBDATA -s 5G VOL_LOB2 ASMCMD> volresize -G LOBDATA -s 2G VOL_LOB2 The volume is not ACFS and the requested size is smaller than the current size. Data corruption may occur. Are you sure? [y/n]: y
Note:
You cannot volresize a volume that is being accessed. I wish the error message was more accurate.
ASMCMD> volresize -G LOBDATA -s 5G VOL_LOB ORA-15032: not all alterations performed ORA-15476: resize of ACFS volume must use ACFS resize command (DBD ERROR: OCIStmtExecute)
You can use the voldelete command followed by the -G option for the diskgroup followed by the volume name to drop a volume from the diskgroup
ASMCMD> voldelete -G lobdata VOL_LOB2
You can set attributes for volumes. The attributes that are available are:
1. --usagestring
2. --mountpath
These attributes are information only and used for informational purposes only by ASM and not used by ASM. Here's couple of examples with volset
[oracle@jin1 ~]$ asmcmd volset -G data --usagestring 'To Store temporary reports' VOL_RPTS
[oracle@jin1 ~]$ asmcmd volset -G data --mountpath 'We should mount this volume as /data/reports' VOL_RPTS
[oracle@jin1 ~]$ asmcmd volinfo -G data VOL_RPTS
Diskgroup Name: DATA
Volume Name: VOL_RPTS
Volume Device: /dev/asm/vol_rpts-340
State: ENABLED
Size (MB): 5120
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage: To Store temporary reports
Mountpath: We should mount this volume as /data/reports
Posted by Charles Kim, Oracle ACE
As of Oracle Database 11g Release 2, we can now rename disk groups. Why is this important? There’s two great reason why I think this feature is really beneficial for lot of companies. First, companies who leverage hardware mirroring or triple mirroring technologies such as EMC Business Continuity Volumes (BCV) or Hitachi Shadow Image (SI) can really benefit from this. Companies can now break their BCV or SI and rename their disk group where they have their production database and mount it again as another diskgroup. This way they can stand up another copy of their production database on the same physical server with minimal effort.
Note:
1. As of the initial release of Oracle Database 11g Release 2, the disk group rename feature does not handle the remaining task of standing up another database. You still have to re-catalog all the database files with the renamed disk group name. Additionally, you will have to create a new DB ID (nid).
2. If your company happens to have standardized disk group names with easily identifiable names such as as DATA, FLASH, LOBDATA, or FRA, you may have the same disk group names in Production, Staging, DEV and even disaster recovery site. For example, you can zone your production BCV or SI disks to your staging/Pre-Production/Model servers, rename the disk group called DATA to STAGE_DATA, and stand up the database from your BCV/SI.
Likewise, if you built disk groups with intelligent naming schemes (being a forward thinking architect
), you may now choose to create easily identifiable disk group names such as DATA, FLASH, FRA, LOBDATA, etc.
Let’s look at the process of renaming a disk group. In order to rename a disk group, the disk group must be disounted across all the RAC nodes:
ASMCMD> umount dg_external ASMCMD> umount fra
You can rename a disk group in one of two ways. The first option (default) renames the disk group in a single command. In our example, we will also specify the verbose mode for additional details in the output. The second option will create a configuration file at the end of phase one and will use the configuration file to complete the rename disk group operation.
The default phase is both.
[oracle@jin1 ~]$ renamedg dgname=fra newdgname=flash verbose=true
Parsing parameters..
Parameters in effect:
Old DG name : FRA
New DG name : FLASH
Phases :
Phase 1
Phase 2
Discovery str : (null)
Clean : TRUE
Raw only : TRUE
renamedg operation: dgname=fra newdgname=flash verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:FRA1 with disk number:0 and timestamp (32924850 209876992)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:FRA1 with disk number:0 and timestamp (32924850 209876992)
Checking if the diskgroup is mounted
Checking disk number:0
Checking if diskgroup is used by CSS
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for ORCL:FRA1
Modifying the header
Completed phase 2
Terminating kgfd context 0xb7f2c050
Let’s mount the renamed disk group:
[oracle@jin1 ~]$ asmcmd mount flash [oracle@jin1 ~]$ 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 EXTERN N 512 4096 1048576 23460 13140 0 13140 0 N DATA/ MOUNTED EXTERN N 512 4096 1048576 42068 42016 0 42016 0 N FLASH/ MOUNTED EXTERN N 512 4096 1048576 45792 41631 0 41631 0 N LOBDATA/
This option basically involves two steps to renaming a disk group. The first step, referred to as phase one, generates a configuration file. The config file has line item entries for each disk with changes to be made. The second step called phase two uses the generated config file to perform the rename function.
Another important information to note is that the renamedg command is an OS utility (not an asmcmd command). if you type renamedg with the -help option, you can get the complete syntax:
[oracle@jin1 ~]$ renamedg -help
Parsing parameters..
phase Phase to execute,
(phase=ONE|TWO|BOTH), default BOTH
dgname Diskgroup to be renamed
newdgname New name for the diskgroup
config intermediate config file
check just check-do not perform actual operation,
(check=TRUE/FALSE), default FALSE
confirm confirm before committing changes to disks,
(confirm=TRUE/FALSE), default FALSE
clean ignore errors,
(clean=TRUE/FALSE), default TRUE
asm_diskstring ASM Diskstring (asm_diskstring='discoverystring',
'discoverystring1' ...)
verbose verbose execution,
(verbose=TRUE|FALSE), default FALSE
keep_voting_files Voting file attribute,
(keep_voting_files=TRUE|FALSE), default FALSE
Let’s start the process, phase one, by creating our configuration file:
[oracle@jin1 ~]$ renamedg -phase one -dgname dg_external -newdgname lobdata -config rename_dg_external_2.conf Parsing parameters.. renamedg operation: -phase one -dgname dg_external -newdgname lobdata -config rename_dg_external_2.conf Executing phase 1 Discovering the group Checking for hearbeat... Re-discovering the group Generating configuration file.. Completed phase 1
The configuration file rename_dg_external_2.conf looks like this:
[oracle@jin1 ~]$ cat rename_dg_external_2.conf ORCL:HIGH1 DG_EXTERNAL LOBDATA ORCL:HIGH2 DG_EXTERNAL LOBDATA ORCL:HIGH3 DG_EXTERNAL LOBDATA
Now, let’s apply the configuration file and rename our diskgroup from DG_EXTERNAL to LOBDATA:
[oracle@jin1 ~]$ renamedg -phase two -dgname dg_external -newdgname lobdata -config rename_dg_external_2.conf Parsing parameters.. renamedg operation: -phase two -dgname dg_external -newdgname lobdata -config rename_dg_external_2.conf Executing phase 2 Completed phase 2
We should now be able to mount the renamed LOBDATA disk group with asmcmd:
[oracle@jin1 ~]$ asmcmd ASMCMD> mount lobdata
With the lsdg asmcmd command, you can verify that the LOBDATA disk group is truly mounted:
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 EXTERN N 512 4096 1048576 15640 5332 0 5332 0 N DATA/ MOUNTED EXTERN N 512 4096 1048576 45792 45736 0 45736 0 N LOBDATA/
Posted by Charles Kim, Oracle ACE
Prior to Oracle Database 11g Release 2, you had to issue the following commands in sqlplus to mount and dismount a diskgroup:
SQL> alter diskgroup fra mount; Diskgroup altered. SQL> alter diskgroup fra dismount; Diskgroup altered.
As of Oracle Database 11g Release 2, an easier and more SA friendly approach is provided with asmcmd:
ASMCMD> mount fra
Looking at the disk group information with the lsdg command, we see that the fra disk group is now mounted:
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 EXTERN N 512 4096 1048576 15640 5352 0 5352 0 N DATA/ MOUNTED EXTERN N 512 4096 1048576 45792 45736 0 45736 0 N DG_EXTERNAL/ MOUNTED EXTERN N 512 4096 1048576 42068 42016 0 42016 0 N FRA/
Let’s issue the umount command in asmcmd. Notice that the syntax is umount in asmcmd and dismount in SQL*Plus:
ASMCMD> umount fra
Looking at the disk group information with the lsdg command, we see that the fra disk group is no longer mounted:
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 EXTERN N 512 4096 1048576 15640 5352 0 5352 0 N DATA/ MOUNTED EXTERN N 512 4096 1048576 45792 45736 0 45736 0 N DG_EXTERNAL/
Posted by Charles Kim, Oracle ACE
Guess what? As of Oracle Database 11g Release 2, we can create disk groups using the asmcmd command. Check out one of the new ways we can create a diskgroup using an XML file as a template. The mkdg ASMCMD command can accept an xml file as a parameter to create a disk group:
[oracle@jin1 ~]$ asmcmd mkdg dg_high.xml
[oracle@jin1 ~]$ cat dg_high.xml
<dg name="dg_high" redundancy="high">
<fg name="fg1">
<dsk string="ORCL:HIGH1" />
</fg>
<fg name="fg2">
<dsk string="ORCL:HIGH2" />
</fg>
<fg name="fg3">
<dsk string="ORCL:HIGH3" />
</fg>
<a name="compatible.asm" value="11.2"/>
<a name="compatible.rdbms" value="11.2"/>
</dg>
And if we refresh our Automatic Storage Management main screen, we see the new diskgroup as shown here:

Let’s drop the dg_high disk group and show you how you can do this same thing with asmca command line interface.
Here’s the super hard syntax to drop the dg_high disk group:
ASMCMD> dropdg dg_high
Now, let’s create the disk group with asmca command line interface:
[oracle@jin1 ~]$ ksh cr_dg_high.txt DiskGroup dg_high created successfully. [oracle@jin1 ~]$ cat cr_dg_high.txt asmca -silent -createDiskGroup \ -diskgroupname dg_high \ -redundancy high \ -disk 'ORCL:HIGH1' -disk 'ORCL:HIGH2' -disk 'ORCL:HIGH3' \ -failuregroup fg1 \ -failuregroup fg2 \ -failuregroup fg3 \ -au_size 64 \ -compatible.asm '11.2.0.0.0' \ -compatible.rdbms '11.2.0.0.0' \ -compatible.advm '11.2.0.0.0'
In the example with the asmca command line syntax, we added a little twist by adding the allocation extent to 64 MB and adding the compatible.advm attribute.
Majority of the ASM customers run external redundancy and have the protection provided to us by the storage array vendors. Let’s see our same example and show how to create an external redundant diskgroup. Here’s the XML file for the external redundancy disk group:
[oracle@jin1 ~]$ cat dg_external.xml
<dg name="dg_external" redundancy="external">
<dsk string="ORCL:HIGH1" />
<dsk string="ORCL:HIGH2" />
<dsk string="ORCL:HIGH3" />
<a name="compatible.asm" value="11.2"/>
<a name="compatible.rdbms" value="11.2"/>
<a name="compatible.advm" value="11.2"/>
</dg>
Using asmcmd, we will create the dg_external diskgroup:
[oracle@jin1 ~]$ asmcmd mkdg dg_external.xml
Alternatively, you can create the diskgroup in a single inline command as shown here:
ASMCMD> mkdg '<dg name="dg_external" redundancy="external"> <dsk string="ORCL:HIGH1" /> <dsk string="ORCL:HIGH2" /> <dsk string="ORCL:HIGH3" /> <a name="compatible.asm" value="11.2"/> <a name="compatible.rdbms" value="11.2"/> <a name="compatible.advm" value="11.2"/> </dg>'
Obviously, nobody in their right mind would create a disk in this format. Wether you use asmca or asmcmd with an XML file or even the dreaded SQL*Plus, figure out what works best for you and stick with it. Depending on if you are a Unix System Administrator or Database Administrator, you may choose a different tool as your standard.
Posted by Charles Kim
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
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
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
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
From the ASM Cluster File System main screen (Click on the ASM Cluster File System Tab), we will click on the VOL_LOGFILE volume URL to see volume related information:

Click on the Edit button to edit the current volume:

From the Edit Volume screen, click on the URL next to the Size Field. You will be redirected to the Resize ASM Cluster File System screen:

Let’s change the size from 2 GB to 3GB and click on the show command to see what commands EM will submit do to resize the file system:
Show Command /sbin/acfsutil size 3G /apps/oracle/acfsmounts/data_vol_logfile
The acfsutil above will resize the file system and resize the volume at the same time.
Click on Return to go back to the Resize ASM Cluster File System screen
Click on the OK button
Again, you will be prompted to provide ASM Cluster File System Host Credentials if you have not saved your credentials as a preferred credential yet.
Enter your username credentials and click on Continue
When the task is complete, you will be routed to the ASM Cluster File System: /apps/oracle/acfsmounts/data_vol_logfile screen
(You may see a screen stating that the no monitoring data has been collected for this ASM Cluster File system.)
Click on the ASM Cluster File System breadcrumb URL
In the ASM Cluster File System main screen, you will see the changed size for the /apps/oracle/acfsmounts/data_vol_logfile file system.
From the ASM Cluster File System main screen, you will see buttons to Delete the mount point, to view the contents of the file system, register/deregister a file system, mount all and dismount all file systems. You will also notice that the actions drop list has the functions to resize an existing file system and to check and repair a file system. In order to perform a check and repair function, the file system must be dismounted.

Let’s go an dismount a file system:
Click on the radio button of the file system that you want to dismount

You will see the Dismount ASM Cluster File System screen. As you can guess, Enterprise Manager only generates the syntax that need to be executed by someone with root privileges (or sudo). Click on the Return button to go back to the ASM Cluster File System main page.
Posted by Charles Kim, Oracle ACE
Let’s login to the EM Database Control. Your URL to login should be something like this:
https://jin1:1158/em
Scroll to the bottom of the screen to the instances section. You will see the database and ASM instance information as shown here:

Click on the +ASM1_[HOSTNAME] instance URL
The Automatic Storage Management Home page now includes sections for ASM Clustered File Systems (ACFS) and Volumes.

You will also notice a new tab dedicated to support the new ASM Cluster File System feature. The ASM Cluster File System tab will simplify your ability to create volumes, create cluster file systems and ACFS snapshots. In this blog post, we will only cover creating volumes and ASM cluster file systems.
The new Oracle ASM Dynamic Volume Manager (Oracle ADVM) provides volume management services and a standard disk device driver interface. A volume device is constructed from an ASM volume. You can create one or more volumes devices within a disk group. Once you create a volume, you can create a file system using that volume. You can create an ASM cluster file system off of the ASM volume. Likewise, you can create an EXT3 or OCFS2 file system based on the ASM volume. Likewise, as Oracle ports ACFS to other Unix Platforms, you can create the OS native file systems using Oracle ASM disk group volumes. Oracle ACFS is layered on ASM through the ADVM interface.
Note:
Creating an OCFS2 file system on top of ASM Disk Group does not make sense, but it is do-able.
Requirements for ADVM
1. COMPATIBLE.ASM and COMPATIBLE.ADVM attributes must be set to 11.2.
2. Volume name can be a maximum of 11 alphanumeric characters (no dashes and first character must be alphabetic)
Let’s click on the new ASM Cluster File System tab and create ourselves an ASM Cluster File System.
You will see the following screen:

Notice that we already created the VOL_RPTS volume that is already mounted as /apps/oracle/acfsmounts/data_vol_rpts mount point. Let’s create a new volume and mount another file system. To start this process, click on the Create button on the right corner. You will be directed to the Create ASM Cluster File System screen. Before we can create an ASM Cluster File System, we must first create a volume. Click on the the Create ASM Volume button. From the Create ASM Volume screen,

Enter the values for Volume, Data Group, and Size.
Notice the size can be specified in MB, GB and TB.
If you want to see the SQL, click on the Show Command button

Click on the Return button to go back to the Create ASM Cluster File System Screen
You will notice that the Volume Device field is populated with the new Volume that you just created
Specify a label (optional) if you want and specify a Mount Point

Again, click on the Show Command button

Click on the Return button to back to the Create ASM Cluster File System screen
Click on the OK button to create the ACFS file system
You will be requested to enter OS credentials – This operating system user name and password will be used to perform ASM Cluster File System operations on this host.
You will receive a confirmation status on top of the screen indicating that the file system was successfully created:

Next, click on the VOL_LOGFILE Volume radio button and click on the Mount button on the top left portion of the screen. You will be routed to the Mount ASM Cluster File System: [VOLUME_NAME] screen.

Unfortunately, you will not be able to mount the file system from Enterprise Manager. Only thing you will be able to do is generate the command and ask your system administrator to mount the file system.
As the root user, issue the mount command shown from this screen.
[root@jin1 oracle]# /bin/mount -t acfs /dev/asm/vol_logfile-340 /apps/oracle/acfsmounts/data_vol_logfile
Now from the OS, you can see the output from the df -h command to see the new file system mounted:
[root@jin1 oracle]# 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 141G 23G 87% /mnt/hgfs
/dev/asm/vol_rpts-340
5.0G 49M 5.0G 1% /apps/oracle/acfsmounts/data_vol_rpts
/dev/asm/vol_logfile-340
2.0G 41M 2.0G 2% /apps/oracle/acfsmounts/data_vol_logfile
Click on the Return button to go back to the Mount Cluster File System screen. Click the Return button again to back to the ASM Cluster File System main screen.
Posted by Charles Kim, Oracle ACE
Earlier we went through the exercise to create ASM Volumes and Cluster File Systems within ASM disk groups. Another great feature introduced in Oracle Database 11g Release 2 is the capability to create snapshot images of the ASM cluster file systems. Oracle allows up to 63 read-only snapshots of their file system leveraging the Copy-on-write (COW) technology. When a snapshot request is submitted, COW technology stores only the meta-data about where the original data is stored is copied. The creation of the snapshot should be almost instantaneous since only the meta-data is being copied. The snapshot copy then tracks changed blocks to a snapshot storage location as writes are being performed. The original data that is being written to is copied into the designated area on the file system before the original data is overwritten. This is where the name copy-on-write comes from.
Read requests for unchanged data blocks go directly to the original file system. Read requests for changed data blocks are directed to the copied block on the snapshot storage volume. Please remember that the original data is only copied once. Subsequence change to the same block is not copied more than once.
EM provides full support for ASM snapshots. Let’s go EM Database Control and see how this is done. From the ASM Cluster File System tab, select a mount point and click on the Create Snapshot button.

You should se the Create Snapshot on ASM Cluster File System screen. Notice that the Snapshot Name column is auto-populated for you with shapshot_[date]_[time] format. You can change this to any kind of standard you may designate for your company.
Notice the Delete the oldest snapshot (62 remaining before the maximum limit is reached) check box. You will see this check box as you create your second and subsequent ASM snapshots. You will also see the oldest snapshot with the URL for easy convenience.
Click on the Show Command button to see the command line syntax that EM is about to submit:

For the command line DBAs, we can create snapshots copying and pasting from the following syntax:
/sbin/acfsutil snap create "snapshot_20090911_104833" /apps/oracle/acfsmounts/data_vol_logfile
Click on the Return button
From the Create Snapshot on ASM Cluster File System screen, click on the OK button. You will be routed to the ASM Cluster File System Host Credentials screen. Enter the username and password for oracle. If you want EM Database Control to remember the username and password, you can click on the option to save as preferred credential checkbox.

Click on the Continue button
You will be redirected to the ASM Cluster File System main page and will see a successful confirmation status:

We created our snapshot of the /apps/oracle/acfsmounts/data_vol_logfile file system. From the ASM Cluster File System main screen, click on the file system URL and look at some General information about that mount point.

You can see the general usage information and alerts for the file system. Usage information of the file system include Size (GB), Used (GB), Free (GB), Used (%), Allocated Space (GB) and Space Used by Snapshots (MB) or (GB).
Also in this screen, you will notice the Snapshots tab. Click on the Snapshots tab to see all the snapshot history for this ACFS file system. You can create additional snapshots or even delete existing snapshots from this screen:

And, of course, you can search for a specific snapshot using the search option on the snapshot name.
Posted by Charles Kim, Oracle ACE
ocssd.bin is required for ASM if you are not running RAC. If you are not running ASM, you will want to disable this process from starting up. You can use the following instructions from this blog.
bash-3.00$ ps -fu oracle UID PID PPID C STIME TTY TIME CMD oracle 9578 9567 0 14:39:17 pts/2 0:00 /bin/bash oracle 4129 2268 0 Sep 02 ? 4:54 /apps/oracle/product/GC/db10g/bin/ocssd.bin .. .
Login as root and change your directory to /etc/init.d and issue the init.cssd command:
bash-3.00# ./init.cssd stop css Shutting down CRS daemon. Shutting down EVM daemon. Shutting down CSS daemon. Shutdown request successfully issued. Shutdown has begun. The daemons should exit soon. bash-3.00#
If you do not want ocssd.bin process to start back after the server reboot, type the following command:
bash-3.00# ./init.cssd disable css
Automatic startup disabled for system boot.
In Oracle 10.2 and above, Oracle recommends using the crsctl command to start/stop CSS. To stop the ocssd.bin daemon, change your directory to $ORACLE_HOME/bin and execute the following commands:
crsctl stop css crsctl disable css
Posted by Charles Kim, Oracle ACE