Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
oracle_dbfs [2020/11/03 15:42] – andonovj | oracle_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 / | [root@ol6-121-rac1 ~]# ls –ld / | ||
drwxr-xr-x 2 oracle dba 4096 Nov 3 02:26 / | drwxr-xr-x 2 oracle dba 4096 Nov 3 02:26 / | ||
+ | [root@ol6-121-rac1 ~]# | ||
+ | </ | ||
+ | |||
+ | Optionally we can configure NOCACHE for the LOB of the 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, | ||
+ | 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, | ||
+ | dba_lobs WHERE tablespace_name=' | ||
+ | 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, | ||
+ | Storage Management, OLAP, | ||
+ | Advanced Analytics and Real Application Testing options | ||
[root@ol6-121-rac1 ~]# | [root@ol6-121-rac1 ~]# | ||
</ | </ | ||
Line 137: | Line 172: | ||
=====Management===== | =====Management===== | ||
- | Finally we can start it as follows: | + | The management of DBFS, includes, stop/start and registartion in the Grid Infra: |
+ | ====Start/ | ||
< | < | ||
+ | --Mount | ||
[oracle@ol6-121-rac1 admin]$ id | [oracle@ol6-121-rac1 admin]$ id | ||
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall), | uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall), | ||
Line 160: | Line 197: | ||
install | install | ||
dbfs-dbfs_user@:/ | dbfs-dbfs_user@:/ | ||
+ | [oracle@ol6-121-rac1 admin]$ | ||
+ | |||
+ | --Unmount | ||
+ | [oracle@ol6-121-rac1 admin]$ / | ||
+ | unmounting DBFS from / | ||
+ | umounting the filesystem using '/ | ||
+ | Stop - stopped, now not mounted | ||
+ | [oracle@ol6-121-rac1 admin]$ df -h | ||
+ | Filesystem | ||
+ | / | ||
+ | | ||
+ | tmpfs | ||
+ | / | ||
+ | install | ||
[oracle@ol6-121-rac1 admin]$ | [oracle@ol6-121-rac1 admin]$ | ||
</ | </ | ||
+ | ====Register DBFS into Grid Infra==== | ||
+ | We can register the DBFS into Grid infra and though allow failover if the instance crashes: | ||
+ | |||
+ | < | ||
+ | [OS prompt]$ cp / | ||
+ | [OS prompt]$ cd ~ | ||
+ | [OS prompt]$ chmod +x add-dbfs-resource.sh | ||
+ | [OS prompt]$ cat add-dbfs-resource.sh | ||
+ | [oracle@ol6-121-rac1 ~]$ ./ | ||
+ | [oracle@ol6-121-rac1 ~]$ grid_env | ||
+ | [oracle@ol6-121-rac1 ~]$ crsctl stat res dbfs_mount | ||
+ | NAME=dbfs_mount | ||
+ | TYPE=local_resource | ||
+ | TARGET=OFFLINE, | ||
+ | STATE=OFFLINE, | ||
+ | [oracle@ol6-121-rac1 ~]$ crsctl start res dbfs_mount | ||
+ | CRS-2672: Attempting to start ' | ||
+ | CRS-2672: Attempting to start ' | ||
+ | CRS-2676: Start of ' | ||
+ | CRS-2676: Start of ' | ||
+ | [oracle@ol6-121-rac1 ~]$ crsctl stat res dbfs_mount | ||
+ | NAME=dbfs_mount | ||
+ | TYPE=local_resource | ||
+ | TARGET=ONLINE | ||
+ | STATE=ONLINE on ol6-121-rac1, | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | =====Appendix===== | ||
+ | Below you can find the script we have used. | ||
- | ==Appendix== | + | < |
- | < | + | |
- | [root@ol6-121-rac1 script]# cat / | + | |
#!/bin/bash | #!/bin/bash | ||
Line 605: | Line 685: | ||
esac | esac | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | ##### start script add-dbfs-resource.sh | ||
+ | #!/bin/bash | ||
+ | ACTION_SCRIPT=/ | ||
+ | RESNAME=dbfs_mount | ||
+ | DBNAME=OGGRAC | ||
+ | DBNAMEL=`echo $DBNAME | tr A-Z a-z` | ||
+ | ORACLE_HOME=/ | ||
+ | PATH=$ORACLE_HOME/ | ||
+ | export PATH ORACLE_HOME | ||
+ | crsctl add resource $RESNAME \ | ||
+ | -type local_resource \ | ||
+ | -attr " | ||
+ | CHECK_INTERVAL=30, | ||
+ | START_DEPENDENCIES=' | ||
+ | ',\ | ||
+ | STOP_DEPENDENCIES=' | ||
+ | SCRIPT_TIMEOUT=300" | ||
+ | ##### end script add-dbfs-resource.sh | ||
</ | </ |