Oracle acfs in oracle 11

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

description

Oracle ACFS is a general purpose portable cluster file system build on the enhanced ASM available since Oracle 11.2 and benefiting from the existing ASM mirroring and striping leading to performance and fault tolerance. In the presentation you will look at the concept and the architecture of ACFS. You will see how to use familiar tools such as sqlplus, asmca, asmcmd and OEM DC to configure, implement and manage ACFS. The presentation will provide an idea for deployment of ACFS for Snapshots and replications. Being fully integrated with ASM, ASM views can be used to monitor performance and usage.

Transcript of Oracle acfs in oracle 11

Page 1: Oracle acfs in oracle 11

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

Page 2: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2Features & 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).

Accessible via NAS protocols (NFS, CIFS), POSIX, X/OPEN compliant for Linux/Unix.

ASM Software stack ( ASM replaces the functionality of the Volume manager and File System)

ACFS Stack

Application

Oracle Database

ACFS Third Party Cluster FS

ASM/ADVM

Supported OS

Page 3: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

ASM files and volumes

OS level ASM instance

OS kernel level

ACFSACFS Snapshot

ASM Dynamic Volume ManagerASM Device File in /dev/asm/<Volume-name>-

<number>

ASMDisk group (storage for files and volumes)

ASM files ASM Dynamic Volumes

ASM concepts ( ADVM/ACFS) •ASM Dynamic Volumes•ASM volumes devices files in /dev/asm/<Volume-name>-<number> presented by ADVM as block devices • OS kernel modules (Linux): oracleasm, oracleadvm, oracleoks and oracleacfs• ASM layers are transparent to OS file system commands. Only files and directories created in ACFS and ACFS snapshots are visible.

Page 4: Oracle acfs in oracle 11

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/<Volume-number>-<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.

Page 5: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

ADVM processes in RAC ASM

VDBG – Volume Driver Background forwards ASM requests to the dynamic volume manager driver (kernel). Death of VDBG kills ASM instance.

VBGn – Volume Background processes wait for requests from dynamic volume manager driver (kernel) 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.

Page 6: Oracle acfs in oracle 11

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 volume devices can not be used for multi-

pathing.ADVM volumes can not be used with ASMlib. Do

not layer ASM over ASM.ADVM volumes can not be partitioned with fdisk.ADVM volumes are not to be used for Oracle Grid

Infrastructure installation.

Page 7: Oracle acfs in oracle 11

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 400MB 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).

Page 8: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

Space allocation within a volumeVolume 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.

Page 9: Oracle acfs in oracle 11

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 or GI owner Mount the file system as root unless using /sbin/acfsutil as

GI owner. 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 and manage it as CRS resource. GI owner for /sbin/acfsutil.

Page 10: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

ASMCA

Page 11: Oracle acfs in oracle 11

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

Page 12: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2Using sqlplus to

• Create a volume ACFS_VOL2 with size 2GB.• Verify the creation process

Page 13: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

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

Page 14: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

Create the file system

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

Page 15: Oracle acfs in oracle 11

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

Page 16: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

ACFS snapshotOnline read-only point in time copy of the

ACFSACFS 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

Page 17: Oracle acfs in oracle 11

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>

Page 18: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2ACFS snapshot stores the data in .ACFS/snaps/<snapshot-name> directoryExample:• 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

Page 19: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2Obtain 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: 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@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]$

Page 20: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

Page 21: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

Page 22: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

Page 23: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

Page 24: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2Example Resize /u01/acfs3 from 2GB to 6GB

Page 25: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

Page 26: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

/sbin/acfsutil size [-|+]nnn[K|M|G|T|P] <path> - Resize file system

Page 27: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2ASM 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 /dev/asm/sec-351 TRUE 29696 29476.8047

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>

Page 28: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

[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]$

ASMCMD> volinfo -G data -aDiskgroup 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

ACFS information from asmcmd and acfcutil

Page 29: Oracle acfs in oracle 11

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.

Page 30: Oracle acfs in oracle 11

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.Prerequisites

◦ compatible.ASM=11.2.0.2 ◦ compatible.ADVM=11.2.0.2

Page 31: Oracle acfs in oracle 11

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) during setup.

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

Page 32: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2 Oracle 11gR2 ACFS Replication – New feature in 11.2.0.2

1. Create a user on ASM with sysasm and sysdba privileges (oracle in the example)2. Create a service for the primary site (prim) and secondary site(sec). +ASMn will not

work.3. 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 /u05validating the remote connectionvalidating the remote connectionvalidating the remote connectionacfsutil repl init: ACFS-05050: remote connection cannot be establishedacfsutil 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 /u05remote connection has been establishedRegistering with user specified service name-primwaiting for the standby replication site to initializewaiting for the standby replication site to initializeThe 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.

Page 33: Oracle acfs in oracle 11

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 /u06Site: StandbyStandby status: OnlineStandby mount point: /u06Standby Oracle Net service name: secPrimary mount point: /u05Primary Oracle Net service name: PRIMPrimary Oracle Net alias: oracle/****@primReplicated tags:Log compression: OffDebug log level: 0[root@raclinux1 bin]# [root@raclinux1 bin]# /sbin/acfsutil repl bg info /u06Resource: ora.repl.transport.sec.sec.acfsTarget State: ONLINECurrent State: ONLINE on raclinux1Resource: ora.repl.main.sec.sec.acfsTarget State: ONLINECurrent State: ONLINE on raclinux1Resource: ora.repl.apply.sec.sec.acfsTarget State: ONLINECurrent State: ONLINE on raclinux1[root@raclinux1 bin]#

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

Page 34: Oracle acfs in oracle 11

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.

Page 35: Oracle acfs in oracle 11

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.01GBFrom writes: 5.01GBFrom memory mapped updates: 0.00GBFile 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.01GBFrom writes: 6.01GBFrom memory mapped updates: 0.00GBFile operations replicated: 19........................................#

Page 36: Oracle acfs in oracle 11

Oracle ACFS in Oracle 11.2

Q & A