Tuesday, May 10, 2011

Oracle Direct NFS Client Handson

[root@vmxdb02 ~]# cat /etc/exports
/share1 *(rw,sync,no_wdelay,insecure_locks,no_root_squash)

[root@vmxdb02 ~]# service nfs restart
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [FAILED]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]


[root@vmxdb02 ~]# exportfs
/share1


[root@vmxdb01 ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Mon Apr 4 04:12:16 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_vmxdb-lv_root / ext4 defaults 1 1
UUID=4553842d-2742-44c0-9f7f-f37d4c9a23de /boot ext4 defaults 1 2
/dev/mapper/vg_vmxdb-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
vmxdb02:/share1 /u01data nfs rw,bg,hard,nointr,tcp,vers=3,timeo=300,rsize=32768,wsize=32768,actimeo=0 0 0



[oracle@vmxdb01 ~]$ cat $ORACLE_HOME/dbs/oranfstab
server: vmxdb02
local: 192.168.1.21
path: 192.168.1.22
export: /share1 mount: /u01data

[oracle@vmxdb01 lib]$ make -f ins_rdbms.mk dnfs_on
rm -f /u01/app/oracle/product/11.2.0.2/db_1/lib/libodm11.so; cp /u01/app/oracle/product/11.2.0.2/db_1/lib/libnfsodm11.so

/u01/app/oracle/product/11.2.0.2/db_1/lib/libodm11.so



sqlplus / as sysdba<startup
EOD


SQL> create tablespace nfstbs datafile '/u01data/orcl/nfstbs01.dbf' size 10M autoextend on;

Tablespace created.


sqlplus / as sysdba<shutdown immediate
startup
EOD


SQL> select * from gv$dnfs_servers;

INST_ID ID
---------- ----------
SVRNAME
--------------------------------------------------------------------------------
DIRNAME
--------------------------------------------------------------------------------
MNTPORT NFSPORT WTMAX RTMAX
---------- ---------- ---------- ----------
1 1
vmxdb02
/share1
920 2049 0 0




open_cursors = 300
diagnostic_dest = "/u01/app/oracle"
Oracle instance running with ODM: Oracle Direct NFS ODM Library Version 3.0
PMON started with pid=2, OS id=8361
PSP0 started with pid=3, OS id=8363
2011-05-10 22:10:07.460000 +08:00
VKTM started with pid=4, OS id=8365 at elevated priority
VKTM running at (1)millisec precision with DBRM quantum (100)ms
GEN0 started with pid=5, OS id=8369
DIAG started with pid=6, OS id=8371
DBRM started with pid=7, OS id=8373
DIA0 started with pid=8, OS id=8375
MMAN started with pid=9, OS id=8377
DBW0 started with pid=10, OS id=8379
LGWR started with pid=11, OS id=8381
CKPT started with pid=12, OS id=8383
SMON started with pid=13, OS id=8385
RECO started with pid=14, OS id=8387
MMON started with pid=15, OS id=8389
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
MMNL started with pid=16, OS id=8391
starting up 1 shared server(s) ...
ORACLE_BASE from environment = /u01/app/oracle
ALTER DATABASE MOUNT
2011-05-10 22:10:11.792000 +08:00
Successful mount of redo thread 1, with mount id 1278613439
Database mounted in Exclusive Mode
Lost write protection disabled
Completed: ALTER DATABASE MOUNT
ALTER DATABASE OPEN
Direct NFS: attempting to mount /share1 on filer vmxdb02 defined in oranfstab
Direct NFS: channel config is:
channel id [0] local [192.168.1.21] path [192.168.1.22]
Direct NFS: mount complete dir /share1 on vmxdb02 mntport 920 nfsport 2049
LGWR: STARTING ARCH PROCESSES
ARC0 started with pid=20, OS id=8450
2011-05-10 22:10:12.911000 +08:00
ARC0: Archival started



[oracle@vmxdb01 lib]$ cd $ORACLE_HOME/rdbms/lib
[oracle@vmxdb01 lib]$ make -f ins_rdbms.mk dnfs_off
rm -f /u01/app/oracle/product/11.2.0.2/db_1/lib/libodm11.so; cp /u01/app/oracle/product/11.2.0.2/db_1/rdbms/lib/libodm11.so.dummy

/u01/app/oracle/product/11.2.0.2/db_1/lib/libodm11.so