How to enable Oracle Direct NFS for increased performance between Oracle Database and NFS Shares

How to enable Oracle Direct NFS for increased performance between Oracle Database and NFS Shares
How to enable Oracle Direct NFS for increased performance between Oracle Database and NFS Shares

In this article we will see how to activate it Direct NFS for connectivity Oracle Database with NFS Servers. When we activate it, the communication between the Oracle Database and NFS Servers takes place directly, without involving the kernel of the operating system, improving the performance at the I/O level as well as the rest of the resources (CPU, RAM). Supports parallel I/O, asynchronous I/O and many security options.

It gets the information about NFS Shares from /etc/fstab (mtab).

The footsteps

We create the folders with the oracle user as owner and the following permissions:

su root
mkdir -p /oracle/nfs
mkdir -p /oracle/oradata
mkdir -p /oracle/fra
chown -R oracle:oinstall /oracle/nfs
chown -R oracle:oinstall /oracle/oradata
chown -R oracle:oinstall /oracle/fra
chmod -R 775 /oracle/nfs
chmod -R 775 /oracle/oradata
chmod -R 775 /oracle/fra

To be sure that the rights to the NFS Server will not be cut, we go to the exports file and add a record for each NFS Share as below:

vi /etc/exports
/oracle/nfs         *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/oracle/oradata         *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/oracle/fra         *(rw,sync,no_wdelay,insecure_locks,no_root_squash)

Then we restart the NFS service:

chkconfig nfs on
service nfs restart

We add to the archive /etc/fstab one entry for each NFS Share so that they mount themselves when each machine starts:

su root

vi /etc/fstab
win-nfs:/nfs /oracle/nfs  nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0  0 0
win-nfs:/oradata /oracle/oradata  nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0  0 0
win-nfs:/fra /oracle/fra  nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0  0 0
How to enable Oracle Direct NFS for increased performance between Oracle Database and NFS Shares
01

Now we are ready to mount them:

mount /oracle/nfs
mount /oracle/oradata
mount /oracle/fra

If we want to give specific other options (e.g. Kerberos security option) beyond what it has in /etc/fstab then we can create the file $ORACLE_HOME/dbs/oranfstab which overrides the /etc/fstab:

vi $ORACLE_HOME/dbs/oranfstab

We declare the NFS Server with its IP, NFS protocol and NFS Shares:

server: win-nfs           # nfs server hostname
path: 172.25.94.95        # nfs server ip
nfs_version: nfsv3
export: /nfs mount: /oracle/nfs
export: /oradata mount: /oracle/oradata
export: /fra mount: /oracle/fra

From Oracle Database 12c onwards Direct NFS enabled by default alone. If it is not already enabled and we want to enable it, we run the following:

cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk dnfs_on

Accordingly if we want to disable it:

cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk dnfs_off

How do we check if it's activated?

To see that it has been activated when we create the database we run the following select, to see if it will bring records:

select * from v$dnfs_servers;
How to enable Oracle Direct NFS for increased performance between Oracle Database and NFS Shares
02

We can also see the files that use Direct NFS with the following query:

select * from v$dnfs_files;
How to enable Oracle Direct NFS for increased performance between Oracle Database and NFS Shares
03

Another way to see if Direct NFS is enabled is to look at the alert log of Oracle Database when it starts if it displays the message:

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

But if it shows us the following error:

Direct NFS: please check that oradism is setuid

We should change the owner to root and the permissions on the file oradism:

chown root:oinstall $ORACLE_HOME/bin/oradism

chmod 4750 $ORACLE_HOME/bin/oradism

Sources:

Share it

Leave a reply