Wednesday, August 15, 2018

CREATE A DBFS FILE SYSTEM ON EXADATA

CREATE A DBFS FILE SYSTEM ON EXADATA


Step 1: Check if user oracle is member of the fuse group
        If no run below

dcli -g dbs_group -l root usermod -a -G fuse oracle

Step 2: Create a directory for the dbfs file system on all compute nodes + grant permissions

[root@exadm4db01 oracle]# dcli -g dbs_group -l root mkdir -p /dbfs_mounts
[root@exadm4db01 oracle]# dcli -g dbs_group -l root chown oracle:dba /dbfs_mounts
[root@exadm4db01 oracle]# dcli -g dbs_group -l root chmod 644 /etc/fuse.conf
[root@exadm4db01 oracle]# ls -l /bin/fusermount

-rwsr-x--x 1 root fuse 27072 Oct 17  2011 /bin/fusermount

[root@exadm4db01 oracle]# dcli -g dbs_group -l root chmod o+rx /bin/fusermount

[root@exadm4db01 oracle]# ls -l /bin/fusermount

-rwsr-xr-x 1 root fuse 27072 Oct 17  2011 /bin/fusermount

Step 3: create a database “DBFS” with the dbca

Create 12.1.0.2 database DBFS since the databases need to be converted are 12.1.0.2
 
Start the dbca and create database DBFS. Some specifications:
Database Template => general purpose or transaction processing
Database Identication => Admin managed, Global database name = DBFS, select all compute nodes
Database File Locations => choose +DBFS_DG as the data diskgroup, do not multiplex redo logs and controlfiles
Recovery Configuration => do not specify a fast recovery area
Initialization Parameters => choose 256 MB for PGA and 512 for SGA
Character Sets => choose UNICODE AL32UTF8, leave everything else default (such as Language to American, etc)
change compatible to 12.1.0.2
Initialization Parameters => leave all defaults,except parallel_max_servers, place on 2
Now the DBCA can run and create the DBFS database with 8 instances (one on every compute node)

Step 4: Add all the instances to the oratab

Step 5: Create a tablespace and dbfs_user in the database

SQL> create bigfile tablespace TS_DBFS datafile size 1G autoextend on next 1G maxsize      10G NOLOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL AUTOALLOCATE  SEGMENT SPACE MANAGEMENT AUTO;
SQL> create user dbfs_user identified by dbfs_user default tablespace ts_dbfs quota unlimited on ts_dbfs;
SQL> grant create session, create table, create procedure, dbfs_role to dbfs_user;

Step 6: Connect as the dbfs_user and run the special procedure to create the dbfs filesystem

[oracle@exadm4db01 admin]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Wed Feb 20 11:54:39 2013

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> connect dbfs_user/dbfs_user
Connected.
SQL> start dbfs_create_filesystem_advanced ts_dbfs admin nocompress nodeduplicate noencrypt non-partition;
No errors.
--------
CREATE STORE:
begin dbms_dbfs_sfs.createFilesystem(store_name => 'FS_ADMIN', tbl_name =>
'T_ADMIN', tbl_tbs => 'ts_dbfs', lob_tbs => 'ts_dbfs', 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=> 'FS_ADMIN', provider_name =>
'sample1', provider_package => 'dbms_dbfs_sfs'); end;
--------
MOUNT STORE:
begin dbms_dbfs_content.mountStore(store_name=>'FS_ADMIN',
store_mount=>'admin'); end;
--------
CHMOD STORE:
declare m integer; begin m := dbms_fuse.fs_chmod('/admin', 16895); end;
No errors.

Step 7: Download ‘mount-dbfs.sh’ from Oracle website, and edit it like below:

From Oracle node: 1054431.1
made the necessary changes on the file to fit the current environment

Step 8: Execute the statements below:

dcli -g dbs_group -l root -d /u01/app/12.1.0.2/grid/crs/script -f /tmp/mount-dbfs.sh
dcli -g dbs_group -l root chown oracle:dba /u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh
dcli -g dbs_group -l root chmod 750 /u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh

ACTION_SCRIPT=/u01/app/12.1.0.2/grid/crs/script/mount-dbfs.sh
RESNAME=dbfs_admin_mount
DBNAME=dbfs
ORACLE_HOME=/u01/app/12.1.0.2/grid
export PATH ORACLE_HOME

[oracle@exadm4db01 tmp]$ crsctl add resource $RESNAME \
> -type local_resource \
> -attr "ACTION_SCRIPT=$ACTION_SCRIPT, \
> CHECK_INTERVAL=30, \
> START_DEPENDENCIES='hard(ora.$DBNAME.db)pullup(ora.$DBNAME.db)',\
> STOP_DEPENDENCIES='hard(ora.$DBNAME.db)',\
> SCRIPT_TIMEOUT=300"

Step 9: Start the resources

/* viewing current status */

[oracle@exadm4db01 tmp]$ crsctl stat res dbfs_admin_mount -t
-----------------------------------------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
-----------------------------------------------------------------------------------------------------------------
dbfs_admin_mount
               OFFLINE OFFLINE      exadm4db01
               OFFLINE OFFLINE      exadm4db02
               OFFLINE OFFLINE      exadm4db03
               OFFLINE OFFLINE      exadm4db04

/* run below command to start the resources */

 [oracle@exadm4db01 ~]$ crsctl start resource dbfs_admin_mount

CRS-2672: Attempting to start 'dbfs_admin_mount' on 'exadm4db03'
CRS-2672: Attempting to start 'dbfs_admin_mount' on 'exadm4db01'
CRS-2672: Attempting to start 'dbfs_admin_mount' on 'exadm4db02'
CRS-2672: Attempting to start 'dbfs_admin_mount' on 'exadm4db04'
CRS-2676: Start of 'dbfs_admin_mount' on 'exadm4db01' succeeded
CRS-2676: Start of 'dbfs_admin_mount' on 'exadm4db03' succeeded
CRS-2676: Start of 'dbfs_admin_mount' on 'exadm4db04' succeeded
CRS-2676: Start of 'dbfs_admin_mount' on 'exadm4db02' succeeded

[oracle@exadm4db01 ~]$ crsctl stat res dbfs_admin_mount -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
dbfs_admin_mount
               ONLINE  ONLINE       exadm4db01
               ONLINE  ONLINE       exadm4db02
               ONLINE  ONLINE       exadm4db03
               ONLINE  ONLINE       exadm4db04

======================================


Related Documents:

– 1191144.1 - Configuring a Database for DBFS on Oracle
Database Database Machine
Create a database to hold the DBFS repository

– 1054431.1 - Configuring DBFS on Oracle Database Machine


No comments:

Post a Comment