oracle_dbfs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
oracle_dbfs [2020/11/03 15:36] andonovjoracle_dbfs [2020/11/03 16:08] (current) andonovj
Line 9: Line 9:
   - Edit FUSE config (that is the config file for the FUSE package needed for the DBFS.   - Edit FUSE config (that is the config file for the FUSE package needed for the DBFS.
   - Create folder (owned under oracle user and dba group)   - Create folder (owned under oracle user and dba group)
-  - Create a tablespace which will be registered with the DBFS (that tablespace won't reside on the DBFS, but it is needed for configuration)+  - Create a tablespace which will host the DBFS 
   - Create user with the necessary permission   - Create user with the necessary permission
   - Create the DBFS env on the database   - Create the DBFS env on the database
Line 30: Line 30:
 [root@ol6-121-rac1 ~]# ls –ld /oracle/dbfs_direct [root@ol6-121-rac1 ~]# ls –ld /oracle/dbfs_direct
 drwxr-xr-x 2 oracle dba 4096 Nov  3 02:26 /oracle/dbfs_direct/ drwxr-xr-x 2 oracle dba 4096 Nov  3 02:26 /oracle/dbfs_direct/
 +[root@ol6-121-rac1 ~]#
 +</Code>
 +
 +Optionally we can configure NOCACHE for the LOB of the DBFS table:
 +
 +<Code:bash|Modify DBFS table>
 +[root@ol6-121-rac1 ~]# echo $ORACLE_SID
 +OGGRAC1
 +[root@ol6-121-rac1 ~]# sqlplus / as sysdba
 +SQL*Plus: Release 12.1.0.2.0 Production on Mon Mar 30 22:20:19
 +2015
 +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> ALTER TABLE DBFS_USER.FS1 MODIFY LOB (FILEDATA) (NOCACHE
 +LOGGING);
 +Table altered.
 +SQL> column owner format a10
 +SQL> column table_name format a15
 +SQL> column segment_name format a15
 +SQL> SELECT owner,table_name,segment_name,logging,cache FROM
 +dba_lobs WHERE tablespace_name='DBFS_TS';
 +OWNER TABLE_NAME SEGMENT_NAME LOGGING CACHE
 +---------- ------------- -------------------- ------- ----------
 +DBFS_USER FS1 LOB_SFS$_FST_1 YES NO
 +SQL> exit
 +Disconnected from 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
 [root@ol6-121-rac1 ~]# [root@ol6-121-rac1 ~]#
 </Code> </Code>
Line 136: Line 171:
  
  
 +=====Management=====
 +The management of DBFS, includes, stop/start and registartion in the Grid Infra:
  
-==Appendix== +====Start/Stop==== 
-<Code:bash|Mount dbfs.sh> +<Code:bash|Start DBFS> 
-[root@ol6-121-rac1 script]# cat /media/sf_install/mount-dbfs.sh+--Mount 
 +[oracle@ol6-121-rac1 admin]$ id 
 +uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),492(vboxsf),54322(dba) 
 +[oracle@ol6-121-rac1 admin]$ /u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh start 
 +mount-dbfs.sh mounting DBFS at /oracle/dbfs_direct from database OGGRAC 
 +ORACLE_SID is OGGRAC1 
 +spawning dbfs_client command using SID OGGRAC1 
 +nohup: redirecting stderr to stdout 
 +Start -- ONLINE 
 +[oracle@ol6-121-rac1 admin]$  
 +[oracle@ol6-121-rac1 admin]$ /u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh status 
 +Checking status now 
 +Check -- ONLINE 
 +[oracle@ol6-121-rac1 admin]$ df -h 
 +Filesystem            Size  Used Avail Use% Mounted on 
 +/dev/mapper/vg_ol6121rac1-lv_root 
 +                       46G   19G   25G  43% / 
 +tmpfs                 1.9G  628M  1.2G  34% /dev/shm 
 +/dev/sda1             477M   66M  382M  15% /boot 
 +install               402G  190G  212G  48% /media/sf_install 
 +dbfs-dbfs_user@:/     3.0G  120K  3.0G   1% /oracle/dbfs_direct 
 +[oracle@ol6-121-rac1 admin]$  
 + 
 +--Unmount 
 +[oracle@ol6-121-rac1 admin]$ /u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh stop 
 +unmounting DBFS from /oracle/dbfs_direct 
 +umounting the filesystem using '/bin/fusermount -u /oracle/dbfs_direct' 
 +Stop - stopped, now not mounted 
 +[oracle@ol6-121-rac1 admin]$ df -h 
 +Filesystem            Size  Used Avail Use% Mounted on 
 +/dev/mapper/vg_ol6121rac1-lv_root 
 +                       46G   19G   25G  43% / 
 +tmpfs                 1.9G  628M  1.2G  34% /dev/shm 
 +/dev/sda1             477M   66M  382M  15% /boot 
 +install               402G  190G  212G  48% /media/sf_install 
 +[oracle@ol6-121-rac1 admin]$  
 +</Code> 
 + 
 +====Register DBFS into Grid Infra==== 
 +We can register the DBFS into Grid infra and though allow failover if the instance crashes: 
 + 
 +<Code:bash|Register DBFS into Grid Infra> 
 +[OS prompt]$ cp /media/sf_install/add-dbfs-resource.sh ~ 
 +[OS prompt]$ cd ~ 
 +[OS prompt]$ chmod +x add-dbfs-resource.sh 
 +[OS prompt]$ cat add-dbfs-resource.sh 
 +[oracle@ol6-121-rac1 ~]$ ./add-dbfs-resource.sh 
 +[oracle@ol6-121-rac1 ~]$ grid_env 
 +[oracle@ol6-121-rac1 ~]$ crsctl stat res dbfs_mount 
 +NAME=dbfs_mount 
 +TYPE=local_resource 
 +TARGET=OFFLINE, OFFLINE 
 +STATE=OFFLINE, OFFLINE 
 +[oracle@ol6-121-rac1 ~]$ crsctl start res dbfs_mount 
 +CRS-2672: Attempting to start 'dbfs_mount' on 'ol6-121-rac1' 
 +CRS-2672: Attempting to start 'dbfs_mount' on 'ol6-121-rac2' 
 +CRS-2676: Start of 'dbfs_mount' on 'ol6-121-rac2' succeeded 
 +CRS-2676: Start of 'dbfs_mount' on 'ol6-121-rac1' succeeded 
 +[oracle@ol6-121-rac1 ~]$ crsctl stat res dbfs_mount 
 +NAME=dbfs_mount 
 +TYPE=local_resource 
 +TARGET=ONLINE                , ONLINE 
 +STATE=ONLINE on ol6-121-rac1, ONLINE on ol6-121-rac2 
 +</Code> 
 + 
 + 
 + 
 +=====Appendix===== 
 +Below you can find the script we have used. 
 + 
 +<Code:bash|mount-dbfs.sh>
 #!/bin/bash #!/bin/bash
  
Line 578: Line 685:
  
 esac esac
 +</Code>
 +
 +<Code:bash|add-dbfs-resource.sh>
 +##### start script add-dbfs-resource.sh
 +#!/bin/bash
 +ACTION_SCRIPT=/u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh
 +RESNAME=dbfs_mount
 +DBNAME=OGGRAC
 +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"
 +##### end script add-dbfs-resource.sh
 </Code> </Code>
  • oracle_dbfs.1604417793.txt.gz
  • Last modified: 2020/11/03 15:36
  • by andonovj