Exadata Product Development Blog

  • March 24, 2010

Using DNFS for test purposes

Rene Kundersma
Software Engineer
Because of other priorities such as bringing the first v2 Database Machine in the Netherlands into production I did spend less time on my blog that planned. I do however like to tell some things about DNFS, the build-in NFS client we have in Oracle RDBMS since 11.1.
What DNFS is and how to set it up can all be found here .
As you see this documentation is actually the "Clusterware Installation Guide".
I think that is weird, I would expect this to be part of the Admin Guide, especially the "Tablespace" chapter.
I do however want to show what I did not find in the documentation that quickly (and solved after talking to my famous colleague "the prutser"):

First, a quick setup:

1. The standard ODM library needs to be replaced with the NFS ODM library:
[oracle@rkdb01 ~]$ cp $ORACLE_HOME/lib/libodm11.so $ORACLE_HOME/lib/libodm11.so_stub
[oracle@rkdb01 ~]$ ln -s $ORACLE_HOME/lib/libnfsodm11.so $ORACLE_HOME/lib/libodm11.so

After changing to this library you will notice the following in your alert.log:
Oracle instance running with ODM: Oracle Direct NFS ODM Library Version 2.0

2. The intention is to mount the datafiles over normal NAS (like NetApp).
But, in case you want to test yourself and use an exported NFS filesystem, it should look like the following:
   [oracle@rkdb01 ~]$ cat /etc/exports 
/u01/scratch/nfs *(rw,sync,insecure)

Please note the "insecure" option in the export, since you will not be able to use DNFS without it if you export a filesystem from a host. Without the "insecure" option the NFS server considers the port used by the database "insecure" and the database is unable to acquire the mount. This is what you will see in the alert.log creating the file:
     Direct NFS: NFS3ERR 1 Not owner. path rkdb01.nl.oracle.com mntport 930 nfsport 2049

3. Before configuring the new Oracle stanza for DNFS we still need to configure a regular kernel NFS mount:
[root@rkdb01 ~]# cat /etc/fstab | grep nfs
rkdb01.nl.oracle.com:/u01/scratch/nfs /incoming nfs rw,bg,hard,nointr,rsize=32768,

4. Then a so called Oracle-'nfstab' needs to be created that specifies what the available exports to use:
[oracle@rkdb01 ~]$ cat /etc/oranfstab 
export:/u01/scratch/nfs mount:/incoming

5. Creating a tablespace with a datafile on the NFS location:
SQL> create tablespace rk datafile '/incoming/rk.dbf' size 10M;
Tablespace created.

As said, be sure to know that it may happen that if you do not specify the insecure option (like I did) you will still see output from the query v$dnfs_servers:
SQL> select * from v$dnfs_servers;
-- -------------------- ----------------- --------- ---------- ------ ------
1 rkdb01.nl.oracle.com /u01/scratch/nfs 684 2049 32768 32768

But, querying v$dnfsfiles and v$dnfs_channels will not return any result, and indeed, you will see the following message in the alert-log when
you create a file :
Direct NFS: NFS3ERR 1 Not owner. path rkdb01.nl.oracle.com mntport 930 nfsport 2049

After correcting the export with the "secure" option:
SQL> select * from v$dnfs_files;
--------------- -------- ------ ------
/incoming/rk.dbf 10493952 20 1

Rene Kundersma
Oracle Technology Services, The Netherlands

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.