Monday, August 11, 2014

[ODA] How to create and delete an Oracle Cloud FS (a.k.a. ACFS)

This is other post that can help you with ODA Systems.

For upgrade purpose I need to create another filesystem, cause my dmp file is almost 200GB, and I don't have enough space in the other ones.

Enough talking, let's get started.

From your Node 1 (my-oda1) and with grid user execute the next steps:

1. If this is a new ODA you "must" have plenty space in your Diskgroups (+DATA, +REDO, +RECO) so, space is not a topic you should be worry about. But if you have database created in your ODA, you should take a look around how much space you have available in your diskgroups.

Query the space available, in ASM instance :

su - grid
sqlplus / as sysdba

SQL> select name,total_mb,free_mb from v$asm_diskgroup;

NAME                             TOTAL_MB    FREE_MB
------------------------------ ---------- ----------
DATA                              7372800    2320020
RECO                              9796800    9714460
REDO                               763120     729800

I recommend you, create the volume in +DATA disk group.

2. Once you are sure that you have enough room to create the volume, execute the next command, with grid user:

$ asmcmd
ASMCMD> volcreate -G DATA -s 300G cloudfs

You will need the Volume Device in the next step, execute the next command to get it:

ASMCMD> volinfo -G DATA cloudfs1
Diskgroup Name: DATA

         Volume Name: CLOUDFS1
         Volume Device: /dev/asm/cloudfs1-444
         State: ENABLED
         Size (MB): 307200
         Resize Unit (MB): 32
         Redundancy: MIRROR
         Stripe Columns: 4
         Stripe Width (K): 128

3.  Next, you need to format your brand new volume:

[grid@my-oda1 ~]$ /sbin/mkfs -t acfs /dev/asm/cloudfs1-444
mkfs.acfs: version                   =
mkfs.acfs: on-disk version           = 39.0
mkfs.acfs: volume                    = /dev/asm/cloudfs1-444
mkfs.acfs: volume size               = 322122547200
mkfs.acfs: Format complete.

4. Register and mount the Cloud FS in both nodes:

[grid@my-oda1 /]$ /sbin/acfsutil registry -a /dev/asm/cloudfs1-444 /cloudfs
acfsutil registry: mount point /cloudfs successfully added to Oracle Registry

5.  Now, if you execute the df -h command, you will see the Cloud FS mounted:

[root@my-oda1 ~]# df -h /cloudfs
Filesystem            Size  Used Avail Use% Mounted on
                      300G  686M  300G   1% /cloudfs

6.  Change owner to the Cloud FS with user root:

[root@my-oda1 ~]# chown oracle:dba /cloudfs

7. If you are using this Cloud FS for your upgrade, maybe you want to mount it in your current production server:

Edit your ODA's exports file:

[root@my-oda1 etc]# vi exports


And restart your nfs service:

[root@my-oda1 etc]# /etc/init.d/nfs restart
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Stopping RPC idmapd:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]

Now that you are finished, you want your 300GB back... so,  perform the following steps to delete it:

1. With user root, umount your Cloud FS.

If you want to avoid error:  ORA-15468: volume 'cloudfs' in diskgroup 'DATA' is currently being accessed you need to remember to umount the Cloud FS in Node 2 of your ODA System (my-oda2), remember that in step 4 of the creation process you mounted in both nodes.

Node 1:
[root@my-oda1 ~]# umount /cloudfs

Node 2:
[root@my-oda2 ~]# umount /cloudfs

2. Change to user grid and do the following:

su - grid

[grid@my-oda1 ~]$ asmcmd

ASMCMD> volinfo -G DATA cloudfs1
Diskgroup Name: DATA

         Volume Name: CLOUDFS1
         Volume Device: /dev/asm/cloudfs1-444
         State: ENABLED
         Size (MB): 204800
         Resize Unit (MB): 32
         Redundancy: HIGH
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /cloudfs

ASMCMD> voldelete -G DATA cloudfs1

ASMCMD> volinfo -G DATA cloudfs1
volume cloudfs1 not found in disk group DATA

ASMCMD> exit