ITPub博客

首页 > 数据库 > Oracle > oracle11g使用Direct NFS创建表空间

oracle11g使用Direct NFS创建表空间

Oracle 作者:daydayupy 时间:2013-05-04 17:05:23 0 删除 编辑

NFS SERVER 10.10.10.22
NFS CLIENT 10.10.10.12

1、nfs server需要启动的服务:

#service portmap start
Starting portmap: [  OK  ]
#service nfs start
Starting NFS services:  [  OK  ]
Starting NFS quotas: [  OK  ]
Starting NFS daemon: [  OK  ]
Starting NFS mountd: [  OK  ]
Starting RPC idmapd: [  OK  ]

2、nfs client需要启动的服务

#service portmap start
Starting portmap: [  OK  ]


3、在NFS SERVICE端配置NFS

   root用户编辑文件/etc/exports内容如下:

/u01/nfs 10.10.10.12(rw,no_root_squash,insecure)

检查配置结果:
[root@db11g-em10g nfs]# exportfs
/u01/nfs        10.10.10.12
[root@db11g-em10g nfs]# exportfs -rv
exporting 10.10.10.12:/u01/nfs

4、在NFS Client端root用户挂载NFS文件系统
[root@db11g oracle]# mount 10.10.10.22:/u01/nfs /oracle/nfs


5、配置NFS CLIENT数据库支持Direct NFS

   oracle用户编辑$ORACLE_HOME/dbs/oranfstab文件,内容如下
[oracle@db11g ~]$ cat $ORACLE_HOME/dbs/oranfstab
server:db11g-em10g
path:10.10.10.22
export:/u01/nfs mount:/oracle/nfs

   修改libodm11.so库文件的链接对象
$cd $ORACLE_HOME/lib
$mv libodm11.so libodm11.so.bak
$ln -s libnfsodm11.so libodm11.so

数据库启动的告警日志中有如下信息:

Oracle instance running with ODM: Oracle Direct NFS ODM Library Version 2.0

 

6、在NFS Client端创建表空间测试:

SQL> select * from v$dnfs_servers

        ID SVRNAME         DIRNAME                 MNTPORT    NFSPORT      WTMAX      RTMAX
---------- --------------- -------------------- ---------- ---------- ---------- ----------
         6 db11g-em10g  /u01/nfs                    718       2049          0          0


SQL> create tablespace dnfs datafile '/oracle/nfs/dnfs01.dbf' size 2M;
SQL> select * from v$dnfs_files

FILENAME                                   FILESIZE       PNUM     SVR_ID
---------------------------------------- ---------- ---------- ----------
/oracle/nfs/dnfs01.dbf                      2105344          9          5

7、检查NFS SERVER端口的链接情况:
[root@db11g-em10g nfs]# netstat -an |grep 2049
tcp        0      0 0.0.0.0:2049                0.0.0.0:*                   LISTEN     
tcp        0      0 10.10.10.22:2049            10.10.10.12:23052           ESTABLISHED
tcp        0      0 10.10.10.22:2049            10.10.10.12:728             ESTABLISHED
tcp        0      0 10.10.10.22:2049            10.10.10.12:56522           ESTABLISHED
udp        0      0 0.0.0.0:2049                0.0.0.0:*                              


发现的问题:
1、NFS CLient端必须要启动portmap服务,否者在client端mount nfs文件出错:
[root@db11g oracle]# mount 10.10.10.22:/u01/nfs /oracle/nfs
mount.nfs: Input/output error
[root@db11g oracle]# service portmap start
Starting portmap: [  OK  ]
[root@db11g oracle]# mount 10.10.10.22:/u01/nfs /oracle/nfs


2、NFS SERVER端的配置文件/etc/exports使用默认的内容:
[root@db11g-em10g nfs]# cat /etc/exports
/u01/nfs 10.10.10.12(rw,sync,no_root_squash)
那么在Client端创建表空间时候出现如下的错误:
[oracle@db11g dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.7.0 - Production on Sat Dec 22 15:33:19 2012

Copyright (c) 1982, 2008, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
With the Partitioning and Real Application Testing options

SQL> create tablespace nfsdemo datafile '/oracle/nfs/nfsdemo01.dbf' size 2M;
create tablespace nfsdemo datafile '/oracle/nfs/nfsdemo01.dbf' size 2M
*
ERROR at line 1:
ORA-01119: error in creating database file '/oracle/nfs/nfsdemo01.dbf'
ORA-27086: unable to lock file - already in use
Linux Error: 37: No locks available
Additional information: 10

告警日志提示如下错误:
Sat Dec 22 15:38:18 2012
ORA-1119 signalled during: create tablespace dnfs datafile '/oracle/nfs/dnfs01.dbf' size 2M...
Sat Dec 22 15:46:52 2012
create tablespace dnfs datafile '/oracle/nfs/dnfs01.dbf' size 2M
Direct NFS: NFS3ERR 1 Not owner. path db11g-em10g mntport 718 nfsport 2049


***********************************************************************************


执行select count(*) from test;时可以看到网络流量很高,高的时候达到400Mbytes/s.在NFS Server端查看连接到2049端口的连接数,可以看到有很多个连接,这与使用操作系统的NFS client端是不一样的,使用操作系统的NFS client端,到服务器的连接只有一个,由此可见,Oracle Direct NFS通过与服务器建立多个TCP连接来实现高并发IO,从而提升NFS的性能。连接的数目的多少与压力的大小有关,压力越大,连接数越多。

<!-- 正文结束 -->

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

上一篇: 没有了~
下一篇: 没有了~
请登录后发表评论 登录
全部评论