Wednesday, March 6, 2013

Manually create acfs filesystem Oracle 11gr2

You can of course use asmca to create acfs filesystem or Oracle Grid control.
Sometimes it's handy to know te command's to create an acfs.
First you have to know the disk that are available.
There are diffirent ways to find this out.
For instance in asmcmd use lsdsk --candidate -p
I use sqlplus for this.

SQL> col PATH format a80
SQL> sel lines 300
SQL> select PATH,OS_MB,TOTAL_MB from  V$ASM_DISK
PATH                                                                                  OS_MB   TOTAL_MB
-------------------------------------------------------------------------------- ---------- ----------
/dev/mapper/BESSVC02_16_00033bp2                                                      16833          0
/dev/mapper/BOXSVC02_16_0002a3p2                                                      16833          0
/dev/mapper/BESSVC02_17_00033cp1                                                      17804          0
/dev/mapper/BESSVC02_17_00033ep1                                                      17804          0
/dev/mapper/BESSVC02_17_00033dp1                                                      17804          0
/dev/mapper/BOXSVC02_17_0002a5p1                                                      17804          0
/dev/mapper/BOXSVC02_17_0002a6p1                                                      17804          0
/dev/mapper/BOXSVC02_17_0002a4p1                                                      17804          0
/dev/mapper/BESSVC02_1_00033bp1                                                             980        980
/dev/mapper/BOXSVC02_1_0002a3p1                                                            980        980
/votediskseco2/odttcl21/nfs_votedisk_odttcl21                                                 1024       1024

The last 3 disks are used for the voting disks.
$ crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   9bf48f500c1b4fd5bf2b6dd35650081a (/dev/mapper/BOXSVC02_1_0002a3p1) [DGGRID]
 2. ONLINE   6673b45feb564f9fbfca2772012089b9 (/dev/mapper/BESSVC02_1_00033bp1) [DGGRID]
 3. ONLINE   35fc10a70e534fc7bf7931f65cf309f7 (/votediskseco2/odttcl21/nfs_votedisk_odttcl21) [DGGRID]
Located 3 voting disk(s).


First we have to create a diskgroup and as this is a stretch cluster we need
a failgroup

SQL>CREATE DISKGROUP DGGACFS1 NORMAL REDUNDANCY
         FAILGROUP BEST DISK
        '/dev/mapper/BESSVC02_16_00033bp2' SIZE 16833 M,
        '/dev/mapper/BESSVC02_17_00033cp1' SIZE 17804 M,
        '/dev/mapper/BESSVC02_17_00033dp1' SIZE 17804 M,
        '/dev/mapper/BESSVC02_17_00033ep1' SIZE 17804 M 
       FAILGROUP BOXT DISK
        '/dev/mapper/BOXSVC02_16_0002a3p2' SIZE 16833 M,
        '/dev/mapper/BOXSVC02_17_0002a4p1' SIZE 17804 M,
        '/dev/mapper/BOXSVC02_17_0002a5p1' SIZE 17804 M,
        '/dev/mapper/BOXSVC02_17_0002a6p1' SIZE 17804 M
ATTRIBUTE 'compatible.rdbms' = '11.2.0.0.0', 'compatible.asm' = '11.2.0.0.0', 'compatible.advm' = '11.2.0.0.0'
/
Now we have to create a volume. I'm  going to make one of 28GYG

SQL>alter diskgroup DGGACFS1 ADD VOLUME V_ODTTCL21 size 28G;

Before we make the acfs we need the know the name of the automatically created advm
volume device in /dev/asm

ls -altr /dev/asm
brwxrwx---  1 root asmadmin 252,      0 Mar  1 15:01 .asm_ctl_spec
brwxrwx---  1 root asmadmin 252,     10 Mar  1 15:01 .asm_ctl_vbg0
brwxrwx---  1 root asmadmin 252,     11 Mar  1 15:01 .asm_ctl_vbg1
brwxrwx---  1 root asmadmin 252,     12 Mar  1 15:01 .asm_ctl_vbg2
brwxrwx---  1 root asmadmin 252,     13 Mar  1 15:01 .asm_ctl_vbg3
brwxrwx---  1 root asmadmin 252,     14 Mar  1 15:01 .asm_ctl_vbg4
brwxrwx---  1 root asmadmin 252,     15 Mar  1 15:01 .asm_ctl_vbg5
brwxrwx---  1 root asmadmin 252,     16 Mar  1 15:01 .asm_ctl_vbg6
brwxrwx---  1 root asmadmin 252,     17 Mar  1 15:01 .asm_ctl_vbg7
brwxrwx---  1 root asmadmin 252,     18 Mar  1 15:01 .asm_ctl_vbg8
brwxrwx---  1 root asmadmin 252,      1 Mar  1 15:01 .asm_ctl_vdbg
brwxrwx---  1 root asmadmin 252,      2 Mar  1 15:01 .asm_ctl_vmb
brwxrwx---  1 root asmadmin 252, 192001 Mar  5 15:11 v_odttcl21-375

Now we create acfs and after that we register the mount pointt.

$ /sbin/mkfs -t acfs -b 4k /dev/asm/v_odttcl21-375 -n "V_ODTTCL21"
mkfs.acfs: version                   = 11.2.0.2.0
mkfs.acfs: on-disk version           = 39.0
mkfs.acfs: volume                    = /dev/asm/v_odttcl21-375
mkfs.acfs: volume size               = 30064771072
mkfs.acfs: Format complete.

-t acfs Specifies the type of file system on Linux. acfs designates the Oracle ACFS type
-b The default block size is 4K and is the only size supported in 11g Release 2 (11.2).
-n Specifies the name for the file system.

Now we register the mount point.

$ /sbin/acfsutil registry -f -a /dev/asm/v_odttcl21-375 /u01/app/oracle/user_projects
acfsutil registry: mount point /u01/app/oracle/user_projects successfully added to Oracle Registry

-a  Specifies to add the device, mount point, and associated moptions to the Oracle ACFS mount registry.
-f  This is used in combination with -a when the specified device might exist in the registry and the  administrator wants to replace the registration

so we now created the mountpoint /u01/app/oracle/user_projects.
oracle@test2008:CRS:/u01/app/oracle/user_projects
$ df -h .
Filesystem            Size  Used Avail Use% Mounted on
/dev/asm/v_odttcl21-375
                       28G  257M   28G   1% /u01/app/oracle/user_projects

And there you have it an acfs filesystem created manually without the gui.

Thats it.

No comments:

Post a Comment