使用11g DNFS建立基於DNFS的tablespace
參考自:
Step by Step - Configure Direct NFS Client (DNFS) on Linux (11g) (文檔 ID 762374.1)
注意:
主機名p18的ip地址為192.168.80.18,是nfs的server
主機名為test179的為nfs的client
如下時操作過程:
一、在nfs server上的操作:
[root@p18 ~]# service nfs status rpc.mountd is stopped nfsd is stopped rpc.rquotad is stopped [root@p18 ~]# mkdir -p /u02/nfsdata [root@p18 ~]# chown oracle:oinstall /u02/nfsdata [root@p18 ~]# ls -ld /u02/nfsdata/ drwxr-xr-x 2 oracle oinstall 4096 Aug 17 07:22 /u02/nfsdata/
二、在nfs server上的操作:
[root@p18 nfsdata]# cat /etc/exports /u02/nfsdata *(rw,sync,all_squash,anonuid=500,anongid=502) [root@p18 nfsdata]#
三、在nfs server上的操作:
[root@p18 ~]# chkconfig --level 345 nfs on
四、啟動nfs server:
[root@p18 ~]# service nfs start Starting NFS services: [ OK ] Starting NFS quotas: [ OK ] Starting NFS daemon: [ OK ] Starting NFS mountd: [ OK ] [root@p18 ~]# exportfs -v /u02/nfsdata(rw,wdelay,root_squash,all_squash,no_subtree_check,anonuid=500,anongid=502)
五、在nfs client上操作:
[root@test179 ~]# mkdir -p /u02/nfsdata [root@test179 ~]# ls -ld /u02/nfsdata drwxr-xr-x 2 root root 4096 Aug 17 07:27 /u02/nfsdata [root@test179 ~]# cat /etc/fstab LABEL=/ / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 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 LABEL=SWAP-sda2 swap swap defaults 0 0 192.168.80.18:/u02/nfsdata /u02/nfsdata nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600 0 0 [root@test179 ~]# [root@test179 ~]# mount /u02/nfsdata [root@test179 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 55G 18G 35G 34% / /dev/sda1 190M 12M 170M 7% /boot tmpfs 1014M 0 1014M 0% /dev/shm /dev/hdc 2.8G 2.8G 0 100% /media/Enterprise Linux dvd 20090908 192.168.80.18:/u02/nfsdata 55G 12G 40G 24% /u02/nfsdata [root@test179 ~]# [root@test179 ~]# cd /u02/nfsdata [root@test179 nfsdata]# ls -lrt total 0 [root@test179 nfsdata]# touch testfile [root@test179 nfsdata]# ls -lrt total 0 -rw-r--r-- 1 oracle oinstall 0 Aug 17 07:32 testfile [oracle@test179 ~]$ cd /u01/app/oracle/product/11.1.0/db_1/dbs/ [oracle@test179 dbs]$ cat oranfstab server: 192.168.80.18 path: 192.168.80.18 local: 192.168.80.179 export: /u02/nfsdata mount: /u02/nfsdata [oracle@test179 db_1]$ cd lib/ [oracle@test179 lib]$ ls -lrt | grep odm -rw-r--r-- 1 oracle oinstall 8905 Sep 10 2008 libodmd11.so -rw-r--r-- 1 oracle oinstall 44730 Sep 10 2008 libnfsodm11.so lrwxrwxrwx 1 oracle oinstall 12 Jul 11 13:26 libodm11.so -> libodmd11.so [oracle@test179 lib]$ mv libodm11.so libodm11.so_bak [oracle@test179 lib]$ ln -s libnfsodm11.so libodm11.so [oracle@test179 lib]$ ls -l libnfsodm11.so -rw-r--r-- 1 oracle oinstall 44730 Sep 10 2008 libnfsodm11.so [oracle@test179 lib]$ ls -l libodm11.so lrwxrwxrwx 1 oracle oinstall 14 Aug 17 07:37 libodm11.so -> libnfsodm11.so [oracle@test179 lib]$
先重啟數據庫實例,建立基於dnfs的tablespace,下面就不貼出重啟的過程了,直接貼出建立表空間的過程。
[oracle@test179 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.1.0.7.0 - Production on Mon Aug 17 07:43:08 2015 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, OLAP, Data Mining and Real Application Testing options SQL> create tablespace nfs_tbs datafile '/u02/nfsdata/nfs_tbs01.dbf' size 30m; Tablespace created. SQL>