Tags
To setup Oracle database on NFS storage, configure the database server as a client to NFS server. Nfs server allows the storage to mount remotely, on NFS client, so first configure NFS server on linux:
— Make sure the nfs server is configured, or configure using below command:
$chkconfig –level 345 nfs on
$service nfs start
— As root, create the directory for the oracle files on the NFS server and
set the ownership of this directory to this UID and the GID,
$ mkdir /oranfs
$ chown 500:500 /oranfs ## uid and gid of oracle/groups
— Add this directory to /etc/exports file, nfs server get the directory configuration.
$vi /etc/exports
/oranfs *(rw,sync,all_squash, anonuid=500,anongid=500)
#anonuid/anongid shows remote user uid/gid
$exportfs ## since nfs already started, re-export the fs.
$exportfs -v
/oranfs *(rw,sync,all_squash, anonuid=500,anongid=500)
Mount NFS on the client node
— In order to mount remote file system, we need a mounting directory, so create one.
$mkdir /rnfs
— Make the changes in /etc/fstab:
nfs_host:/oranfs /rnfs nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600 0 0
— Mount the storage:
$mount /rnfs
$mount ## to make sure the nfs mounted correctly
Another option to mount nfs is autofs, it uses automount daemon. On NFS server, you can edit the file /etc/auto.master and /etc/auto.misc. You can mount on nfs clients on the server startup.
Eg:
$vi /etc/auto.master
/prj /etc/auto.misc –timeout 30 ##/prj is a sub directory where we have the storage.
$vi /etc/auto.misc
prj_name -rw,soft,intr,rsize=8192,wsize=8192 nfs.client:/oranfs
##prj_name is local mount point and /oranfs is romote mount point
The nfs storage is ready for oracle usage, and we can place database files on it.