ITPub博客

首页 > 数据库 > Oracle > oracle direct nfs

oracle direct nfs

原创 Oracle 作者:pyzwj 时间:2015-08-11 11:42:30 0 删除 编辑
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博客 ” ,链接:https://blog.itpub.net/28194062/viewspace-1768057/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: linux增大swap空间
请登录后发表评论 登录
全部评论

注册时间:2012-09-25

  • 博文量
    63
  • 访问量
    303311