Follow below steps to create DBFS
Create the mount point for DBFS
[root@db01 ]# mkdir /dbfs_dir
Login with Oracle user
[root@db1 ]# su - oracle
Set the Oracle Database environment variable to connect the your database.
Connect Database as sysdba
[oracle@db01 ~]$ sqlplus / as sysdba
Create tablespace on ASM disk group
SQL> create tablespace dbfsts datafile '+DATA' size 1G;
SQL> create user dbfs_usr identified by Dbfs_pwd1 default tablespace dbfsts quota unlimited on dbfsts;
SQL> grant create session, create table, create procedure, dbfs_role to dbfs_usr;
You can use below syntax to create bigfile tablespace.
create bigfile tablespace dbfsts datafile '+DATA' size 2048g autoextend off nologging extent management local;
Go to admin directory of oracle binaryand run the below procedure
$cd $ORACLE_HOME/rdbms/admin
$sqlplus dbfs_usr/Dbfs_pwd1
SQL> start dbfs_create_filesystem_advanced dbfsts FS nocompress nodeduplicate noencrypt non-partition
TEST DBFS SETUP
[oracle@db01 ~]$ echo Dbfs_pwd1 > pwd.txt
[oracle@db01 ~]$ nohup $ORACLE_HOME/bin/dbfs_client dbfs_usr@test /dbfs_dir < pwd.txt &
- 'test' is database name
- '&' to run the process in background
- '/dbfs_dir' is a directory on which DBFS will be mounted
LOGIN to Oracle USER account from another terminal and check the DBFS file system
[oracle@db01 ~]$ cd /dbfs_dir/FS
[oracle@db01 ~]$ touch test.txt
[oracle@db01 ~]$ ls -ltr test.txt
LOGIN to root USER account from another terminal and check whether you can get acces of the DBFS file system
[root@db01 ]# cd /dbfs_dir/FS
Permission Denied
To unmount the file system issue the following command from the "root" OS user.
[root@db01 ]# fusermount -u /dbfs_dir
To allow other users ( example root to access the filesystem )
[oracle@dbs1 ]$ su - root
Password :
[root@db01 ]# echo user_allow_other > /etc/fuse.conf
change permission of /etc/fuse.conf to 644
[root@db01 ]#chmod 644 /etc/fuse.conf
[root@db01 ]# su - oracle
[oracle@db01 ~]$ nohup $ORACLE_HOME/bin/dbfs_client dbfs_usr@test -o direct_io,allow_root /dbfs_dir < pwd.txt &
You can check nohup file for any error logs.
Login to root user account from another terminal and check the accessibility of DBFS
[root@db01 ]# cd /dbfs_dir/FS
[root@db01 ]# ls -lt test.txt
To unmount the file system issue the following command from the "root" OS user.
# fusermount -u /dbfs_dir
Very good post. thanks!
ReplyDeleteI needed to below to the mounts in order to work.
changed 644 for /etc/fuse.conf
chown oracle:dba /dbfs_dir
This is very great thinks. It was very comprehensive post and powerful concept. Thanks for your sharing with us. Keep it up..
ReplyDeleteOracle Training in Chennai | Oracle Training Institutes in Chennai