Anda di halaman 1dari 36

Oracle ACFS in Oracle 11.

2
Concepts, Architecture, Deployment, Management and performance monitoring
Guenadi N. Jilevski: OCP 7,8,8i,9i,10g 11g OCM 9i

Oracle ACFS in Oracle 11.2


Features & Concepts

ACFS is General Purpose Cluster Multi OS file system integrated with Grid Infrastructure. (Linux,Windows, AIX, Solaris in Oracle 11.2 and Oracle 11.2.0.2) ACFS can be dynamically re-sized online. ACFS can be managed with ASMCA, ASMCMD, OEM, sqlplus, Linux/UNIX command line. ACFS is extend based. ACFS in build on top of ASM.

ACFS depends on ASM striping.


ACFS depends on ASM mirroring. ACFS is based on the ASM features. ( I/O and data balancing, disk group redundancy etc) ACFS is build on top of ASM volumes.

ASM volumes are created in a ASM disk group.


ASM volumes can be used for any FS ( do not assume FS is clustered FS if using ASM volumes). ASM Software stack ( ASM replaces the functionality of the Volume manager and FS)

ACFS Stack Application ACFS ASM/ADVM

Oracle Database

Third Party Cluster FS

Supported OS

Oracle ACFS in Oracle 11.2


ASM concepts ( ADVM/ACFS)
ASM Dynamic Volumes ASM volumes devices files presented by ADVM as block devices in /dev/asm/<Volume-name>-<number> OS kernel modules (Linux): oracleasm, oracleadvm, oracleoks oracleacfs

ASM files and volumes


User OS ASM instance ACFS ACFS Snapshot ASM Dynamic Volume Manager ASM Device File in /dev/asm/<Volume-name>-<number> ASM Dynamic Volumes

ASM ASM files Disk group (storage for files and volumes)

Oracle ACFS in Oracle 11.2


ASM for Files

ASM for ACFS volumes

ASM contains files ASM files are striped not disk volumes in case of LVM ASM mirrors extends based on redundancy level Online disk reconfiguration and rebalancing For fast mirror resynch tracks the changed extends. On extended clusters read from a preferred mirror extent that is local Cluster aware Part of Grid Infrastructure

ASM volumes are ALSO ASM files. Exposed to the OS via ADVM by /dev/asm/<Volumenumber>-<number>. Created once a volume is created. Inherit properties of disk group and behaves like ASM file. Rebalanced with add/remove disk to disk group. ADVM represents the ASM volume to OS. Behaves like any block devices.

Oracle ACFS in Oracle 11.2


ADVM processes in RAC ASM

VDBG Volume Driver Background forwards ASM requests to the dynamic volume manager driver. Death of VBDG kills ASM instance. VBGn Volume Background processes wait for requests from dynamic volume manager driver that need to be coordinated with ASM instance. Death of VBGn does NOT kill ASM instance. VMB Volume Membership Background coordinates cluster membership with ASM instance. Death of VMB does NOT kill ASM instance.

Oracle ACFS in Oracle 11.2


Restrictions

ADVM volumes can not be used as boot devices or root file system. ADVM volumes can not be used for RAW devices. ADVM volumes can not be used with ASMlib ADVM volumes can not be partitioned with fdisk. ADVM volumes are not to be used for Oracle Grid Infrastructure installation.

Oracle ACFS in Oracle 11.2


Space allocation for volumes in ASM disk group
VAU Volume Allocation Unit. Smallest allocation for a volume. On creation or extension of a volume space is allocated from an ASM disk group in multiples of VAU. Stripe is the number of Volume Extents within VAU. Can very from 1 to 8. Default is 4. If 1 than there is no striping. VAU=Stripe X Volume Extent VE - Volume Extent has a static value based on AU. For a default AU=1MB the extent size is 64MB. Each volume extent is allocated round-robin on different disks of a disk group.

Example: if stripe is 4 and AU is 1MB than VAU=4X64=256MB. Space is allocated in multiples of VAU. For a requested volume of 300MB a volume of 512MB consisting of 2 VAU will be created. In case of re-size space will be added in multiple of 256MB (VAU).

Oracle ACFS in Oracle 11.2


Space allocation within a volume

Volume is created with Stripe column number of stripes. Default 4. From 1 to 8. If 1 no striping. Stripe width size of each stripe. Default 128K. Range from 4K, 8K,16K,32K,64K, 128K, 256K, 512K,1M. Space for the volume is allocated as explained in VAU from ASM disk group. Space within the volume, when a file is created/resized on the ACFS, is allocated in chunks: size of VAU the size of the strip width round-robin across all of the VE in the VAU.

Oracle ACFS in Oracle 11.2


