oracle direct nfs

centos 6.6
--操作系统版本
[ root@centos102 ~]# cat /etc/issue 
CentOS release 6.6 (Final) 
Kernel \r on an \m 

--验证nfs是否安装,
若没有则安装nfs包
#yum install nfs-utils
[ root@centos102 ~]# rpm -qa | grep nfs 
nfs4-acl-tools-0.3.3-6.el6.x86_64 
nfs-utils-lib-1.1.5-9.el6.x86_64 
nfs-utils-1.2.3-54.el6.x86_64 

--配置网络共享目录
[ root@centos102 ~]# cat /etc/exports 
[ root@centos102 ~]# mkdir -p /mnt/nfs 
[ root@centos102 ~]# cat /etc/exports
/mnt/nfs 10.1.1.102(rw,no_root_squash,insecure)
[ root@centos102 ~]# exportfs 
/mnt/nfs 10.1.1.102

--服务器端 开启NFS和portmap服务
[ root@centos102 ~]# service portmap start   --在centos6.5中portmap已经改为rpcbind
portmap: unrecognized service 
[ root@centos102 ~]# service nfs start 
Starting NFS services: [ OK ] 
Starting NFS quotas: [ OK ] 
Starting NFS mountd: [ OK ] 
Starting NFS daemon: [ OK ] 
Starting RPC idmapd: [ OK ] 
[ root@centos102 ~]# service rpcbind start 
[ root@centos102 ~]# service rpcbind status 
rpcbind (pid 1179) is running...

--oracle database 客户端,启动 portmap服务, 使用mount将nfs服务端的共享目录挂载到本地。
用mount –t nfs 192.168.123:/home/nfs-share  /home/remote_file挂载服务器端的共享目录到本地的/home/remote-file挂载点,
[ root@centos102 ~]# mkdir -p /local/nfs 
[ root@centos102 ~]# mount -t nfs 10.1.1.102:/mnt/nfs/ /local/nfs/ 
[ root@centos102 ~]# df -h 
Filesystem Size Used Avail Use% Mounted on 
/dev/mapper/vg_centos102-lv_root 
150G 65G 78G 46% / 
/dev/sda1 477M 59M 393M 13% /boot 
tmpfs 5.0G 0 5.0G 0% /dev/shm 
10.1.1.102:/mnt/nfs/ 150G 65G 78G 46% /local/nfs

--nfs测试:
[ root@centos102 ~]# cd /local/nfs/ 
[ root@centos102 nfs]# lll 
-bash: lll: command not found 
[ root@centos102 nfs]# ll 
total 0 
[ root@centos102 nfs]# vi aa 

2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga2145 qaga 

"aa" [New] 1L, 199C written 
[ root@centos102 nfs]# ll 
total 4 
-rw-r--r-- 1 root root 199 Aug 11 11:08 aa 
[ root@centos102 nfs]# pwd 
/local/nfs 
[ root@centos102 nfs]# ls -l /mnt/nfs/ 
total 4 
-rw-r--r-- 1 root root 199 Aug 11 11:08 aa

-- 配置NFS CLIENT数据库支持Direct NFS

   oracle用户编辑$ORACLE_HOME/dbs/oranfstab文件,内容如下
[oracle@centos102 ~]$ cat /user_app/oracle/product/oracle_db/v11r2p3/db1/dbs/oranfstab 
server:centos102 
path:10.1.1.102 
export:/mnt/nfs 
mount:/local/nfs

   修改libodm11.so库文件的链接对象
[oracle@centos102 lib]$ ll | grep odm11 
-rw-r--r-- 1 oracle oinstall 60431 Sep 17 2011 libnfsodm11.so 
-rw-r--r-- 1 oracle oinstall 7370 Sep 17 2011 libodm11.a 
lrwxrwxrwx 1 oracle oinstall 12 Mar 26 14:16 libodm11.so -> libodmd11.so 
[oracle@centos102 lib]$ mv libodm11.so libodm11.so.bak 
[oracle@centos102 lib]$ ll | grep odm11 
-rw-r--r-- 1 oracle oinstall 60431 Sep 17 2011 libnfsodm11.so 
-rw-r--r-- 1 oracle oinstall 7370 Sep 17 2011 libodm11.a 
lrwxrwxrwx 1 oracle oinstall 12 Mar 26 14:16 libodm11.so.bak -> libodmd11.so 
[oracle@centos102 lib]$ ln -s libnfsodm11.so libodm11.so 
[oracle@centos102 lib]$ ll | grep odm11 
-rw-r--r-- 1 oracle oinstall 60431 Sep 17 2011 libnfsodm11.so 
-rw-r--r-- 1 oracle oinstall 7370 Sep 17 2011 libodm11.a 
lrwxrwxrwx 1 oracle oinstall 14 Aug 11 11:16 libodm11.so -> libnfsodm11.so 
lrwxrwxrwx 1 oracle oinstall 12 Mar 26 14:16 libodm11.so.bak -> libodmd11.so


--测试:
SQL> startup force
ORACLE instance started.

SQL> create tablespace tb1 datafile '/local/nfs/tb01.dbf' size 10M;
create tablespace tb1 datafile '/local/nfs/tb01.dbf' size 10M
*
ERROR at line 1:
ORA-01119: error in creating database file '/local/nfs/tb01.dbf'
ORA-17502: ksfdcre:4 Failed to create file /local/nfs/tb01.dbf
ORA-17500: ODM err:Permission denied
注意:这里的报错是由于路径权限的问题
[ root@centos102  nfs]# chown -R oracle:oinstall /local/nfs 
[ root@centos102  nfs]# chown -R oracle:oinstall /mnt/nfs/
SQL> create tablespace tb1 datafile '/local/nfs/tb01.dbf' size 10M;
Tablespace created.

SQL> col filename for a50
SQL> select * from v$dnfs_files;
FILENAME FILESIZE PNUM SVR_ID
-------------------------------------------------- ---------- ---------- ----------
/local/nfs/tb01.dbf 10493952 10 1
 
alert日志信息:
Tue Aug 11 11:23:26 2015
Starting background process SMCO
Tue Aug 11 11:23:26 2015
SMCO started with pid=28, OS id=5663
Tue Aug 11 11:23:37 2015
create tablespace tb1 datafile '/local/nfs/tb01.dbf' size 10M
Tue Aug 11 11:24:33 2015
Direct NFS: channel id [0] path [10.1.1.102] to filer [10.1.1.102] via local [] is UP
Direct NFS: channel id [1] path [10.1.1.102] to filer [10.1.1.102] via local [] is UP
Tue Aug 11 11:24:34 2015
Completed: create tablespace tb1 datafile '/local/nfs/tb01.dbf' size 10M

SQL> select * from v$dnfs_servers;
        ID SVRNAME DIRNAME MNTPORT NFSPORT WTMAX RTMAX
---------- ------------------------------ ------------------------------ ---------- ---------- ---------- ----------
         1 10.1.1.102 /mnt/nfs/ 55831 2049 1048576 1048576

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28194062/viewspace-1768057/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28194062/viewspace-1768057/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值