ORACLE ACFS : Create ACFS volume from an ASM diskgroup
Steps:-
1. Create a volume. (volcreate asm_vol1)
2. get the device name of that volume. (volinfo /dev/asm/asm_vol1-15)
3. covert that device to ACFS volume.(mkfs)
4. register the ACFS in OCR (registry) *To specify, in which OS mount point, we are going to mount the above created ACFS file system).
5. do the actual mount in OS level (mount)
6. change the ownership (oracle:dba)
Connect sql*plus with sysasm:
$ sqlplus / as sysasm
Add volume by "alter diskgroup":
SQL> alter diskgroup DISK03 add volume 'asm_vol1' size 5G;Check :
Diskgroup altered.
SQL> SELECT dg.name AS diskgroup, v.volume_name, v.bytes_read, v.bytes_written FROM V$ASM_DISKGROUP dg, V$ASM_VOLUME_STAT v WHERE dg.group_number = v.group_number;Or... use "asmcmd"
DISKGROUP VOLUME_NAME BYTES_READ BYTES_WRITTEN
------------------------------ ------------------------------ ---------- -------------
DISK03 ASM_VOL1 0 0
SQL> SELECT dg.name AS diskgroup, v.volume_name, v.volume_device, v.mountpath,v.state FROM V$ASM_DISKGROUP dg, V$ASM_VOLUME v WHERE dg.group_number = v.group_number;
DISKGROUP VOLUME_NAM VOLUME_DEVICE MOUNTPATH STATE
---------- ---------- ------------------------------ ------------------------------ --------
DISK03 ASM_VOL1 /dev/asm/asm_vol1-15 DISABLED
ASMCMD> volcreate -G DISK03 -s 5G asm_vol1- Enable "asm_vol1' volume
ASMCMD> volstat
DISKGROUP NUMBER / NAME: 3 / DISK03
---------------------------------------
VOLUME_NAME
READS BYTES_READ READ_TIME READ_ERRS
WRITES BYTES_WRITTEN WRITE_TIME WRITE_ERRS
-------------------------------------------------------------
ASM_VOL1
0 0 0 0
0 0 0 0
ASMCMD> volinfo -G DISK03 asm_vol1
Diskgroup Name: DISK03
Volume Name: ASM_VOL1
Volume Device: /dev/asm/asm_vol1-15
State: DISABLED
Size (MB): 5120
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage:
Mountpath:
SQL> !ls -l /dev/asm/asm_vol1-15Or... use "asmcmd"
ls: /dev/asm/asm_vol1-15: No such file or directory
SQL> alter diskgroup DISK03 enable volume 'asm_vol1';
Diskgroup altered.
SQL> !ls -l /dev/asm/asm_vol1-15
brwxrwx--- 1 root osasm 252, 7681 Sep 4 11:26 /dev/asm/asm_vol1-15
SQL> SELECT dg.name AS diskgroup, v.volume_name, v.volume_device, v.mountpath,v.state FROM V$ASM_DISKGROUP dg, V$ASM_VOLUME v WHERE dg.group_number = v.group_number;
DISKGROUP VOLUME_NAM VOLUME_DEVICE MOUNTPATH STATE
---------- ---------- ------------------------------ ------------------------------ --------
DISK03 ASM_VOL1 /dev/asm/asm_vol1-15 ENABLED
$ ls -l /dev/asm/asm_vol1-15- Register mount point
ls: /dev/asm/asm_vol1-15: No such file or directory
ASMCMD> volenable -G DISK03 asm_vol1
ASMCMD> volinfo -G DISK03 asm_vol1
Diskgroup Name: DISK03
Volume Name: ASM_VOL1
Volume Device: /dev/asm/asm_vol1-15
State: ENABLED
Size (MB): 5120
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage:
Mountpath:
$ ls -l /dev/asm/asm_vol1-15
brwxrwx--- 1 root osasm 252, 7681 Sep 4 11:43 /dev/asm/asm_vol1-15
$ mkdir -p /oracle/product/acfsmounts/disk03_asm_vol1found error... so(make acfs)
$ su - root
# acfsutil registry -a -f /dev/asm/asm_vol1-15 /oracle/product/acfsmounts/disk03_asm_vol1
acfsutil registry: mount point /oracle/product/acfsmounts/disk03_asm_vol1 successfully added to Oracle Registry
# mount.acfs -o all
mount.acfs: ACFS-00591: error found in volume disk header
mount.acfs: ACFS-02037: File system not created on a Linux system. Cannot mount.
# mkfs.acfs -f /dev/asm/asm_vol1-15And mount:
mkfs.acfs: version = 11.2.0.1.0.0
mkfs.acfs: on-disk version = 39.0
mkfs.acfs: volume = /dev/asm/asm_vol1-15
mkfs.acfs: volume size = 5368709120
mkfs.acfs: Format complete.
# mount.acfs -o allOr mount.acfs /dev/asm/asm_vol1-15 /oracle/product/acfsmounts/disk03_asm_vol1/
Check...
# df- Test create file
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/asm/asm_vol1-15 5242880 47512 5195368 1% /oracle/product/acfsmounts/disk03_asm_vol1
# cd /oracle/product/acfsmounts/disk03_asm_vol1- Check Again
# ls -la
drwxr-xr-x 5 root root 4096 Sep 4 11:54 .ACFS
# touch file.txt
# ls file.txt
file.txt
SQL> SELECT dg.name AS diskgroup, v.volume_name, v.volume_device, v.mountpath,v.state FROM V$ASM_DISKGROUP dg, V$ASM_VOLUME v WHERE dg.group_number = v.group_number;Or... use"asmcmd"
DISKGROUP VOLUME_NAM VOLUME_DEVICE MOUNTPATH STATE
---------- ---------- ------------------------------ ------------------------------------------ --------
DISK03 ASM_VOL1 /dev/asm/asm_vol1-15 /oracle/product/acfsmounts/disk03_asm_vol1 ENABLED
SQL> SELECT dg.name AS diskgroup, v.volume_name, v.bytes_read, v.bytes_written FROM V$ASM_DISKGROUP dg, V$ASM_VOLUME_STAT v WHERE dg.group_number = v.group_number;
DISKGROUP VOLUME_NAM BYTES_READ BYTES_WRITTEN
---------- ---------- ---------- -------------
DISK03 ASM_VOL1 372736 11745280
ASMCMD> volinfo -G DISK03 asm_vol1
Diskgroup Name: DISK03
Volume Name: ASM_VOL1
Volume Device: /dev/asm/asm_vol1-15
State: ENABLED
Size (MB): 5120
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage: ACFS
Mountpath: /oracle/product/acfsmounts/disk03_asm_vol1
ASMCMD> volstat
DISKGROUP NUMBER / NAME: 3 / DISK03
---------------------------------------
VOLUME_NAME
READS BYTES_READ READ_TIME READ_ERRS
WRITES BYTES_WRITTEN WRITE_TIME WRITE_ERRS
-------------------------------------------------------------
ASM_VOL1
416 372736 6 0
2941 11745280 242 0
No comments:
Post a Comment