Top Banner
Yury & Oracle Community Sharing experience implementing Direct NFS
28
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sharing experience implementing Direct NFS

Yury & Oracle Community

Sharing experience implementing Direct NFS

Page 2: Sharing experience implementing Direct NFS

© 2012 – Pythian

Contributors list From Twitter John Piwowar (@jpiwowar)Leighton L. Nelson (@leight0nn)Kevin Closson (@kevinclosson)Guenadi Jilevski (@gjilevski)Simon Haslam (@simon_haslam)neto from Brazil (@netofrombrazil)Frits Hoogland (@fritshoogland)Martin Bach (@MartinDBA)Gwen (Chen) Shapira (@gwenshap)Avi Miller (@Djelibeybi)Marcin Przepiorowski (@pioro)Arup Nanda (@arupnanda)Martin Berger (@martinberx)Martin Bach @MartinDBALook in slides notes for TW discussions

https://dl.dropbox.com/u/28277005/DNFS%20exp%2004.pptx

Page 3: Sharing experience implementing Direct NFS

© 2012 – Pythian

Why Pythian● Recognized Leader:

● Global industry leader in data infrastructure managed services and consulting with expertise in Oracle, Oracle Applications, Microsot SQL Server, MySQL, big data and systems administration

● Work with over 200 multinational companies such as Forbes.com, Fox Sports, Nordion and Western Union to help manage their complex IT deployments

● Expertise:● One of the world’s largest concentrations of dedicated, full-time DBA

expertise. Employ 8 Oracle ACEs/ACE Directors● Hold 7 Specializations under Oracle Platinum Partner program, including

Oracle Exadata, Oracle GoldenGate & Oracle RAC

● Global Reach & Scalability:● 24/7/365 global remote support for DBA and consulting, systems

administration, special projects or emergency response

Page 4: Sharing experience implementing Direct NFS

© 2012 – Pythian

Google: Yury Oracle

Twitter, LinkedIn, Blog, Slideshare,YouTube

Oracle ACE (RAC SIG international chair, Sydney Oracle Meetups)

Oracle Certified MasterOracle DBA with 15+ years experience

Why Yury[phone|email]

I like my job, I like what I do, I like to share knowledge, I like to help others to share knowledge, I like to learn, I like my job.

Page 5: Sharing experience implementing Direct NFS

© 2012 – Pythian

Why Direct NFS

Network IO

SPEEDEasy to use +RAC

Page 6: Sharing experience implementing Direct NFS

© 2012 – Pythian

Load Profile Per Second~~~~~~~~~~~~ --------------- DB Time(s): 19.6 DB CPU(s): 0.8 Logical reads: 12,219.1

Physical reads: 12,141.31.7ms

Load Profile Per Second~~~~~~~~~~~~ --------------- DB Time(s): 19.6 DB CPU(s): 5.2 Logical reads: 38,277.5

Physical reads: 38,156.10.5ms

k NFS d NFS

100% 300%Oracle VM, PIO SLOB test, ram disk mounted via 127.0.0.1 backloop device, other bottlenecks but kernel have been excluded, “db file sequential read” aka

random readsDirect storage 0.36 ms

Page 7: Sharing experience implementing Direct NFS

© 2012 – Pythian

It isn’t about data files only !File Type Supported

Control file YES

Data file YES

Redo log file YES

Archive/Flashback log file YES

Backup files YES

Temp file YES

Datapump dump file YES blog “Direct NFS speeds up Data Pump”

OCR files NO

spfile YES

passwd file YES

ASM files YES blog “Reasons for using ASM on NFS”

Voting files NO

Audit files NO

Database trace files NO

External tables NO

Direct NFS: FAQ [ID 954425.1]

RDBMS file type support matrix for Direct NFS client

Page 8: Sharing experience implementing Direct NFS

Direct NFS Concepts

Page 9: Sharing experience implementing Direct NFS

© 2012 – Pythian

IO ClientOracleprocess

kernel

File B

IO ClientOracleprocess

IO ClientOracleprocess

IO ClientOracleprocess

NFS service

IO ClientOracleprocess

IO ClientOracleprocess

