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:28] – 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 98: | Line 133: | ||
No errors. | No errors. | ||
SQL> | SQL> | ||
+ | </ | ||
+ | |||
+ | Configure the libraries: | ||
+ | |||
+ | < | ||
+ | [oracle@ol6-121-rac1 admin]$ su - | ||
+ | Password: | ||
+ | [root@ol6-121-rac1 ~]# echo "/ | ||
+ | [root@ol6-121-rac1 ~]# cat / | ||
+ | / | ||
+ | [root@ol6-121-rac1 ~]# cd / | ||
+ | [root@ol6-121-rac1 lib]# pwd | ||
+ | / | ||
+ | [root@ol6-121-rac1 lib]# ln -s / | ||
+ | [root@ol6-121-rac1 lib]# ln -s / | ||
+ | [root@ol6-121-rac1 lib]# ln -s / | ||
+ | [root@ol6-121-rac1 lib]# ls -l | ||
+ | total 0 | ||
+ | lrwxrwxrwx 1 root root 44 Nov 3 03:16 libclntsh.so.12.1 -> / | ||
+ | lrwxrwxrwx 1 root root 19 Nov 3 03:17 libfuse.so -> / | ||
+ | lrwxrwxrwx 1 root root 38 Nov 3 03:17 libnnz12.so -> / | ||
+ | [root@ol6-121-rac1 lib]# | ||
+ | [root@ol6-121-rac1 lib]# ldconfig | ||
+ | [root@ol6-121-rac1 lib]# ln -s / | ||
+ | [root@ol6-121-rac1 lib]# ls -l / | ||
+ | lrwxrwxrwx 1 root root 38 Nov 3 03:17 / | ||
+ | [root@ol6-121-rac1 lib]# chmod +x / | ||
+ | [root@ol6-121-rac1 lib]# cd / | ||
+ | [root@ol6-121-rac1 script]# cp / | ||
+ | [root@ol6-121-rac1 script]# | ||
+ | [root@ol6-121-rac1 script]# chown oracle.dba mount-dbfs.sh | ||
+ | [root@ol6-121-rac1 script]# chmod 750 mount-dbfs.sh | ||
+ | [root@ol6-121-rac1 script]# ls -l | ||
+ | total 16 | ||
+ | -rwxr-x--- 1 oracle dba 14083 Nov 3 03:29 mount-dbfs.sh | ||
+ | </ | ||
+ | |||
+ | |||
+ | =====Management===== | ||
+ | The management of DBFS, includes, stop/start and registartion in the Grid Infra: | ||
+ | |||
+ | ====Start/ | ||
+ | < | ||
+ | --Mount | ||
+ | [oracle@ol6-121-rac1 admin]$ id | ||
+ | uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall), | ||
+ | [oracle@ol6-121-rac1 admin]$ / | ||
+ | mount-dbfs.sh mounting DBFS at / | ||
+ | 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]$ / | ||
+ | Checking status now | ||
+ | Check -- ONLINE | ||
+ | [oracle@ol6-121-rac1 admin]$ df -h | ||
+ | Filesystem | ||
+ | / | ||
+ | | ||
+ | tmpfs | ||
+ | / | ||
+ | install | ||
+ | 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]$ | ||
+ | </ | ||
+ | |||
+ | ====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. | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | |||
+ | ### This script is from Note 1054431.1, ensure you have the latest version | ||
+ | ### Note 1054431.1 provides information about the setup required to use this script | ||
+ | |||
+ | ### updated 23-DEC-2014 | ||
+ | |||
+ | ########################################### | ||
+ | ### Everyone must set these values | ||
+ | ########################################### | ||
+ | ### Database name for the DBFS repository as used in " | ||
+ | DBNAME=OGGRAC | ||
+ | |||
+ | ### Mount point where DBFS should be mounted | ||
+ | MOUNT_POINT=/ | ||
+ | |||
+ | ### Username of the DBFS repository owner in database $DBNAME | ||
+ | DBFS_USER=dbfs_user | ||
+ | |||
+ | ### RDBMS ORACLE_HOME directory path | ||
+ | ORACLE_HOME=/ | ||
+ | |||
+ | ### 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 | ||
+ | ### (/ | ||
+ | LOGGER_FACILITY=user | ||
+ | |||
+ | ### mount options for dbfs_client; | ||
+ | MOUNT_OPTIONS=allow_other, | ||
+ | ### if tracing is required, maybe consider parameter like the example below | ||
+ | ### following example is commented out, only uncomment if directed by Oracle Support | ||
+ | ### fix_control=32 added per bug 13340960 to allow async statfs response | ||
+ | # | ||
+ | |||
+ | ### 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. | ||
+ | ### | ||
+ | ### | ||
+ | ### $ crsctl status res dbfs_mount -p|grep ^CHECK | ||
+ | ### | ||
+ | ### $ crsctl modify res dbfs_mount -attr " | ||
+ | ### $ crsctl status res dbfs_mount -p|grep ^CHECK | ||
+ | ### | ||
+ | PERL_ALARM_TIMEOUT=14 | ||
+ | |||
+ | ########################################### | ||
+ | ### If using password-based authentication, | ||
+ | ########################################### | ||
+ | ### This is the plain text password for the DBFS_USER user | ||
+ | DBFS_PASSWD=oracle | ||
+ | |||
+ | ### 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=/ | ||
+ | |||
+ | ########################################### | ||
+ | ### If using wallet-based authentication, | ||
+ | ########################################### | ||
+ | ### 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=/ | ||
+ | |||
+ | ### TNS alias used for mounting with wallets | ||
+ | DBFS_LOCAL_TNSALIAS=fsdb.local | ||
+ | |||
+ | ########################################### | ||
+ | ### No editing is required below this point | ||
+ | ########################################### | ||
+ | ### determine platform | ||
+ | UNAME_S=`uname -s` | ||
+ | if [ $UNAME_S = ' | ||
+ | elif [ $UNAME_S = ' | ||
+ | fi | ||
+ | |||
+ | GREP=/ | ||
+ | AWK=/ | ||
+ | ECHO=/ | ||
+ | LOGGER="/ | ||
+ | RMF='/ | ||
+ | TOUCH=/ | ||
+ | CHMOD=/ | ||
+ | PS=/bin/ps | ||
+ | SLEEP=/ | ||
+ | KILL=/ | ||
+ | BASENAME=/ | ||
+ | STAT=/ | ||
+ | ID=/ | ||
+ | WC=/ | ||
+ | SRVCTL=$ORACLE_HOME/ | ||
+ | DBFS_CLIENT=$ORACLE_HOME/ | ||
+ | HN=/ | ||
+ | PERL=/ | ||
+ | MOUNT=/ | ||
+ | ### ensure messages are displayed in English for pattern matching | ||
+ | LANG=en_US.UTF-8 | ||
+ | NLS_LANG=American_America.AL32UTF8 | ||
+ | NUMACTL=/ | ||
+ | RPMCTL=/ | ||
+ | |||
+ | if [ -z " | ||
+ | |||
+ | if [ $LINUX -eq 1 ]; then | ||
+ | MOUNT=/ | ||
+ | XARGS='/ | ||
+ | FUSERMOUNT=/ | ||
+ | LD_LIBRARY_PATH=$ORACLE_HOME/ | ||
+ | elif [ $SOLARIS -eq 1 ]; then | ||
+ | MOUNT=/ | ||
+ | XARGS=/ | ||
+ | UMOUNT=/ | ||
+ | LD_LIBRARY_PATH=$ORACLE_HOME/ | ||
+ | fi | ||
+ | |||
+ | DBFS_PWDFILE=$DBFS_PWDFILE_BASE.$$ | ||
+ | |||
+ | export ORACLE_HOME LD_LIBRARY_PATH TNS_ADMIN | ||
+ | export STAT MOUNT_POINT PERL_ALARM_TIMEOUT SOLARIS LINUX | ||
+ | export PATH=$ORACLE_HOME/ | ||
+ | export STATUS_TIMEOUT | ||
+ | export LANG NLS_LANG | ||
+ | |||
+ | logit () { | ||
+ | ### type: info, error, debug | ||
+ | type=$1 | ||
+ | msg=$2 | ||
+ | if [ " | ||
+ | $ECHO $msg | ||
+ | $LOGGER -p ${LOGGER_FACILITY}.info " | ||
+ | elif [ " | ||
+ | $ECHO $msg | ||
+ | $LOGGER -p ${LOGGER_FACILITY}.error " | ||
+ | elif [ " | ||
+ | $ECHO $msg | ||
+ | $LOGGER -p ${LOGGER_FACILITY}.debug " | ||
+ | fi | ||
+ | } | ||
+ | |||
+ | ### must not be root | ||
+ | if [ `$ID -u` -eq 0 ]; then | ||
+ | logit error "Run this as the Oracle software owner, not root" | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | ### determine how we were called, derive location | ||
+ | SCRIPTPATH=$0 | ||
+ | SCRIPTNAME=`$BASENAME $SCRIPTPATH` | ||
+ | |||
+ | echo $SCRIPTPATH | grep ^/ > /dev/null 2>&1 | ||
+ | if [ $? -ne 0 ]; then | ||
+ | MYDIR=`pwd` | ||
+ | SCRIPTPATH=${MYDIR}/ | ||
+ | fi | ||
+ | |||
+ | ### must cd to a directory where the oracle owner can get CWD | ||
+ | cd /tmp | ||
+ | |||
+ | case " | ||
+ | ' | ||
+ | logit info " | ||
+ | |||
+ | ### check to see if it is already mounted | ||
+ | $SCRIPTPATH status > /dev/null 2>&1 | ||
+ | if [ $? -eq 0 ]; then | ||
+ | logit error " | ||
+ | $SCRIPTPATH status | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | ### set the ORACLE_SID dynamically based on OCR info, if it is running | ||
+ | export ORACLE_SID=$($SRVCTL status instance -d $DBNAME -n `$HN` | \ | ||
+ | $GREP 'is running' | ||
+ | # if single instance, set ORACLE_SID based on below command instead | ||
+ | if [ -z " | ||
+ | export ORACLE_SID=$($SRVCTL config db -d $DBNAME | $GREP ' | ||
+ | fi | ||
+ | logit info " | ||
+ | |||
+ | ### if there' | ||
+ | if [ -z " | ||
+ | logit error "No running ORACLE_SID available on this host, exiting" | ||
+ | exit 2 | ||
+ | fi | ||
+ | |||
+ | ### version comparison function, used in numa section | ||
+ | # Compare string versions | ||
+ | # Returns in stdout and in the err code | ||
+ | # 0 - a equal b | ||
+ | # 1 - a greater than b | ||
+ | # 255(-1) | ||
+ | # version should be in format 1.2.3.4.5 | ||
+ | # It might be a short version like 1.2.3 or 1.2.3. | ||
+ | version_cmp () | ||
+ | { | ||
+ | local -a al=(`echo $1 | sed -e 's/\./ /g'`) | ||
+ | local -a bl=(`echo $2 | sed -e 's/\./ /g'`) | ||
+ | |||
+ | local -i i=0 | ||
+ | for ((i=0; i < ${#al[@]}; i++)); do | ||
+ | # ap is always non-empty. Gap is not possible in both arrays | ||
+ | local ap=${al[$i]} | ||
+ | local bp=${bl[$i]} | ||
+ | # Only $ap defined. $a longer (bigger) then $b | ||
+ | if [ -z " | ||
+ | echo " | ||
+ | return 1 | ||
+ | elif [ $ap -lt $bp ]; then | ||
+ | echo " | ||
+ | return -1 | ||
+ | fi | ||
+ | done | ||
+ | # Check for the next part from @bl. It means $a shorter (smaller) then $b | ||
+ | if [ -n " | ||
+ | echo " | ||
+ | return -1 | ||
+ | fi | ||
+ | # Both arrays ended at the same time. They are equal | ||
+ | echo " | ||
+ | return 0 | ||
+ | } | ||
+ | | ||
+ | ### if numa system, update mount_options for bug 10004611 | ||
+ | RPMEXA=`$RPMCTL -q --queryformat ' | ||
+ | NUMASYS=`$NUMACTL --hardware | grep available: | cut -c1-18` | ||
+ | ###Check if an X8 system and image greater than or equal to 11.2.3.3.0 to support numa mount option | ||
+ | if [ " | ||
+ | if [ `version_cmp $RPMEXA 11.2.3.3.0` -eq 0 ] || [ `version_cmp $RPMEXA 11.2.3.3.0` -eq 1 ]; then | ||
+ | MOUNT_OPTIONS=$MOUNT_OPTIONS, | ||
+ | else | ||
+ | MOUNT_OPTIONS=$MOUNT_OPTIONS | ||
+ | fi | ||
+ | ###Check if an X5-2 system to support numa mount option | ||
+ | elif [ " | ||
+ | MOUNT_OPTIONS=$MOUNT_OPTIONS, | ||
+ | ###Check for all other X2 systems, do not use numa option | ||
+ | elif [ " | ||
+ | MOUNT_OPTIONS=$MOUNT_OPTIONS | ||
+ | ###Exit for errors or unexpected values, post in / | ||
+ | else | ||
+ | logit error " | ||
+ | logit error "Numa hardware value is: $NUMASYS" | ||
+ | logit error "RPM version of Exadata base is: $RPMEXA" | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | ### if using password-based startup, use this | ||
+ | if [ " | ||
+ | $RMF $DBFS_PWDFILE | ||
+ | if [ -f $DBFS_PWDFILE ]; then | ||
+ | logit error " | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | $TOUCH $DBFS_PWDFILE | ||
+ | $CHMOD 600 $DBFS_PWDFILE | ||
+ | $ECHO $DBFS_PASSWD > $DBFS_PWDFILE | ||
+ | |||
+ | logit info " | ||
+ | |||
+ | (nohup $DBFS_CLIENT ${DBFS_USER}@ -o $MOUNT_OPTIONS \ | ||
+ | $MOUNT_POINT < $DBFS_PWDFILE | $LOGGER -p ${LOGGER_FACILITY}.info 2>&1 & ) & | ||
+ | |||
+ | elif [ " | ||
+ | logit info "doing mount $MOUNT_POINT using SID $ORACLE_SID with wallet now" | ||
+ | (nohup $DBFS_CLIENT / | ||
+ | $MOUNT_POINT | $LOGGER -p ${LOGGER_FACILITY}.info 2>&1 & ) & | ||
+ | fi | ||
+ | |||
+ | ### allow time for the mount table update before checking it | ||
+ | $SLEEP 1 | ||
+ | ### set return code based on success of mounting | ||
+ | $SCRIPTPATH status > /dev/null 2>&1 | ||
+ | if [ $? -eq 0 ]; then | ||
+ | logit info "Start -- ONLINE" | ||
+ | exit 0 | ||
+ | else | ||
+ | logit info "Start -- OFFLINE" | ||
+ | exit 1 | ||
+ | fi | ||
+ | | ||
+ | $RMF $DBFS_PWDFILE | ||
+ | ;; | ||
+ | |||
+ | ' | ||
+ | $SCRIPTPATH status > /dev/null | ||
+ | if [ $? -eq 0 ]; then | ||
+ | logit info " | ||
+ | if [ $LINUX -eq 1 ]; then | ||
+ | logit info " | ||
+ | $FUSERMOUNT -u $MOUNT_POINT | ||
+ | elif [ $SOLARIS -eq 1 ]; then | ||
+ | logit info " | ||
+ | $UMOUNT $MOUNT_POINT > /dev/null 2>&1 | ||
+ | fi | ||
+ | $SCRIPTPATH status > /dev/null | ||
+ | if [ $? -eq 0 ]; then | ||
+ | logit error "Stop - stopped, but still mounted, error" | ||
+ | exit 1 | ||
+ | else | ||
+ | logit info "Stop - stopped, now not mounted" | ||
+ | exit 0 | ||
+ | fi | ||
+ | else | ||
+ | logit error " | ||
+ | fi | ||
+ | ;; | ||
+ | |||
+ | ' | ||
+ | ### check to see if it is mounted | ||
+ | ### fire off a short process in perl to do the check (need the alarm builtin) | ||
+ | logit debug " | ||
+ | $PERL <<' | ||
+ | $timeout = $ENV{' | ||
+ | $SIG{ALRM} = sub { | ||
+ | ### we have a problem and need to cleanup | ||
+ | exit 3; | ||
+ | die " | ||
+ | }; | ||
+ | alarm $timeout; | ||
+ | eval { | ||
+ | $STATUSOUT=`$ENV{' | ||
+ | chomp($STATUSOUT); | ||
+ | ### added fuseblk check for Linux 6 output | ||
+ | if ( ( $ENV{' | ||
+ | ( $ENV{' | ||
+ | ( $ENV{' | ||
+ | ### status is okay | ||
+ | exit 0; | ||
+ | } elsif ( $STATUSOUT =~ /Transport endpoint is not connected/ ) { | ||
+ | ### we have a problem, need to clean up | ||
+ | exit 2; | ||
+ | } else { | ||
+ | ### filesystem is offline | ||
+ | exit 1; | ||
+ | } | ||
+ | }; | ||
+ | |||
+ | TOT | ||
+ | |||
+ | RC=$? | ||
+ | ### process return codes from the perl block | ||
+ | if [ $RC -eq 3 ]; then | ||
+ | STATUS_TIMEOUT=$(( $STATUS_TIMEOUT + 1 )) | ||
+ | logit error "Found timeout while checking status, cleaning mount automatically" | ||
+ | $SCRIPTPATH clean | ||
+ | logit debug "Check -- OFFLINE" | ||
+ | exit 1 | ||
+ | elif [ $RC -eq 2 ]; then | ||
+ | STATUS_TIMEOUT=$(( $STATUS_TIMEOUT + 1 )) | ||
+ | logit error "Found error while checking status, cleaning mount automatically" | ||
+ | $SCRIPTPATH clean | ||
+ | logit debug "Check -- OFFLINE" | ||
+ | exit 1 | ||
+ | elif [ $RC -eq 1 ]; then | ||
+ | logit debug "Check -- OFFLINE" | ||
+ | exit 1 | ||
+ | elif [ $RC -eq 0 ]; then | ||
+ | logit debug "Check -- ONLINE" | ||
+ | exit 0 | ||
+ | fi | ||
+ | ;; | ||
+ | |||
+ | ' | ||
+ | logit info " | ||
+ | $SCRIPTPATH stop | ||
+ | $SLEEP 2 | ||
+ | $SCRIPTPATH start | ||
+ | ;; | ||
+ | |||
+ | ' | ||
+ | logit info " | ||
+ | if [ $LINUX -eq 1 ]; then | ||
+ | $FUSERMOUNT -u $MOUNT_POINT | ||
+ | elif [ $SOLARIS -eq 1 ]; then | ||
+ | $UMOUNT $MOUNT_POINT > /dev/null 2>&1 | ||
+ | fi | ||
+ | $SLEEP 1 | ||
+ | FORCE_CLEANUP=0 | ||
+ | if [ $STATUS_TIMEOUT -gt 1 ]; then | ||
+ | FORCE_CLEANUP=1 | ||
+ | else | ||
+ | $SCRIPTPATH status > / | ||
+ | if [ $? -eq 0 ]; then FORCE_CLEANUP=1; | ||
+ | fi | ||
+ | if [ $FORCE_CLEANUP -eq 1 ]; then | ||
+ | logit error "tried (fusermount -u|umount), still mounted, now cleaning with (fusermount -u -z|umount -f) and kill" | ||
+ | if [ $LINUX -eq 1 ]; then | ||
+ | $FUSERMOUNT -u -z $MOUNT_POINT | ||
+ | elif [ $SOLARIS -eq 1 ]; then | ||
+ | echo " | ||
+ | $UMOUNT -f $MOUNT_POINT > /dev/null 2>&1 | ||
+ | fi | ||
+ | if [ $LINUX -eq 1 ]; then | ||
+ | PIDS=`$PS -ef | $GREP -w " | ||
+ | $AWK ' | ||
+ | if [ -n " | ||
+ | PIDS=`$PS -ef | $GREP -w " | ||
+ | $AWK ' | ||
+ | if [ -n " | ||
+ | elif [ $SOLARIS -eq 1 ]; then | ||
+ | PIDS=`$PS -ef | $GREP dbfs_client| $GREP -v grep | $AWK ' | ||
+ | REALPIDS=' | ||
+ | for pid in $PIDS | ||
+ | do | ||
+ | ARGS=`pargs $pid` | ||
+ | echo $ARGS | grep " | ||
+ | RET=$? | ||
+ | if [ $RET -eq 0 ]; then REALPIDS=" | ||
+ | done | ||
+ | if [ -n " | ||
+ | ### do it a 2nd time to clean up others | ||
+ | if [ -n " | ||
+ | PIDS=`$PS -ef | $GREP dbfs_client| $GREP -v grep | $AWK ' | ||
+ | REALPIDS=' | ||
+ | for pid in $PIDS | ||
+ | do | ||
+ | ARGS=`pargs $pid` | ||
+ | echo $ARGS | grep " | ||
+ | RET=$? | ||
+ | if [ $RET -eq 0 ]; then REALPIDS=" | ||
+ | done | ||
+ | if [ -n " | ||
+ | |||
+ | fi | ||
+ | exit 1 | ||
+ | fi | ||
+ | ;; | ||
+ | |||
+ | *) | ||
+ | $ECHO " | ||
+ | ;; | ||
+ | |||
+ | 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 | ||
</ | </ |