Oracle Direct NFS - Oracle 11g

Oracle Database 10g introduced ASM by allowing direct IO to the database files. In Oracle Database 11g,Oracle provides a similar enhancement to NFS.Oracle Database 11g pioneers the database world with Direct Network File System (Direct NFS).Oracle Direct NFS is an NFS client built directly into the database kernel.With Oracle Direct NFS,the database kernel performs all the tuning processes automatically.DBAs and system administrators are no longer responsible for being intimate with all the tuning parameters associated with NFS.

Oracle RAC implementations on NFS are a common industry practice.Debates about implementing RAC on NFS vs.ASM have become a hot topic among database architects.The debate centers on cost, performance,and manageability.NFS on appliances such as Network Appliance has become a trend for RAC implementations.The introduction of Oracle Database 11g Direct NFS fuels the fire for NFS implementations.

For improved NFS performance,Oracle recommends the Direct NFS client that ships with Oracle Database 11g.Instead of using the operating system NFS client, you can access NFS version 3 servers directly using an Oracle internal Direct NFS client. If Oracle’s Direct NFS is not able to open the NFS server,Oracle will utilize the operating system’s NFS client as specified in /etc/fstab and post an error message in the alert log.

Set Up Direct NFS

Oracle Direct NFS setup involves manipulating the oranfstab file.The oranfstab file can reside in several locations.Oracle will always check the $ORACLE_HOME/dbs directory first.If the oranfstab file does not exist, it will search in the /etc directory.If an oranfstab file does not exist, Oracle will use the operating system /etc/mtab file. Oracle’s Direct NFS client looks for mount point settings in the following order:

  • $ORACLE_HOME/dbs/oranfstab
  • /etc/oranfstab
  • /etc/mtab

If there are duplicate entries in these files,Oracle Direct NFS client will use the first entry found.

To implement Oracle Direct NFS, an existing NFS mount point must already exist.The mount options for NFS are irrelevant since Oracle Direct NFS will override and configure settings optimally. The NFS mount options in the /etc/fstab file for this particular example are as follows:

nas103:/apps/oracle/share /oradata nfs
rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,
actimeo=0,vers=3,timeo=600

It is important to note that in order to enable Direct NFS, you must disable reserved port settings on the NFS server.

Oracle uses the Oracle Disk Manager (ODM) to control NFS.To enable Direct NFS, you must replace the standard ODM driver with the ODM NFS library.For the client to work, you need to shut down the database and create a symbolic link from the standard ODM library to point to the NFS ODM library.Before you create the symbolic link, you will rename the original file libodm11.so to libodm11. so.ORIG.Next, you will create the symbolic link libodm11.so to point to libnfsodm11.so. Here are the steps to set up the NFS ODM library file:

  1. cd $ORACLE_HOME/lib
  2. mv libodm11.so libodm11.so.ORIG
  3. ln -s libnfsodm11.so libodm11.so

Once the setup is complete, you will list the file to confirm that it is pointing to the right file:

DBA11g1 > ls -l libodm11.so
lrwxrwxrwx 1 oracle oinstall 14 Sep 5 09:02 libodm11.so -> libnfsodm11.so

Next,create the oranfstab file in the $ORACLE_HOME/dbs directory.Since Oracle first looks for the oranfstab file in the $ORACLE_HOME/dbs directory, DBAs can implement Direct NFS without the Unix system administrator’s intervention.

The oranfstab file is not a requirement to implement Direct NFS.The oranfstab file is a special file to list additional options specific for Oracle Database to Direct NFS. The oranfstab file has the following attributes for each NFS server to be accessed using Direct NFS:

  • Server: NFS server name
  • Path: IP or hostname of up to four network paths to the NFS server
  • Export: Exported path from the NFS server
  • Mount: Local mount point for the NFS server

Set Up Direct NFS

For our simple demonstration, we will just have one entry in the oranfstab file.The contents of the oranfstab file look like this:

DBA11g1 > cat oranfstab
server: nas103
path: 192.168.1.103
export: /apps/oracle/share mount: /oradata

An example of an oranfstab with multiple paths looks like this:

server: nas103
path: nas1
path: nas2
path: nas3
path: nas4
export: /oradata/share1 mount: /oradata1
export: /oradata/share2 mount: /oradata2
export: /oradata/share3 mount: /oradata3
export: /oradata/share4 mount: /oradata4

An this example, four paths are specified in the oranfstab file.The Direct NFS client will perform load balancing across nas1, nas2, nas3, and nas4.If an IO request to a specific path fails, Direct NFS will reissue the IO request over the remaining paths.

Validate Direct NFS

Once all the setup and configuration is complete, it’s time to start the database. Starting the database shows the following entry in the alert log:

Oracle instance running with ODM: Oracle Direct NFS ODM Library Version 2.0 After the database is up and running, you can create a tablespace on the Direct NFS mount point. In this example, we will create a 10MB datafile for the nfs_data tablespace on the /oradata Direct NFS mount point:

SQL>create tablespace nfs_data datafile '/oradata/DBA11g1/nfs_data_01.dbf' size 10m;

Tablespace created.

In the alert log, you should see a message similar to this:

create tablespace nfs_data datafile'/oradata/DBA11g1/nfs_data_01.dbf' size 10m
Direct NFS: mount complete dir /apps/oracle/share on nas103
path192.168.1.103 mntport 923 nfsport 2049

You can now confirm from the database that Direct NFS is enabled.You can query the V$DNFS_SERVERS view to display the server name,directory names, and associated NFS ports, as shown here:

SQL> select svrname, dirname, mntport, nfsport from v$dnfs_servers; SVRNAME DIRNAME MNTPORT NFSPORT --------- ------------------- -------- ------- nas103 /apps/oracle/share 923 2049

Other views that are relevant for Direct NFS client usage include the following:

  • V$DNFS_FILES: Displays files currently open using Direct NFS
  • V$DNFS_CHANNELS: Displays open network paths (or channels) to servers for which Direct NFS is providing files
  • V$DNFS_STATS: Displays performance statistics for Direct NFS Disable Direct NFS

You may need to disable Direct NFS for one reason or another.To disable Direct NFS, you can perform one of the following tasks:

  • Put the standard ODM library file back in the $ORACLE_HOME/lib directory.
  • cd $ORACLE_HOME/dbs cp libodm11.so.ORIG libodm11.so
  • Remove the oranfstab file in either $ORACLE_HOME/dbs or /etc.
  • Remove the NFS server or export path from oranfstab.

Network Interface Card Bonding

For network interface card (NIC) bonding,two common problems need to be addressed.First, expensive Ethernet switches are required to support advanced Ethernet switch support.Second,the network card bonding can be done only with homogeneous network cards.

With Oracle Direct NFS,you no longer need to deal with buying and configuring switches that can handle bonded network interfaces.And you don’t even have to deal with configuring bonded network interfaces for performance and redundancy since Oracle Direct NFS utilizes the multipath IO internally.

Direct NFS Performance

The Oracle Direct NFS client provides support for direct and asynchronous IO out of the box. Using Direct NFS client functionality available in Oracle Database 11g,customers can realize better IO performance,more efficient system resource utilization, and lower operating costs in NAS environments.According to Hewlett-Packard,customers can see significant database throughput with improvements as high as 40 percent measured in internal testing.Most important, customers do not have to worry about optimizing NFS client configuration for database workloads, thus reducing administrative burden and costs.

What is better, ASM or Direct NFS? This is the million-dollar question debated by database, SA, and SAN architects.With the promise of the 10GB network cards and switches,this will make the debate even more exciting.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Oracle 11g Topics