k NFS d NFS

File CFile A File B File CFile A

NFS service

NFS client NFS client NFS client

Simplified

NFS client

Kern

el m

ode

Use

r

use

r m

ode

kern

el

Page 10: Sharing experience implementing Direct NFS

© 2012 – Pythian

dNFS Setup simple version

mount NFS volumes

cd $ORACLE_HOME/rdbms/libmake -f ins_rdbms.mk dnfs_on

ls -l $ORACLE_HOME/lib/lib*od*11.so-rw-r--r--. 1 oracle oinstall 60431 Sep 17 2011 $OH/lib/libnfsodm11.so << dnfs-rw-r--r--. 1 oracle oinstall 60431 Oct 20 19:45 $OH/lib/libodm11.so # Oracle used-rw-r--r--. 1 oracle oinstall 12259 Sep 17 2011 $OH/lib/libodmd11.so << no dnfs

http://www.pythian.com/news/34425/oracle-direct-nfs-how-to-start/odm – stands for Oracle Disk Manager

Oracle processes use /etc/mtab to access NFS settings

Page 11: Sharing experience implementing Direct NFS

© 2012 – Pythian

How can the dNFS usage be verified?Direct NFS: FAQ [ID 954425.1]

1. Just after the initialization parameters are listed in the alert log, you will see the following entry

Oracle instance running with ODM: Oracle Direct NFS ODM Library Version 2.0

2. Along with the message from the alert log, this query on v$dnfs_servers ensures that dNFS is truly being used (returns !=0 value):

select count(*) from v$dnfs_servers

( sometimes it isn’t true ;)

Page 12: Sharing experience implementing Direct NFS

© 2012 – Pythian

How can the dNFS usage be verified?In my experience, the easiest and most reliable way is

1. lsof –p < dbw pid ># DNFS OFFlsof -p 725 | grep data01.dbforacle 725 oracle 262u REG ... /nfsimp/data01.dbf (192.168.51.21:/u01)

# DNFS ONlsof -p 6540 | grep 192.168.51.21oracle 6540 oracle 32u IPv4 ... TCP dbhost:26171->nfsserver:nfs (ESTABLISHED)

2. alert.logDirect NFS: channel id [0] path [IPnfs] to filer [KUKARACHA] via local [IPdb] is UPDirect NFS: channel id [1] path [IPnfs] to filer [KUKARACHA] via local [IPdb] is UP

Page 13: Sharing experience implementing Direct NFS

Direct NFS advanced implementation

Page 14: Sharing experience implementing Direct NFS

© 2012 – Pythian

dNFS setup – is documentedStep by Step - Configure Direct NFS Client on Linux [ID 762374.1]Step by Step - Configure Direct NFS Client on Windows [ID 1468114.1]=======================================================Set filesystemio_options at least to directIO. ALL database files.

● PART A -- SETTING UP THE NFS SERVER ON LINUX...iv) Make sure the NFS server will get started during boot of this server....

MOUNTING NFS ON THE CLIENT NODE / CLUSTER NODES ON LINUX...stgasm:/oraclenfs /oradata1 nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600 0 0# Please contact your NAS vendor for NFS mount option recommendations....

● PART B -- Configure Direct NFS Client (DNFS)i) Configure oranfstab file...Direct NFS Client can use a new configuration file or the mount tab file (/etc/mtab on Linux) to determine the mount point settings for NFS storage devices....

● PART C -- DNFS Workshop

Oracle® Grid Infrastructure Installation Guide11g Release 2 (11.2) for Linux3 Configuring Storage for Grid Infrastructure for a Cluster and Oracle RAC

Page 15: Sharing experience implementing Direct NFS

© 2012 – Pythian

4 TCP/IP connections

Switch

Switch

IO ClientOracleprocess

NFS

serv

ice

dNFS oranfstab

NIC

