日期:2014-05-16  浏览次数:20512 次

dbfs 实施文档

一、DBFS介绍

 

The Oracle Database File System (DBFS) creates a standard file system interface on top

of files and directories that are stored indata base tables. DBFS is similar to NFS in that

it provides a shared network file systemthat looks like a local file system. Like NFS,

there is a server component and a clientcomponent.

 

Dbfs在文件和目录之上创建了一个标准的文件系统结构,并且将数据存储在数据库基表里面。DBFS很像NFS,因为它提供了一个与本地文件系统相同的共享的网络文件系统。与NFS一样,由Server与Client组成。

 

In DBFS, the server is the Oracle Database.Files are stored as SecureFiles LOBs in a

database table. A set of PL/SQL proceduresimplement the file system access

primitives such as create, open, read,write, and list directory. The implementation of

the file system in the database is calledthe DBFS Content Store. The DBFS Content

Store allows each database user to createone or more file systems that can be mounted

by clients. Each file system has its owndedicated tables that hold the file system

content.

 

在DBFS中,Server为Oracle数据库,文件存储在表的一个SecureFiles LOBs 字段里面。一个PLSQL存储过程的集合,提供了访问文件系统的基本操作,比如说create、open、read、write,ls 。DBFS目录库允许每个数据库用户创建一个或多个文件系统,并且可以被clients使用。每个文件系统拥有专有的数据表,保证文件系统的内容。

 

 

体系结构如下图所示

 

 

 

 

二、Client端安装fuse

确定fuse版本

uname –a

Linux DB-SERVER-02 2.6.18-164.el5#1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

 

本机kernelversion 2.6.18

Kernel version 2.6.x

x>9都需要使用 fuse-2.7.4

 

下载fuse安装包

下载地址:

http://fuse.sourceforge.net

或者

http://sourceforge.net/projects/fuse

 

检查kernel-devel 包

# rpm –q kernel-devel

如果没有安装,挂载安装盘后安装package

安装fuse

$ tar -xzvf fuse-2.7.4.tar.gz

$ cd [fuse_src_dir]

$ ./configure --prefix=/usr --with-kernel=[yourkernel dir]

$ make

$ sudo su

# make install

# /sbin/depmod

# /sbin/modprobe fuse

# chmod 666 /dev/fuse

# echo "/sbin/modprobe fuse" >>/etc/rc.modules

示例

查看是否安装了所需安装包

[root@james-test ~]# rpm -q kernel-devel

package kernel-devel is not installed

挂载光盘

[root@james-test dev]# mount /dev/hdc /mnt

mount: block device /dev/hdc iswrite-protected, mounting read-only
安装kernel-devel包

[root@james-test Server]# rpm -ivh kernel-devel-2.6.18-308.el5.x86_64.rpm

Preparing...               ########################################### [100%]

  1:kernel-devel           ###########################################[100%]

查看kernelversion

[root@james-tes