Steps to create an ACFS

Prerequisites:
compatible.asm>=11.2 compatible.advm>=11.2, compatible.asm>=compatible.advm Load ADVM drivers $GI_HOME/bin/acfsload start s as root on Oracle Restart only. For clustered Oracle GI in ASM RAC is automatically loaded.

Create the ASM volume Create the mount point Make the file system as root Mount the file system as root Register the file system. For the file system to persists reboot register it similarly to /etc/fstab with acfsutil. Registering the File System automatically mounts the file system on restart/reboot. GI owner for /sbin/acfsutil.

Oracle ACFS in Oracle 11.2


ASMCA

Oracle ACFS in Oracle 11.2


ASMCA

Note:
ACFSUTIL registers and mounts the ACFS. After restart ACFS will be mounted. Similar to /etc/fstab functionality DB Home FS=GP FS + Register Mount Point

Oracle ACFS in Oracle 11.2


Using sqlplus to
Create a volume ACFS_VOL2 with size 2GB. Verify the creation process

Oracle ACFS in Oracle 11.2


Using ASMCMD to Create a volume ACFS_VOL1 with size 1GB. Verify the creation process

Oracle ACFS in Oracle 11.2


Create the file system

Register the file system using acfsutil a. It mounts the ACFS automatically.

Oracle ACFS in Oracle 11.2


ACFS can be dynamically resized (expand/shrink) Example extend/u01/acfs with 2GB /sbin/acfsutil size +2G /u01/acfs

Oracle ACFS in Oracle 11.2


ACFS snapshot
Online read-only point in time copy of the ACFS ACFS store metadata in the ACFS volume for directories, filenames and pointers to file blocks. As a file on ACFS gets modified the original blocks are copied for recovery into the snapshot. Useful for :

Recovery as of the snapshot time Consistent backup of the files in the snapshot

You can have up to 63 snapshots per volume

Oracle ACFS in Oracle 11.2


Create snapshots: /sbin/acfsutil snap create <snap_name> <mountpoint> .ACFS directory created as a subdirectory to the ACFS with two subdirectories snap : store the snapshot data repl Delete snapshots: /sbin/acfsutil snap delete <snap_name> <mountpoint>

ACFS snapshot stores the data in .ACFS/snaps/<snapshot-name> directory Example:


Make a snapshot on ACFS file system Use the snapshot as a backup to restore ( from point in time copy) Oracle internally maintains the file integrity

Oracle ACFS in Oracle 11.2

Oracle ACFS in Oracle 11.2


Obtain ACFS info
[oracle@raclinux1 u03]$ /sbin/acfsutil info fs /u03 /u03 ACFS Version: 11.2.0.2.0 flags: MountPoint,Available mount time: Mon Jul 11 15:51:45 2011 volumes: 1 total size: 10737418240 total free: 10514767872 primary volume: /dev/asm/datavol-239 label: flags: Primary,Available,ADVM on-disk version: 39.0 allocation unit: 4096 major, minor: 252, 122369 size: 10737418240 free: 10514767872 ADVM diskgroup DATA ADVM resize increment: 268435456 ADVM redundancy: unprotected ADVM stripe columns: 4 ADVM stripe width: 131072 number of snapshots: 1 snapshot space usage: 32768 [oracle@raclinux1 u03]$ [oracle@raclinux1 u03]$ /sbin/acfsutil info fs /u03 /u03 ACFS Version: 11.2.0.2.0 flags: MountPoint,Available mount time: Mon Jul 11 15:51:45 2011 volumes: 1 total size: 10737418240 total free: 10514800640 primary volume: /dev/asm/datavol-239 label: flags: Primary,Available,ADVM on-disk version: 39.0 allocation unit: 4096 major, minor: 252, 122369 size: 10737418240 free: 10514800640 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@raclinux1 u03]$

Oracle ACFS in Oracle 11.2

Oracle ACFS in Oracle 11.2

Oracle ACFS in Oracle 11.2

Oracle ACFS in Oracle 11.2

Oracle ACFS in Oracle 11.2

Example Resize /u01/acfs3 from 2GB to 6GB

Oracle ACFS in Oracle 11.2

Oracle ACFS in Oracle 11.2

/sbin/acfsutil size system

[-|+]nnn[K|M|G|T|P] <path> - Resize file

Oracle ACFS in Oracle 11.2


