Because of other priorities such as bringing the first v2 Database Machine in 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@ocm01 ~]$ cp $ORACLE_HOME/lib/libodm11.so $ORACLE_HOME/lib/libodm11.so_stub
[oracle@ocm01 ~]$ 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@ocm01 ~]$ 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:
Direct NFS: NFS3ERR 1 Not owner. path ocm01.nl.oracle.com mntport 930 nfsport 2049
3. Before configuring the new Oracle stanza for NFS we still need to configure a regular kernel NFS mount:
[root@ocm01 ~]# cat /etc/fstab | grep nfs
ocm01.nl.oracle.com:/u01/scratch/nfs /incoming nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600
4. Then a so called Oracle-'nfstab' needs to be created that specifies what the available exports to use:
[oracle@ocm01 ~]$ cat /etc/oranfstab
server:ocm01.nl.oracle.com
path:192.168.1.40
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.
Be sure to know that it may happen that you do not specify the insecure option (like I did).
In that case you will still see output from the query v$dnfs_servers:
SQL select * from v$dnfs_servers;
ID SVRNAME DIRNAME MNTPORT NFSPORT WTMAX RTMAX
-- -------------------- ----------------- --------- ---------- ------ ------
1 ocm01.nl.oracle.com /u01/scratch/nfs 684 2049 32768 32768
But, querying v$dnfsfiles and v$dnfs_channels will now 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 ocm01.nl.oracle.com mntport 930 nfsport 2049
After correcting the export:
SQL select * from v$dnfs_files;
FILENAME FILESIZE PNUM SVR_ID
--------------- -------- ------ ------
/incoming/rk.dbf 10493952 20 1
Rene Kundersma
Oracle Technology Services, The Netherlands