Configurando Oracle Database File System (DBFS) em Real Application Clusters (RAC) no Oracle 12c
Por Y V Ravi Kumar , Rodrigo Mufalani , Archana Durai (OCP and RHCE),
Publicado em Julho 2018
Revisado por Mario Andrés Escobar
Introdução
O Oracle Database File System (DBFS) é uma funcionalidade que cria uma interface de file system padrão de arquivos e diretórios em cima tabelas armazenadas no banco de dados. O Oracle database file system (DBFS) é similar ao Network File System (NFS), que fornece um file system compartilhado via rede que se assemelha a um file system local, mesmo em um ambiente clusterizado.
Usos do DBFS
- Migrando databases para Exadata Database Machine com dados de outros sistemas operacionais para converter os datafiles em um storage intermediário.
- Datafiles sempre devem estar testados no DBFS
- DBFS deve ser configurado em um staging database separado para ambientes críticos.
- Armazenamento compartilhado para staging ou armazenar datafiles, scripts, relatórios e outros arquivos das aplicações.
- Arquivos são armazenados como SecureFiles LOBs dentro das tabelas do banco de dados que são armazenados dentro de um Oracle Exadata Database Machine
Configuração do ambiente:
Operating system: Oracle Linux Server release 6.5
Oracle Version: Oracle Database 12cR1 (12.1.0.2.0)
Hostnames: rac3-12c, rac4-12c
Database: orcldb (orcldb1 and orcldb2)
Oracle Home: /u01/app/oracle/product/12.1.0.2/db_1
GRID Home: /u01/app/12.1.0.2/grid
Public IPs: 192.168.2.201, 192.168.2.202
Private IPs: 10.1.4.146, 10.1.4.147
SCAN IPs: 192.168.2.205, 192.168.2.206 and 192.168.2.207
Logue-se como ‘root’ user e instale as bibliotecas requeridas para DBFS usando YUM no Node-1 (rac3-12c). ‘fuse’ API precisa ser instalada e configurada.
[root@rac3-12c ~]# yum install kernel-devel fuse fuse-libs -y
Loaded plugins: refresh-packagekit, security
public_ol6_UEKR3_latest | 1.2 kB 00:00
public_ol6_UEKR3_latest/primary | 32 MB 00:06
public_ol6_UEKR3_latest 802/802
public_ol6_latest | 1.4 kB 00:00
public_ol6_latest/primary | 64 MB 00:11
public_ol6_latest
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package fuse.x86_64 0:2.8.3-4.0.2.el6 will be updated
---> Package fuse.x86_64 0:2.9.4-1.0.4.el6 will be an update
---> Package fuse-libs.x86_64 0:2.8.3-4.0.2.el6 will be updated
---> Package fuse-libs.x86_64 0:2.9.4-1.0.4.el6 will be an update
---> Package kernel-devel.x86_64 0:2.6.32-696.3.2.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================
Package Arch Version Repository Size
=================================================================================================
Installing:
kernel-devel x86_64 2.6.32-696.3.2.el6 public_ol6_latest 11 M
Updating:
fuse x86_64 2.9.4-1.0.4.el6 public_ol6_latest 84 k
fuse-libs x86_64 2.9.4-1.0.4.el6 public_ol6_latest 89 k
Transaction Summary
=================================================================================================
Install 1 Package(s)
Upgrade 2 Package(s)
Total download size: 11 M
Downloading Packages:
(1/3): fuse-2.9.4-1.0.4.el6.x86_64.rpm | 84 kB 00:00
(2/3): fuse-libs-2.9.4-1.0.4.el6.x86_64.rpm | 89 kB 00:00
(3/3): kernel-devel-2.6.32-696.3.2.el6.x86_64.rpm | 11 MB 00:01
------------------------------------------------------------------------------------------
Total 5.5 MB/s | 11 MB 00:01
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Retrieving key from http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
Importing GPG key 0xEC551F03:
Userid: "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
From : http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Updating : fuse-libs-2.9.4-1.0.4.el6.x86_64 1/5
Updating : fuse-2.9.4-1.0.4.el6.x86_64 2/5
Installing : kernel-devel-2.6.32-696.3.2.el6.x86_64 3/5
Cleanup : fuse-libs-2.8.3-4.0.2.el6.x86_64 4/5
Cleanup : fuse-2.8.3-4.0.2.el6.x86_64 5/5
Verifying : kernel-devel-2.6.32-696.3.2.el6.x86_64 1/5
Verifying : fuse-2.9.4-1.0.4.el6.x86_64 2/5
Verifying : fuse-libs-2.9.4-1.0.4.el6.x86_64 3/5
Verifying : fuse-2.8.3-4.0.2.el6.x86_64 4/5
Verifying : fuse-libs-2.8.3-4.0.2.el6.x86_64 5/5
Installed:
kernel-devel.x86_64 0:2.6.32-696.3.2.el6
Updated:
fuse.x86_64 0:2.9.4-1.0.4.el6 fuse-libs.x86_64 0:2.9.4-1.0.4.el6
Complete!
[root@rac3-12c ~]#
Reboot o Node-1 (rac3-12c)
[root@rac3-12c ~]# init 6
Logue-se como ‘root’ user e instale as bibliotecas requeridas para o DBFS usando YUM no Node-2 (rac4-12c). ‘fuse’ API precisa ser instalada e configurada.
[root@rac4-12c ~]# yum install kernel-devel fuse fuse-libs -y
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package fuse.x86_64 0:2.8.3-4.0.2.el6 will be updated
---> Package fuse.x86_64 0:2.9.4-1.0.4.el6 will be an update
---> Package fuse-libs.x86_64 0:2.8.3-4.0.2.el6 will be updated
---> Package fuse-libs.x86_64 0:2.9.4-1.0.4.el6 will be an update
---> Package kernel-devel.x86_64 0:2.6.32-696.3.2.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================
Package Arch Version Repository Size
=========================================================================================
Installing:
kernel-devel x86_64 2.6.32-696.3.2.el6 public_ol6_latest 11 M
Updating:
fuse x86_64 2.9.4-1.0.4.el6 public_ol6_latest 84 k
fuse-libs x86_64 2.9.4-1.0.4.el6 public_ol6_latest 89 k
Transaction Summary
=========================================================================================
Install 1 Package(s)
Upgrade 2 Package(s)
Total download size: 11 M
Downloading Packages:
(1/3): fuse-2.9.4-1.0.4.el6.x86_64.rpm | 84 kB 00:00
(2/3): fuse-libs-2.9.4-1.0.4.el6.x86_64.rpm | 89 kB 00:00
(3/3): kernel-devel-2.6.32-696.3.2.el6.x86_64.rpm | 11 MB 00:01
------------------------------------------------------------------------------------------
Total 4.5 MB/s | 11 MB 00:02 4.5 MB/s | 11 MB 00:02
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Retrieving key from http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
Importing GPG key 0xEC551F03:
Userid: "Oracle OSS group (Open Source Software group) <build@oss.oracle.com"
From : http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Updating : fuse-libs-2.9.4-1.0.4.el6.x86_64 1/5
Updating : fuse-2.9.4-1.0.4.el6.x86_64 2/5
Installing : kernel-devel-2.6.32-696.3.2.el6.x86_64 3/5
Cleanup : fuse-libs-2.8.3-4.0.2.el6.x86_64 4/5
Cleanup : fuse-2.8.3-4.0.2.el6.x86_64 5/5
Verifying : kernel-devel-2.6.32-696.3.2.el6.x86_64 1/5
Verifying : fuse-2.9.4-1.0.4.el6.x86_64 2/5
Verifying : fuse-libs-2.9.4-1.0.4.el6.x86_64 3/5
Verifying : fuse-2.8.3-4.0.2.el6.x86_64 4/5
Verifying : fuse-libs-2.8.3-4.0.2.el6.x86_64 5/5
Installed:
kernel-devel.x86_64 0:2.6.32-696.3.2.el6
Updated:
fuse.x86_64 0:2.9.4-1.0.4.el6 fuse-libs.x86_64 0:2.9.4-1.0.4.el6
Complete!
[root@rac4-12c ~]#
Reboot o Node-2 (rac4-12c)
[root@rac4-12c ~]# init 6
Logue-se como ‘root’ user e configure o fuse.modules e as permissões no Node-1 (rac3-12c) e configure o carregamento automático do modulo fuse na inicialização do Sistema
[root@rac3-12c ~]# cat > /etc/sysconfig/modules/fuse.modules <<EOF
> #!/bin/bash
> /sbin/modprobe fuse
> EOF
[root@rac3-12c ~]# chmod 770 /etc/sysconfig/modules/fuse.modules
[root@rac3-12c ~]# init 6
[root@rac3-12c ~]# cat /etc/sysconfig/modules/fuse.modules
#!/bin/bash
/sbin/modprobe fuse
[root@rac3-12c ~]#
Logue-se como ‘root’ user e configure o fuse.modules e as permissões no Node-2 (rac4-12c e configure o carregamento automático do modulo fuse na inicialização do Sistema
[root@rac3-12c ~]# ssh rac4-12c
root@rac4-12c's password:
Last login: Sun Jul 2 01:51:33 2017 from rac3-12c.localdomain
[root@rac4-12c ~]# cat > /etc/sysconfig/modules/fuse.modules <<EOF
> #!/bin/bash
> /sbin/modprobe fuse
> EOF
[root@rac4-12c ~]# chmod 770 /etc/sysconfig/modules/fuse.modules
[root@rac4-12c ~]# init 6
[root@rac4-12c ~]# cat /etc/sysconfig/modules/fuse.modules
#!/bin/bash
/sbin/modprobe fuse
[root@rac4-12c ~]#
Cheque o módulo fuse no Node-1 (rac3-12c) e Node-2 (rac4-12c) e os privilégios
[root@rac3-12c ~]# lsmod |grep fuse
fuse 78015 0
[root@rac3-12c ~]# ls -l /usr/bin/fusermount
-rwsr-x--- 1 root fuse 32952 Sep 7 2016 /usr/bin/fusermount
[root@rac3-12c ~]# chmod +x /usr/bin/fusermount
[root@rac3-12c ~]# ls -l /usr/bin/fusermount
-rwsr-x--x 1 root fuse 32952 Sep 7 2016 /usr/bin/fusermount
[root@rac3-12c ~]#
[root@rac4-12c ~]# lsmod |grep fuse
fuse 78015 0
[root@rac4-12c ~]# ls -l /usr/bin/fusermount
-rwsr-x--- 1 root fuse 32952 Sep 7 2016 /usr/bin/fusermount
[root@rac4-12c ~]# chmod +x /usr/bin/fusermount
[root@rac4-12c ~]# ls -l /usr/bin/fusermount
-rwsr-x--x 1 root fuse 32952 Sep 7 2016 /usr/bin/fusermount
[root@rac4-12c ~]#
Logue-se como ‘oracle’ user e cheque o ASM e o Database status no Node-1 (rac3-12c)
[oracle@rac3-12c ~]$ ps -ef | grep pmon
oracle 4922 1 0 03:25 ? 00:00:00 asm_pmon_+ASM1
oracle 6268 1 0 03:26 ? 00:00:00 mdb_pmon_-MGMTDB
oracle 6276 1 0 03:26 ? 00:00:00 ora_pmon_orcldb1
oracle 15922 10486 0 03:36 pts/0 00:00:00 grep pmon
[oracle@rac3-12c ~]$
[oracle@rac3-12c ~]$.oraenv
ORACLE_SID = [orcldb1] ? orcldb1
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@rac3-12c ~]$
Logue-se como ‘oracle’ user, depois abra um sqlplus / as sysdba e crie uma tablespace, um usuário e conceda os privilégios para o ambiente DBFS no node-1 (rac3-12c)
[root@rac3-12c ~]# lsmod |grep fuse
fuse 78015 0
[root@rac3-12c ~]# ls -l /usr/bin/fusermount
-rwsr-x--- 1 root fuse 32952 Sep 7 2016 /usr/bin/fusermount
[root@rac3-12c ~]# chmod +x /usr/bin/fusermount
[root@rac3-12c ~]# ls -l /usr/bin/fusermount
-rwsr-x--x 1 root fuse 32952 Sep 7 2016 /usr/bin/fusermount
[root@rac3-12c ~]#
[root@rac4-12c ~]# lsmod |grep fuse
fuse 78015 0
[root@rac4-12c ~]# ls -l /usr/bin/fusermount
-rwsr-x--- 1 root fuse 32952 Sep 7 2016 /usr/bin/fusermount
[root@rac4-12c ~]# chmod +x /usr/bin/fusermount
[root@rac4-12c ~]# ls -l /usr/bin/fusermount
-rwsr-x--x 1 root fuse 32952 Sep 7 2016 /usr/bin/fusermount
[root@rac4-12c ~]#
[oracle@rac3-12c ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Sun Jul 2 03:36:35 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
SQL> CREATE TABLESPACE dbfs_ts datafile SIZE 1M AUTOEXTEND ON NEXT 1M;
Tablespace created.
SQL> CREATE USER dbfs_user IDENTIFIED BY dbfs_user DEFAULT TABLESPACE dbfs_ts QUOTA
UNLIMITED ON dbfs_ts;
User created.
SQL> GRANT CREATE SESSION, RESOURCE, CREATE VIEW, DBFS_ROLE TO dbfs_user;
Grant succeeded.
SQL> exit
Logue-se no sqlplus com o usuário 'dbfs_user' e crie um file system usando 'dbfs_create_filesystem.sql' no Node-1 (rac3-12c)
[oracle@rac3-12c ~]$ cd $ORACLE_HOME/rdbms/admin
[oracle@rac3-12c admin]$ pwd/u01/app/oracle/product/12.1.0.2/db_1/rdbms/admin
[oracle@rac3-12c admin]$ sqlplus dbfs_user/dbfs_user@orcldb
SQL*Plus: Release 12.1.0.2.0 Production on Sun Jul 2 03:39:54 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
SQL> @dbfs_create_filesystem.sql dbfs_ts staging_area
No errors.
-------------
CREATE STORE:
begin dbms_dbfs_sfs.createFilesystem(store_name => 'staging_area', tbl_name =>
'staging_area', tbl_tbs => 'dbfs_ts', lob_tbs => 'dbfs_ts', do_partition =>
false, partition_key => 1, do_compress => false, compression => '', do_dedup =>
false, do_encrypt => false); end;
---------------
REGISTER STORE:
begin dbms_dbfs_content.registerStore(store_name=> 'staging_area', provider_name
=> 'sample1', provider_package => 'dbms_dbfs_sfs'); end;
------------
MOUNT STORE:
begin dbms_dbfs_content.mountStore(store_name=>'staging_area',
store_mount=>'staging_area'); end;
--------
CHMOD STORE:
declare m integer; begin m := dbms_fuse.fs_chmod('/staging_area', 16895); end;
No errors.
SQL>
Logue-se como ‘root’ user e crie o diretório ‘dbfs’ e ajuste as permissões no Node-1 (rac3-12c) e faça um link simbólico conforme abaixo:
[root@rac3-12c ~]# mkdir /dbfs
[root@rac3-12c ~]# chown oracle:oinstall /dbfs/
[root@rac3-12c ~]# ln -s /lib64/libfuse.so.2 /lib64/libfuse.so
[root@rac3-12c ~]# cat /etc/fuse.conf
# mount_max = 1000
# user_allow_other
[root@rac3-12c ~]# vi /etc/fuse.conf
[root@rac3-12c ~]# cat /etc/fuse.conf
# mount_max = 1000
user_allow_other
[root@rac3-12c ~]#
Logue-se como ‘root’ user e crie o diretório ‘dbfs’ e ajuste as permissões no Node-2 (rac4-12c) e faça um link simbólico conforme abaixo:
[root@rac4-12c ~]# mkdir /dbfs
[root@rac4-12c ~]# chown oracle:oinstall /dbfs/
[root@rac4-12c ~]# ln -s /lib64/libfuse.so.2 /lib64/libfuse.so
[root@rac4-12c ~]# cat /etc/fuse.conf
# mount_max = 1000
# user_allow_other
[root@rac4-12c ~]# vi /etc/fuse.conf
[root@rac4-12c ~]# cat /etc/fuse.conf
# mount_max = 1000
user_allow_other
[root@rac4-12c ~]#
Note: Please refer Configuring DBFS on Oracle Exadata Database Machine (Doc ID 1054431.1).
Download zip file contains "mount-dbfs.conf" and "mount-dbfs.sh" and do the changes based
on your environment.
Note: Change the variable settings in mount-dbfs.conf for your environment.
•DBNAME
•MOUNT_POINT
•DBFS_USER
•ORACLE_HOME (should be the RDBMS ORACLE_HOME directory)
•LOGGER_FACILITY (used by syslog to log the messages/output from this script)
•MOUNT_OPTIONS
•DBFS_PASSWD (used only if WALLET=false)
•DBFS_PWDFILE_BASE (used only if WALET=false)
•WALLET (must be true or false)
•TNS_ADMIN (used only if WALLET=true)
•DBFS_LOCAL_TNSALIAS
•IS_PDB (set to true if using PDBs)
•PDB (PDB name, if applicable)
•PDB_SERVICE (PDB, if applicable)
Script-1: mount-dbfs.conf
[root@rac3-12c ~]# cat /etc/oracle/mount-dbfs.conf
### This file provides configuration for mount-dbfs.sh.
### Note 1054431.1 provides information about the setup required to use this script
###########################################
### Everyone must set these values
###########################################
### Database name for the DBFS repository as used in "srvctl status database -d $DBNAME"
### If using PDB/CDB, this should be set to the CDB name
DBNAME=orcldb
### Mount point where DBFS should be mounted
MOUNT_POINT=/dbfs
### Username of the DBFS repository owner in database $DBNAME
DBFS_USER=dbfs_user
### RDBMS ORACLE_HOME directory path
ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/db_1
### GRID HOME directory path
GRID_HOME=/u01/app/12.1.0.2/grid
### Syslog facility name (default user)
### Changed default from local3 to user for Solaris default support on 17-FEB-2012
### This will allow us to log messages to the syslog
### (/var/log/messages on Linux, /var/adm/messages on Solaris)
LOGGER_FACILITY=user
### mount options for dbfs_client; these are used for both wallet and non-wallet mounting
MOUNT_OPTIONS=allow_other,direct_io
### if tracing is required, maybe consider parameter like the example below
### following example is commented out, only uncomment if directed by Oracle Support
### for 11.2.0.3 and earlier, fix_control=32 added per bug 13340960 to allow async statfs
response
#MOUNT_OPTIONS=allow_other,direct_io,fix_control=32,trace_level=1,trace_file=/tmp/dbfs_
client_trace.$$.log,trace_size=100
### for 11.2.0.4 and later, remove fix control
#MOUNT_OPTIONS=allow_other,direct_io,trace_level=1,trace_file=/tmp/dbfs_client_trace.
$$.log,trace_size=100
#MOUNT_OPTIONS=allow_other,direct_io,trace_level=1,trace_file=/tmp/dbfs_client_trace.
log,trace_size=100
### PERL_ALARM_TIMEOUT is number of seconds to wait for response from status command.
### After this, if no respnose, the script will run clean.
### NOTE: If this is longer than the clusterware check interval, bad things may happen.
### Adjust the CHECK_INTERVAL to ensure it is at least 2x as long as PERL_ALARM_TIMEOUT.
### Example:
### $ crsctl status res dbfs_mount -p|grep ^CHECK
### CHECK_INTERVAL=30
### $ crsctl modify res dbfs_mount -attr "CHECK_INTERVAL=32"
### $ crsctl status res dbfs_mount -p|grep ^CHECK
### CHECK_INTERVAL=32
PERL_ALARM_TIMEOUT=14
###########################################
### If using password-based authentication, set these
###########################################
### This is the plain text password for the DBFS_USER user
DBFS_PASSWD=dbfs_user
### The file used to temporarily store the DBFS_PASSWD so dbfs_client can read it
### This file is removed immediately after it is read by dbfs_client
### The actual filename used will have the PID appended to the name for uniqueness
### This variable should be a full pathname including a directory and the first part of
a filename.
DBFS_PWDFILE_BASE=/tmp/.dbfs-passwd.txt
###########################################
### If using wallet-based authentication, modify these
###########################################
### WALLET should be true if using a wallet, otherwise, false
WALLET=false
### TNS_ADMIN is the directory containing tnsnames.ora and sqlnet.ora used by DBFS
TNS_ADMIN=/u01/app/oracle/product/12.1.0.2/db_1/network/admin
### TNS alias used for mounting with wallets
DBFS_LOCAL_TNSALIAS=orcldb
###########################################
### If using PDBs, modify these
###########################################
### Configure the following if this is a Pluggable Database (PDB)
### IS_PDB should be set to "true" or "false"
### PDB should be a TNS alias defined per instructions in Note 1054431.1.
### PDB_SERVICE should be a cluster database service defined per
### instructions in Note 1054431.1.
IS_PDB=false
PDB=pdbXX
PDB_SERVICE=dbfspdb
[root@rac3-12c ~]#
Script-2: mount-dbfs.sh
[oracle@rac3-12c ~]$ cat /u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh
Changes in 251 line
(nohup $DBFS_CLIENT ${DBFS_USER}@orcldb -o $MOUNT_OPTIONS \
Nota: no script-2, ajuste o Oracle SID (Example: orcldb)
Script-3: add_resource.sh
[oracle@rac3-12c ~]$ cat /home/oracle/add_resource.sh
#!/bin/bash
ACTION_SCRIPT=/u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh
RESNAME=dbfs_mount
DBNAME=orcldb
DBNAMEL=`echo $DBNAME | tr A-Z a-z`
ORACLE_HOME=/u01/app/12.1.0.2/grid
PATH=$ORACLE_HOME/bin:$PATH
export PATH ORACLE_HOME
crsctl add resource $RESNAME \
-type local_resource \
-attr "ACTION_SCRIPT=$ACTION_SCRIPT, \
CHECK_INTERVAL=30,RESTART_ATTEMPTS=10, \
START_DEPENDENCIES='hard(ora.$DBNAMEL.db)pullup(ora.$DBNAMEL.db)',\
STOP_DEPENDENCIES='hard(ora.$DBNAMEL.db)',\
SCRIPT_TIMEOUT=300"
[oracle@rac3-12c ~]$
Ajuste as permissões e copie os 3 scripts do Node-1 (rac3-12c) para o Node-2 (rac4-12c)
- chmod 770 /etc/sysconfig/modules/fuse.modules
- chown oracle:oinstall /dbfs/
- chown oracle:dba /u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh
- chmod 770 /u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh
- chown oracle:dba /etc/oracle/mount-dbfs.conf
- chmod 640 /etc/oracle/mount-dbfs.conf
Execute isso com o usuário de S.O com que foi feita a instalação do RDBMS Infrastructure (geralmente oracle) em um database server somente:
[oracle@rac3-12c ~]$./add_resource.sh
Nota: Copiando todos os 3 scritps do Node-1 (rac3-12c) para Node-2 (rac4-12c)
[oracle@rac3-12c ~]$ scp /etc/oracle/mount-dbfs.conf
oracle@192.168.2.202:/etc/oracle/mount-dbfs.conf
mount-dbfs.conf 100% 3855 3.8KB/s 00:00
[oracle@rac3-12c ~]$ scp /u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh
oracle@192.168.2.202:/u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh
mount-dbfs.sh 100% 13KB 13.0KB/s 00:00
[oracle@rac3-12c ~]$ scp /home/oracle/add_resource.sh
oracle@192.168.2.202:/home/oracle/add_resource.sh
add_resource.sh 100% 534 0.5KB/s 00:00
Inicie o ‘dbfs_mount’, assim que ele estiver online irá montar o filesystem em todos os nodes, execute o commando ‘crsctl start resource dbfs_mount’ de qualquer nó do cluster. Isso irá montar o DBFS em todos os nodes.

Cheque com ‘df –h’ e ‘crs_stat –t’ do Node-1 (rac3-12c) para verificar o status do vulume ‘dbfs’.
[oracle@rac3-12c ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_rac1-lv_root 35G 25G 8.6G 75% /
tmpfs 3.0G 143M 2.8G 5% /dev/shm
/dev/sda1 477M 55M 397M 13% /boot
/dev/asm/vol1-320 14G 3.4G 11G 25% /vol1
dbfs-dbfs_user@orcldb:/ 6.0G 576K 6.0G 1% /dbfs
[oracle@rac3-12c ~]$
[oracle@rac3-12c ~]$ . oraenv
ORACLE_SID = [orcldb1] ? +ASM1
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@rac3-12c ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
dbfs_mount local_resource ONLINE ONLINE rac3-12c
ora....L1.advm ora....me.type ONLINE ONLINE rac3-12c
ora.ACFS_DG.dg ora....up.type ONLINE ONLINE rac3-12c
ora.DATA.dg ora....up.type ONLINE ONLINE rac3-12c
ora....ER.lsnr ora....er.type ONLINE ONLINE rac3-12c
ora....N1.lsnr ora....er.type ONLINE ONLINE rac4-12c
ora....N2.lsnr ora....er.type ONLINE ONLINE rac3-12c
ora....N3.lsnr ora....er.type ONLINE ONLINE rac3-12c
ora.MGMTLSNR ora....nr.type ONLINE ONLINE rac3-12c
ora....l1.acfs ora.acfs.type ONLINE ONLINE rac3-12c
ora.asm ora.asm.type ONLINE ONLINE rac3-12c
ora.cvu ora.cvu.type ONLINE ONLINE rac3-12c
ora.mgmtdb ora....db.type ONLINE ONLINE rac3-12c
ora....network ora....rk.type ONLINE ONLINE rac3-12c
ora.oc4j ora.oc4j.type ONLINE ONLINE rac3-12c
ora.ons ora.ons.type ONLINE ONLINE rac3-12c
ora.orcldb.db ora....se.type ONLINE ONLINE rac3-12c
ora....SM1.asm application ONLINE ONLINE rac3-12c
ora....2C.lsnr application ONLINE ONLINE rac3-12c
ora....12c.ons application ONLINE ONLINE rac3-12c
ora....12c.vip ora....t1.type ONLINE ONLINE rac3-12c
ora....SM2.asm application ONLINE ONLINE rac4-12c
ora....2C.lsnr application ONLINE ONLINE rac4-12c
ora....12c.ons application ONLINE ONLINE rac4-12c
ora....12c.vip ora....t1.type ONLINE ONLINE rac4-12c
ora.scan1.vip ora....ip.type ONLINE ONLINE rac4-12c
ora.scan2.vip ora....ip.type ONLINE ONLINE rac3-12c
ora.scan3.vip ora....ip.type ONLINE ONLINE rac3-12c
xag....vip.vip app....px.type ONLINE ONLINE rac3-12c
xag....dengate xag....te.type OFFLINE OFFLINE
[oracle@rac3-12c ~]$
Cheque com ‘df –h’ e ‘crs_stat –t’ do Node-2 (rac4-12c) para verificar o status do vulume ‘dbfs’.
[oracle@rac4-12c ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_rac1-lv_root 35G 20G 14G 59% /
tmpfs 3.0G 142M 2.8G 5% /dev/shm
/dev/sda1 477M 55M 397M 13% /boot
/dev/asm/vol1-320 14G 3.4G 11G 25% /vol1
dbfs-dbfs_user@orcldb:/ 6.0G 576K 6.0G 1% /dbfs
[oracle@rac4-12c ~]$
[oracle@rac4-12c ~]$ . oraenv
ORACLE_SID = [orcldb2] ? +ASM2
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@rac4-12c ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
dbfs_mount local_resource ONLINE ONLINE rac3-12c
ora....L1.advm ora....me.type ONLINE ONLINE rac3-12c
ora.ACFS_DG.dg ora....up.type ONLINE ONLINE rac3-12c
ora.DATA.dg ora....up.type ONLINE ONLINE rac3-12c
ora....ER.lsnr ora....er.type ONLINE ONLINE rac3-12c
ora....N1.lsnr ora....er.type ONLINE ONLINE rac4-12c
ora....N2.lsnr ora....er.type ONLINE ONLINE rac3-12c
ora....N3.lsnr ora....er.type ONLINE ONLINE rac3-12c
ora.MGMTLSNR ora....nr.type ONLINE ONLINE rac3-12c
ora....l1.acfs ora.acfs.type ONLINE ONLINE rac3-12c
ora.asm ora.asm.type ONLINE ONLINE rac3-12c
ora.cvu ora.cvu.type ONLINE ONLINE rac3-12c
ora.mgmtdb ora....db.type ONLINE ONLINE rac3-12c
ora....network ora....rk.type ONLINE ONLINE rac3-12c
ora.oc4j ora.oc4j.type ONLINE ONLINE rac3-12c
ora.ons ora.ons.type ONLINE ONLINE rac3-12c
ora.orcldb.db ora....se.type ONLINE ONLINE rac3-12c
ora....SM1.asm application ONLINE ONLINE rac3-12c
ora....2C.lsnr application ONLINE ONLINE rac3-12c
ora....12c.ons application ONLINE ONLINE rac3-12c
ora....12c.vip ora....t1.type ONLINE ONLINE rac3-12c
ora....SM2.asm application ONLINE ONLINE rac4-12c
ora....2C.lsnr application ONLINE ONLINE rac4-12c
ora....12c.ons application ONLINE ONLINE rac4-12c
ora....12c.vip ora....t1.type ONLINE ONLINE rac4-12c
ora.scan1.vip ora....ip.type ONLINE ONLINE rac4-12c
ora.scan2.vip ora....ip.type ONLINE ONLINE rac3-12c
ora.scan3.vip ora....ip.type ONLINE ONLINE rac3-12c
xag....vip.vip app....px.type ONLINE ONLINE rac3-12c
xag....dengate xag....te.type OFFLINE OFFLINE
[oracle@rac4-12c ~]$
Cheque os status do recurso ‘dbfs_mount’ do Node-1 (rac3-12c) e Node-2 (rac41-2c)
Para desmontar o DBFS de todos os nodes, pare o recurso ‘dbfs_mount’
[oracle@rac3-12c ~]$ crsctl stop res dbfs_mount>
Testando o Oracle DBFS montado em um ambiente clusterizado. Criando o arquivo ‘example.txt’ no Node-1 (rac3-12c) e checando se conseguimos ler o mesmo arquivo pelo Node-2 (rac4-12c).
Use o comando ‘ps’ para localizar o processo do ‘dbfs_client’ no nível do sistema operacional no Node-1 (rac3-12c) e Node-2 (rac4-12c)
Conclusão: Podemos criar e configurar múltiplos Oracle DBFS Filesystems em um ambiente clusterizado para diversos propósitos e benefícios.
Y V Ravi Kumar é um Oracle ACE e Oracle Certified Master (OCM) com 18 anos de experiência em instituições financeiras, serviços financeiros e seguros (BFSI) e atuou em diversos papeis como Senior Database Architect e Production DBA. Ele também é OCP em Oracle 8i, 9i, 10g, 11g & 12c e Certificado em Gulden Gate, RAC, Performance Tuning & Oracle Exadata. Ele continua motivando muitos DBAs e ajudando a Oracle Community publicando suas dicas /ideias/sugestões/suluções em seu blog. Ele escreveu 90+ artigos OTN sobre Oracle Exadata, Oracle RAC e Oracle GuldenGate para a OTN em Espanhul, OTN em Português e OTN em inglês e 19 artigos para a TOAD World, 2 Artigos para o UKOUG, 3 Artigos para OTech Magazine e 2 Artigos para a Redgate. Ele é membro do All India Oracle User Group (AIOUG) e frequente Oracle speaker in @NYOUG, @OTN, AIOUG, Sangam e IOUG. Ele desenha, projeta e implementa Core Banking System (CBS) Databases para o Central Banks em dois países – India e Mahe, Seychelles. Ele é Co-Founder do OraWorld (www.oraworld.com). Leia mais sobre o seu perfil na LaserSoft
Rodrigo Mufalani é um Oracle ACE e Oracle Certified Master (OCM) com mais de 14 anos de experiência, começou com o Oracle 8i, mas teve a oportunidade de dar suporte a Oracle 7.3.4 em diante. É especialista em banco de dados Oracle com foco principal em Performance & Tuning e RAC. É palestrante em eventos de Oracle como: OTN LAD TOUR e outros. Atualmente trabalha como consultor diversas empresas no segmento de variados ramos como: Educação, Saúde, Tecnulogia, Seguros e etc. Foi o terceiro Oracle ACE a ser nomeado no Brasil e é OCP nas versões 10g, 11g e 12c. Atualmente é DBA na eProseed. Twitter @mufalani / blog www.mufalani.com.br/blog
Archana Durai tem mais 7+ anos de experiência como Oracle Database Administrator e tem expertise em vários Sistemas RDBMS. Ela tem experiência em muitos domínios como Life Sciences e Media & Communications. Ela é Oracle Certified Professional 9i, 10g, 11g e 12c e certificada em Oracle GuldenGate e Real Application Clusters (RAC), IBM DB2 Certified Administrator (v10.1). Além disso, ela possui a certifação Red Hat Certified Engineer (RHCE) e ITIL V3 Foundation.
Este artigo foi revisto pela equipe de produtos Oracle e está em conformidade com as normas e práticas para o uso de produtos Oracle.