Tuesday, November 6, 2012

Oracle ACFS Command-Line Tools


Oracle ACFS Command-Line Tools

Command-line tools for managing and implementing Oracle Automatic Storage Management Cluster File System (Oracle ACFS), include the following:
·         Basic Steps to Manage Oracle ACFS Systems
·         Oracle ACFS Command-line Tools for Linux and UNIX Environments

Basic Steps to Manage Oracle ACFS Systems

·         Creating an Oracle ACFS File System
·         Accessing an Oracle ACFS File System on a Different Node in the Cluster
·         Managing Oracle ACFS Snapshots
·         Deregistering, Dismounting, and Disabling Volumes and Oracle ACFS File Systems
·         Removing an Oracle ACFS File System and a Volume

Creating an Oracle ACFS File System


·         Create an Oracle ASM volume in a mounted disk group with the ASMCMD volcreate command.
ASMCMD [+] > volcreate -G data -s 10G volume1

·         Determine the device name of the volume that was created.
ASMCMD [+] > volinfo -G data volume1
Diskgroup Name: DATA
 
         Volume Name: VOLUME1
         Volume Device: /dev/asm/volume1-123
         State: ENABLED
     ... 
 
SQL> SELECT volume_name, volume_device FROM V$ASM_VOLUME 
     WHERE volume_name ='VOLUME1';
 
VOLUME_NAME        VOLUME_DEVICE
-----------------  --------------------------------------
VOLUME1            /dev/asm/volume1-123
                              
·         Create a file system with the Oracle ACFS mkfs command.
$ /sbin/mkfs -t acfs /dev/asm/volume1-123
 
mkfs.acfs: version                   = 11.2.0.1.0.0
mkfs.acfs: on-disk version           = 39.0
mkfs.acfs: volume                    = /dev/asm/volume1-123
mkfs.acfs: volume size               = 10737418240
mkfs.acfs: Format complete.


·         Optionally register the file system with the acfsutil registry command.
For example:
$ /sbin/acfsutil registry -a /dev/asm/volume1-123 /u01/app/acfsmounts/myacfs
 
acfsutil registry: mount point /u01/app/acfsmounts/myacfs successfully added 
  to Oracle Registry

·         Mount the file system with the Oracle ACFS mount command. 
# /bin/mount -t acfs /dev/asm/volume1-123 /u01/app/acfsmounts/myacfs

·         After the file system has been mounted, ensure that the permissions are set to allow access to the file system for the appropriate users.
# chown -R oracle:dba /u01/app/acfsmounts/myacfs

·         Create a test file in the file system.
$ echo "Oracle ACFS File System" > /u01/app/acfsmounts/myacfs/myfile

·         List the contents of the test file that was created in the file system.
$ cat /u01/app/acfsmounts/myacfs/myfile
Oracle ACFS File System

Accessing an Oracle ACFS File System on a Different Node in the Cluster

If the node is part of a cluster, perform the following steps on node 2 to view the test file you created on node 1.
·         Enable the volume that was previously created and enabled on node 1.
ASMCMD [+] > volenable -G data volume1

·         View information about the volume that you created on node 1.
ASMCMD [+] > volinfo -G data volume1

·         Mount the file system using the Oracle ACFS mount command.
# /bin/mount -t acfs /dev/asm/volume1-123 /u01/app/acfsmounts/myacfs

·         List the contents of the test file you previously created on the file system.
For example:
$ cat /u01/app/acfsmounts/myacfs/myfile
Oracle ACFS File System

The contents should match the file created previously on node 1.

Managing Oracle ACFS Snapshots

To create and verify a snapshot on node 1:
1.    Create snapshot of the new file system created on node 1.
For example:
$ /sbin/acfsutil snap create mysnapshot_20090725 /u01/app/acfsmounts/myacfs
2.    Update the test file in the file system so that it is different than the snapshot.
For example:
$ echo "Modifying a file in Oracle ACFS File System" > /u01/app/acfsmounts/myacfs/myfile
3.    List the contents of the test file and the snapshot view of the test file.
For example:
$ cat /u01/app/acfsmounts/myacfs/myfile
 
$ cat /u01/app/acfsmounts/myacfs/.ACFS/snaps/mysnapshot_20090725/myfile
The contents of the test file and snapshot should be different. If node 1 is in a cluster, then you can perform the same list operation on node 2.

Disabling a Volume

To disable a volume, you must first dismount the file system on which the volume is mounted.
For example:
# /bin/umount /u01/app/acfsmounts/myacfs
After a file system is dismounted, you can disable the volume and remove the volume device file.
For example:
ASMCMD> voldisable -G data volume1
Dismounting the file system and disabling a volume does not destroy data in the file system. You can enable the volume and mount the file system to access the existing data.

Removing an Oracle ACFS File System and a Volume

To permanently remove a volume and Oracle ACFS file system, perform the following steps. These steps destroy the data in the file system.
1.    Deregister the file system with acfsutil registry -d.
For example:
$ /sbin/acfsutil registry -d /oracle/acfsmounts/acfs1
acfsutil registry: successfully removed ACFS mount point
   /oracle/acfsmounts/acfs1 from Oracle Registry
2.    Dismount the file system.
For example:
# /bin/umount /oracle/acfsmounts/acfs1
You must dismount the file system on all nodes of a cluster.
3.    Remove the file system with acfsutil rmfs.
If you were not planning to remove the volume in a later step, this step is necessary to remove the file system. Otherwise, the file system is removed when the volume is deleted.
For example:
$ /sbin/acfsutil rmfs /dev/asm/volume1-123
4.    Optionally you can disable the volume with the ASMCMD voldisable command.
For example:
ASMCMD> voldisable -G data volume1
5.    Delete the volume with the ASMCMD voldelete command.
For example:
ASMCMD> voldelete -G data volume1

No comments:

Post a Comment