ASM views
SQL> desc v$asm_volume Name Null? Type ----------------------------------------- -------- ---------------------------GROUP_NUMBER NUMBER VOLUME_NAME VARCHAR2(30) COMPOUND_INDEX NUMBER SIZE_MB NUMBER VOLUME_NUMBER NUMBER REDUNDANCY VARCHAR2(6) STRIPE_COLUMNS NUMBER STRIPE_WIDTH_K NUMBER STATE VARCHAR2(8) FILE_NUMBER NUMBER INCARNATION NUMBER DRL_FILE_NUMBER NUMBER RESIZE_UNIT_MB NUMBER USAGE VARCHAR2(30) VOLUME_DEVICE VARCHAR2(256) MOUNTPATH VARCHAR2(1024) SQL> SQL> select * from v$asm_acfsvolumes; FS_NAME VOL_DEVICE VOL_LABEL PRIMA TOTAL_MB FREE_MB -------------------- -------------------- -------------------- ----- ---------- ---------/u03 /dev/asm/datavol-239 TRUE 10240 9008.67969 /u04 /dev/asm/datavol1-23 TRUE 10240 10091.6523 9 /u06 29476.8047 /dev/asm/sec-351 TRUE 29696

SQL> select * from v$asm_filesystem; FS_NAME AVAILABLE BLOCK_SIZE STATE CORRU NUM_VOL TOTAL_SIZE TOTAL_FREE TOTAL_SNAP_SPACE_USAGE -------------------- --------- ---------- ------------- ----- ---------- ---------- ---------- --------------------/u03 11-JUL-11 4 AVAILABLE FALSE 1 10240 9008.67969 0 /u04 11-JUL-11 4 AVAILABLE TRUE 1 10240 10091.6523 .046875 /u06 11-JUL-11 4 AVAILABLE TRUE 1 29696 29476.8047 0 SQL>

Oracle ACFS in Oracle 11.2


ACFS information from asmcmd and acfcutil
ASMCMD> volinfo -G data -a Diskgroup Name: DATA Volume Name: DATAVOL Volume Device: /dev/asm/datavol-239 State: ENABLED Size (MB): 10240 Resize Unit (MB): 256 Redundancy: UNPROT Stripe Columns: 4 Stripe Width (K): 128 Usage: ACFS Mountpath: /u03 Volume Name: DATAVOL1 Volume Device: /dev/asm/datavol1-239 State: ENABLED Size (MB): 10240 Resize Unit (MB): 256 Redundancy: UNPROT Stripe Columns: 4 Stripe Width (K): 128 Usage: ACFS Mountpath: /u04 ASMCMD> exit [oracle@raclinux1 u03]$ /sbin/acfsutil info fs /u03 /u03 ACFS Version: 11.2.0.2.0 flags: MountPoint,Available mount time: Mon Jul 11 15:51:45 2011 volumes: 1 total size: 10737418240 total free: 9446285312 primary volume: /dev/asm/datavol-239 label: flags: Primary,Available,ADVM on-disk version: 39.0 allocation unit: 4096 major, minor: 252, 122369 size: 10737418240 free: 9446285312 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@raclinux1 u03]$

Oracle ACFS in Oracle 11.2

Oracle 11gR2 ACFS Replication New feature in 11.2.0.2 Designate a primary ACFS and DR standby ACFS asynchronously replicating changes across the network using Oracle Net. Capture changes into a log change file on the primary ACFS. Transfer the changes to similar log change file to the DR ACFS. After application on the DR ACFS changes are purged. Size properly ACFS to accommodate changes. Make sure that the network have sufficient bandwidth. Refer to the docs how to gather sizing statistics.

Oracle ACFS in Oracle 11.2


Oracle 11gR2 ACFS Replication New feature in 11.2.0.2 Limitations
There is presently only one standby site supported for a given primary files system. Only up to 8 nodes in a cluster can mount a file system. There is no support for ACFS file systems with encryption or ACFS security. compatible.ASM=11.2.0.2 compatible.ADVM=11.2.0.2

Prerequisites

Oracle ACFS in Oracle 11.2


Oracle 11gR2 ACFS Replication New feature in 11.2.0.2 Example: Primary ACFS based on volume prim mounted on /u05 and DR secondary ACFS based on volume sec mounted on /u06. ACFS needs to be mounted on only one node (primary). Use the following commends for mount dismount.
/bin/umount /dev/asm/prim-481 # Unmount on raclinux1,raclinux2 /bin/mount -t acfs /dev/asm/prim-481 /u05 # Mount on raclinux1,raclinux2 /bin/mount -t acfs /dev/asm/sec-351 /u06 # Mount on raclinux1,raclinux2 /bin/umount /dev/asm/sec-351 # Mount on on raclinux1,raclinux2 /sbin/mount.acfs -o all # Mount all on raclinux1, raclinux2

Oracle ACFS in Oracle 11.2


Oracle 11gR2 ACFS Replication New feature in 11.2.0.2
1. 2. 3.