`N

ICN

ICN

IC

RA

C N

od

e 2

NIC

NIC

NIC

NIC

File B

File C

File A

NIC

NIC

NIC

NIC

RA

C N

od

e 1

1Gbit

1Gbit

1Gbit

1Gbit

1Gbit

1Gbit

1Gbit

1Gbit

1Gbit

1Gbit

4 Gbit

Rou

nd

R

ob

in

IO ClientOracleprocess

= Performance, Scalability, High Availability, Cost Savings

Page 16: Sharing experience implementing Direct NFS

© 2012 – Pythian

dNFS oranfstab (things to remember)

●You can live without it (simple implementations)● DB Hangs When DNFS is Enabled on UEK kernel [ID 1460787.1]

●You may get confused reading though documentations

●Enabling Direct NFS Client Oracle Disk Manager Control of NFS● Server, Local, Path, Export, Mount, Mnt_timeout, Dontroute

● Server – any name you like (alias for a channel)● Local, Path - You can specify other IPs than in mtab● Export, Mount – local and remote mount points● Mnt_timeout – sessions drops a connection after the timeout● Dontroute – don’t use OS routeing table to send TCP/IP packages

Oracle Direct NFS configuration file explainedhttp://www.pythian.com/news/37259/oracle-direct-nfs-configuration-file-explained/

Page 17: Sharing experience implementing Direct NFS

© 2012 – Pythian

dNFS oranfstab (things to remember)

●Direct NFS searches for mount entries in the following order1. $ORACLE_HOME/dbs/oranfstab # an instance specific2. /etc/oranfstab3. /etc/mtab

●You must restart an instance after adjusting oranfstab file

Page 18: Sharing experience implementing Direct NFS

Troubleshooting & War stories

Page 19: Sharing experience implementing Direct NFS

© 2012 – Pythian

One DNFS disadvantage

●It is relatively difficult to troubleshoot

●You will not find many DNFS messages in alert.log or trace files

●Sometimes Oracle SILINTLY switches from dNFS to kNFS

●This sections gives you useful troubleshooting hints

Page 20: Sharing experience implementing Direct NFS

© 2012 – Pythian

Don’t mix old and new methods●Old methodcd $ORACLE_HOME/lib

mv libodm11.so libodm11.so_bak

ln -s libnfsodm11.so libodm11.so

●New/current methodmake -f ins_rdbms.mk dnfs_on

●If you enable dNFS using one method disable it the same way

Page 21: Sharing experience implementing Direct NFS

© 2012 – Pythian

Magic words to rememberOracle® Grid Infrastructure Installation Guide 11g Release 2 (11.2) for Linux

If Oracle Database cannot open an NFS server using Direct NFS, then Oracle Database SILENTLY uses the platform operating system kernel NFS client.

1. lsof –p < dbw pid ># dNFS OFFlsof -p 725 | grep data01.dbforacle 725 oracle 262u REG ... /nfsimp/data01.dbf (192.168.51.21:/u01)

# dNFS ONlsof -p 6540 | grep 192.168.51.21oracle 6540 oracle 32u IPv4 ... TCP dbhost:26171->nfsserver:nfs (ESTABLISHED)

Page 22: Sharing experience implementing Direct NFS

© 2012 – Pythian

NFS server reserved ports restrictionOracle® Grid Infrastructure Installation Guide 11g Release 2 (11.2) for Linux

Some NFS file servers require NFS clients to connect using reserved ports. If your filer is running with reserved port checking, then you must disable it for Direct NFS to operate. To disable reserved port checking, consult your NFS file server documentation.

In a simple NFS implementation that means:

cat /etc/exports

< dir > IP(...,insecure,...)

Page 23: Sharing experience implementing Direct NFS

© 2012 – Pythian

dNFS: wtmax = /proc/fs/nfsd/max_block_sizeOracle® Grid Infrastructure Installation Guide 11g Release 2 (11.2) for Linux

Caution: Direct NFS will not serve an NFS server with write size values (wtmax) less than 32768.

...ALTER DATABASE OPENDirect NFS: attempting to mount /u02 on filer KUKARACHA2 defined in oranfstabDirect NFS: channel config is:channel id [0] local [192.168.51.30] path [192.168.51.21]Direct NFS: mount complete dir /u02 on KUKARACHA2 mntport 963 nfsport 2049Direct NFS: Invalid filer wtmax 525232 on filer KUKARACHA2Direct NFS: Filer wtmax 525232 must be an even multiple of 32768Thread 1 opened at log sequence 26...

Page 24: Sharing experience implementing Direct NFS

© 2012 – Pythian

dNFS: wtmax = /proc/fs/nfsd/max_block_sizePythian’s dNFS related blog posts

root@nfsfiler01 sysconfig# cat /proc/fs/nfsd/max_block_size524288root@nfsfiler01 sysconfig# echo 1048576 > /proc/fs/nfsd/max_block_sizeroot@nfsfiler01 sysconfig# cat /proc/fs/nfsd/max_block_size1048576

...ALTER DATABASE OPENDirect NFS: attempting to mount /u02 on filer KUKARACHA2 defined in oranfstabDirect NFS: channel config is: channel id [0] local [192.168.51.30] path [192.168.51.21]Direct NFS: mount complete dir /u02 on KUKARACHA2 mntport 883 nfsport 2049Direct NFS: channel id [0] path [192.168.51.21] to filer [KUKARACHA2] via local [192.168.51.30] is UPDirect NFS: channel id [1] path [192.168.51.21] to filer [KUKARACHA2] via local [192.168.51.30] is UPBeginning crash recovery of 1 threads...

Page 25: Sharing experience implementing Direct NFS

© 2012 – Pythian

init.ora events to set●If you are confused and need more information then set the following events and access NFS files

event "19392 trace name context forever, level 8" # kgnfs

event "19394 trace name context forever, level 8" # skgnfs

event "19396 trace name context forever, level 2" # kgodm

event="19398 trace name context forever, level 128"

alter system set event="19392 trace name context forever, level 8","19394 trace name context forever, level 8","19396 trace name context forever, level 2","19398 trace name context forever, level 128" scope=spfile;

● Read trace file, search MOS/Google, ask others ( Yury ;)

Page 26: Sharing experience implementing Direct NFS

© 2012 – Pythian

ReferencesDirect NFS: FAQ [ID 954425.1]Example About How To Setup DNFS On Oracle Release 11.2 [ID 1452614.1]How to Setup Direct NFS client multipaths in same subnet [ID 822481.1]DB Hangs When DNFS is Enabled on UEK kernel [ID 1460787.1]DB hang and ORA-600 [2116] errors when enabling DNFS [ID 1484422.1]DNFS CANNOT MOUNT FILESYSTEM AND DATABASE FAILED WITH ORA-600 [2116] AFTER A REBOOT OF SERVER DUE TO POWER FAILURE [ID 1480788.1]DATABASE STARTUP HANGS AT MOUNTING CONTROLFILE WHEN DNFS IS ENABLED. [ID 971406.1]Database Startup Failed with "Direct NFS: please check that oradism is setuid“ [1430654.1]ORA-600 [2116] Using The Veritas Odm Lib Oracle Fails To Mount [ID 418603.1]OERI [2116] [900] during database mount with > 13 instances [ID 9790947.8]TESTCASE Step by Step - Configure Direct NFS Client (DNFS) on Windows [ID 1468114.1]Database Alert Log entries: Direct NFS: Failed to set socket buffer size.wtmax=[1048576] rtmax=[1048576], errno=-1 [ID 1352886.1]

@kevinclosson Oracle 11g, Direct NFS Client, An Oracle White Paper + http://bit.ly/QU3w82@leight0nn http://blogs.griddba.com/2012/02/direct-nfs-speeds-up-data-pump.html @rene_kundersma https://blogs.oracle.com/XPSONHA/entry/using_dnfs_for_test_purposes@yvelikanov http://www.pythian.com/news/tag/dnfs/

Page 27: Sharing experience implementing Direct NFS

© 2012 – Pythian

Your best friends OR things to keep in mind

Network IO

SPEED

efficiency

Page 28: Sharing experience implementing Direct NFS

© 2012 – Pythian

Thank you and Q&A

http://www.pythian.com/news/

http://www.facebook.com/pages/The-Pythian-Group/163902527671

@pythian

http://www.linkedin.com/company/pythian

1-877-PYTHIAN

[email protected]

To contact us…

To follow us…

@pythianjobs