Create a user on ASM with sysasm and sysdba privileges (oracle in the example) Create a service for the primary site (prim) and secondary site(sec). +ASMn will not work. Initiate the standby ACFS [root@raclinux1 bin]# /sbin/acfsutil repl init standby -p oracle/oracle@prim -c sec /u06
Where prim is the service created in bullet two and oracle is the user created in bullet one. Note that before starting the initiation the standby and primary site you need to have the ACFS mounted on only one node ,that is, you need to dismount the both /u05 and /u06 on raclinux2 node.

4.

Initiate the primary ACFS while as root ( In case of failure re-Initiate the standby)
[root@raclinux1 bin]# /sbin/acfsutil repl init primary -s oracle/oracle@sec -m /u06 -c prim /u05 validating the remote connection validating the remote connection validating the remote connection acfsutil repl init: ACFS-05050: remote connection cannot be established acfsutil repl init: ACFS-05052: standby replication site requires reinitialization [root@raclinux1 bin]# /sbin/acfsutil repl init standby -p oracle/oracle@prim -c sec /u06 [root@raclinux1 bin]# [root@raclinux1 bin]# /sbin/acfsutil repl init primary -s oracle/oracle@sec -m /u06 -c prim /u05 remote connection has been established Registering with user specified service name-prim waiting for the standby replication site to initialize waiting for the standby replication site to initialize The standby replication site is initialized. ACFS replication will begin. [root@raclinux1 bin]#

5.

Step 4 starts the processes for ACFS replication and we can use already the ACFS replication. The replication can be validated and configuration checked with the following commands.

Oracle ACFS in Oracle 11.2


Oracle 11gR2 ACFS Replication New feature in 11.2.0.2

Validation
[root@raclinux1 bin]# /sbin/acfsutil repl info -c -v /u06 Site: Standby Standby status: Online Standby mount point: /u06 Standby Oracle Net service name: sec Primary mount point: /u05 Primary Oracle Net service name: PRIM Primary Oracle Net alias: oracle/****@prim Replicated tags: Log compression: Off Debug log level: 0 [root@raclinux1 bin]# [root@raclinux1 bin]# /sbin/acfsutil repl bg info /u06 Resource: ora.repl.transport.sec.sec.acfs Target State: ONLINE Current State: ONLINE on raclinux1 Resource: ora.repl.main.sec.sec.acfs Target State: ONLINE Current State: ONLINE on raclinux1 Resource: ora.repl.apply.sec.sec.acfs Target State: ONLINE Current State: ONLINE on raclinux1 [root@raclinux1 bin]#

Mount primary and standby ACFS on all nodes of the cluster.

Oracle ACFS in Oracle 11.2


Oracle 11gR2 ACFS Replication New feature in 11.2.0.2

Managing Replication Check replication configuration & statistics # /sbin/acfsutil repl info -c -v /u06 # /sbin/acfsutil repl info -c -v /u05 # /sbin/acfsutil repl info -s -v /u05 Start & Stop replication : Although ACFS replication is automatically started after initiation and registered with Grid Infrastructure as a resource for automatic restart the acfsutil repl bg command can be used to start and stop the background processes and daemons implementing the replication. # /sbin/acfsutil repl bg stop /u06 # /sbin/acfsutil repl bg start /u06 Suspending and resuming ACFS replication. ACFS replication can be manually suspended and resumed. Prior to pausing the replication the sync must be executed. Pausing and resuming ACFS replication are done using the acfsutl repl [ pause | resume] /standby_fs command. Here we are going to suspend replication, resume replication create a file in the primary ACFS to synchronize with the standby ACFS file system.

Oracle ACFS in Oracle 11.2


Oracle 11gR2 ACFS Replication New feature in 11.2.0.2
# sync # /sbin/acfsutil repl pause /u06 # /sbin/acfsutil repl info -s -v /u05 Fri Dec 3 14:49:52 2010 Fri Dec 3 16:44:18 2010 Data replicated: 5.01GB From writes: 5.01GB From memory mapped updates: 0.00GB File operations replicated: 11 ...................................... # # /sbin/acfsutil repl resume /u06 ## Create another 1GB file on /u05 # /sbin/acfsutil repl sync /u05 # /sbin/acfsutil repl sync apply /u05 # /sbin/acfsutil repl info -s -v /u05 Fri Dec 3 14:49:52 2010 Fri Dec 3 16:56:55 2010 Data replicated: 6.01GB From writes: 6.01GB From memory mapped updates: 0.00GB File operations replicated: 19 ........................................ #

Oracle ACFS in Oracle 11.2

Q &A

Anda mungkin juga menyukai