Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure dbfs file system in exadata environment

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to configure the dbfs file system in the exadata environment". In the daily operation, I believe that many people have doubts about how to configure the dbfs file system in the exadata environment. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "how to configure the dbfs file system in the exadata environment". Next, please follow the editor to study!

Configure dbfs file system in exadata environment

In the all-in-one environment of 1.ORACLE, usually after the factory initialization is completed, a typical dbfs disk group is created, which can be used to establish the file system supported by oracle.

ORACLE's file system needs a separate database as a background support. Create a table space in this library, and the capacity of this space is the capacity that can be used by subsequent file systems.

There are two methods involved in creating a system: using a wallet or not, using a wallet because of its complexity and potential impact, so the following is only described for non-wallet methods.

In addition, it is assumed that the platform is Linux platform.

two。 Create a separate database

Because the Dbfs file system is based on a table space, you need to create a separate database for this purpose. The database requirements are as follows:

2.1. Invoke?DBCA

2.2. Choose Real Application Clusters database.

2.3. Choose Create a Database?

2.4. Choose the General Purpose or Transaction Processing template (include datafiles)

2.5. Choose Admin-Managed and select all nodes

2.6. Name your database (e.g. Dbfs)

2.7. Optionally configure Enterprise Manager and automatic maintenance tasks as per site requirements

2.8. Choose Automatic Storage Management and Oracle-Managed Files

2.9. Choose the desired Disk Group. In general, DBFS_DG is adequate for DBFS purposes

2.10. De-select Flash Recovery Area

2.11. Do not select Enable Archiving. Archivelog mode is not necessary for this use case.

2.12. In the Memory Tab:

2.12.1 Choose Custom and then Automatic Shared Memory Management

2.12.2 Enter 1536 (and choose M Bytes for units) in the SGA box and enter 6656 and choose M Bytes for units) in the PGA Size box

2.13. In the Character Sets tab choose AL32UTF8 as the Database Character Set

2.14. Open the All Initialization Parameters dialogue. Select "Show Advanced arameters". Scroll down to parallel_max_servers and enter "2" under the Value column

2.15. If diskgroup DBFS_DG's compatible.rdbms attribute is set to 11.2.0.2.0 then

In DBCA set compatible=11.2.0.2.0 in All Initialization Parameters screen. If this isn't set properly, you will get "ORA-15204: database version 11.2.0.0.0 is

Incompatible with diskgroup DBFS_DG "while creating the database.

2.16. Click on the Finish button

3. The configuration process is as follows: (assuming an all-in-one machine with 1/4, there are two db server:dm01test01,dm02test02)

3.1 add oracle to the fuse group

(root) # dcli-g ~ / dbs_group-l root usermod-a-G fuse oracle

More dbfs_group:

Dm01test01

Dm01test02

Create / etc/fuse.conf file and authorize

(root) # dcli-g ~ / dbs_group-l root "echo user_allow_other > / etc/fuse.conf"

(root) # dcli-g ~ / dbs_group-l root chmod 644 / etc/fuse.conf

3.2 create a mount point for the file system (such as dbfsmnt)

(root) # dcli-g ~ / dbs_group-l root chown oracle:dba / dbfsmnt

3.3 Cluster restart

(root) # dcli-g ~ / dbs_group-l root / u01/app/11.2.0.3/grid/bin/crsctl stop crs

(root) # dcli-g ~ / dbs_group-l root / u01/app/11.2.0.3/grid/bin/crsctl start crs

3.4 create users and tablespaces in the bookstore created in step 2

The tablespace requirements are as follows:

Tablespaces for DBFS can be either SMALLFILE or BIGFILE. Optimally, the administrator will determine the size of the staging area needed for the Data

Warehouse activities and will create the tablespace with the required size as opposed to relying on autoextend.

When creating a tablespace for DBFS, include the following options:

NOLOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO

SQL > create bigfile tablespace dbfsts datafile'+ DBFS_DG' size 32g autoextend on next 8g maxsize 300g NOLOGGING EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO

SQL > create user dbfs_user identified by test default tablespace dbfsts quota unlimited on dbfsts

SQL > grant create session, create table, create view, create procedure, dbfs_role to dbfs_user

3.5 execute a script to save the object of dbfs using the user created above

(oracle) $sqlplus dbfs_user/dbfs_passwd

SQL > start dbfs_create_filesystem dbfsts FS1

Dbfsts: is the tablespace name for the file system

FS1: the first subdirectory under the file system mount point, under which all subsequent available file systems need to create more inner subdirectories, such as / dbfsmnt/FS1/test

3.6. Download the mount-dbfs.sh file and convert it, such as putting the file under / tmp

For Linux, run this:

(root) # dos2unix / tmp/mount-dbfs.sh

3.7Edit / tmp/mount-dbfs.sh file

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

As shown above, because the example does not use wallet, some properties related to wallet do not need to be set.

The contents of the revised document are as follows:

More mount-dbfs.sh

#! / 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 26-JUL-2012

# # #

# Everyone must set these values

# # #

# Database name for the DBFS repository as used in "srvctl status database-d $DBNAME"

DBNAME=test

# Mount point where DBFS should be mounted

MOUNT_POINT=/dbfsmnt

# Username of the DBFS repository owner in database $DBNAME

DBFS_USER=dbfs_user

# RDBMS ORACLE_HOME directory path

ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/dbhome_1

# 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

# 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

# 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=test

# 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=/export/home/oracle/dbfs/tnsadmin

# 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 = 'Linux']; then LINUX=1; SOLARIS=0

Elif [$UNAME_S = 'SunOS']; then LINUX=0; SOLARIS=1

Fi

GREP=/bin/grep

AWK=/bin/awk

ECHO=/bin/echo

LOGGER= "/ bin/logger-t DBFS_$ {MOUNT_POINT}"

RMF='/bin/rm-f'

TOUCH=/bin/touch

CHMOD=/bin/chmod

PS=/bin/ps

SLEEP=/bin/sleep

KILL=/bin/kill

BASENAME=/bin/basename

STAT=/usr/bin/stat

ID=/usr/bin/id

WC=/usr/bin/wc

SRVCTL=$ORACLE_HOME/bin/srvctl

DBFS_CLIENT=$ORACLE_HOME/bin/dbfs_client

HN=/bin/hostname

PERL=/usr/bin/perl

MOUNT=/bin/mount

# ensure messages are displayed in English for pattern matching

LANG=en_US.UTF-8

NLS_LANG=American_America.US7ASCII

If [- z "$STATUS_TIMEOUT"]; then STATUS_TIMEOUT=0; fi

If [$LINUX-eq 1]; then

MOUNT=/bin/mount

XARGS='/usr/bin/xargs-r'

FUSERMOUNT=/bin/fusermount

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib64

Elif [$SOLARIS-eq 1]; then

MOUNT=/sbin/mount

XARGS=/usr/bin/xargs

UMOUNT=/usr/sbin/umount

LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:/usr/lib:/lib

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/bin:$PATH

Export STATUS_TIMEOUT

Export LANG NLS_LANG

Logit () {

# type: info, error, debug

Type=$1

Msg=$2

If ["$type" = "info"]; then

$ECHO $msg

$LOGGER-p ${LOGGER_FACILITY} .info "$msg"

Elif ["$type" = "error"]; then

$ECHO $msg

$LOGGER-p ${LOGGER_FACILITY} .error "$msg"

Elif ["$type" = "debug"]; then

$ECHO $msg

$LOGGER-p ${LOGGER_FACILITY} .debug "$msg"

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 $scriptateh`

Echo $SCRIPTPATH | grep ^ / > / dev/null 2 > & 1

If [$?-ne 0]; then

MYDIR= `pwd`

SCRIPTPATH=$ {MYDIR} / ${SCRIPTPATH}

Fi

# must cd to a directory where the oracle owner can get CWD

Cd / tmp

Case "$1" in

'start')

Logit info "$SCRIPTNAME mounting DBFS at $MOUNT_POINT from database $DBNAME"

# check to see if it is already mounted

$SCRIPTPATH status > / dev/null 2 > & 1

If [$?-eq 0]; then

Logit error "$MOUNT_POINT already mounted, use $SCRIPTNAME stop before attempting to start"

$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' | $AWK'{print $2}')

Logit info "ORACLE_SID is $ORACLE_SID"

# if there's no SID defined locally or it isn't running, stop

If [- z "$ORACLE_SID"-a "$WALLET" = 'false']; then

Logit error "No running ORACLE_SID available on this host, exiting"

Exit 2

Fi

# if using password-based startup, use this

If ["$WALLET" = 'false'-a-n "$DBFS_PASSWD"]; then

$RMF $DBFS_PWDFILE

If [- f $DBFS_PWDFILE]; then

Logit error "please remove $DBFS_PWDFILE and try again"

Exit 1

Fi

$TOUCH $DBFS_PWDFILE

$CHMOD 600 $DBFS_PWDFILE

$ECHO $DBFS_PASSWD > $DBFS_PWDFILE

Logit info "spawning dbfs_client command using SID $ORACLE_SID"

(nohup $DBFS_CLIENT ${DBFS_USER} @-o $MOUNT_OPTIONS\

$MOUNT_POINT

< $DBFS_PWDFILE | $LOGGER -p ${LOGGER_FACILITY}.info 2>

& 1 &) &

$RMF $DBFS_PWDFILE

Elif ["$WALLET" = true]; then

Logit info "doing mount $MOUNT_POINT using SID $ORACLE_SID with wallet now"

(nohup $DBFS_CLIENT / @ ${DBFS_LOCAL_TNSALIAS}-o $MOUNT_OPTIONS,wallet\

$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

'stop')

$SCRIPTPATH status > / dev/null

If [$?-eq 0]; then

Logit info "unmounting DBFS from $MOUNT_POINT"

If [$LINUX-eq 1]; then

Logit info "umounting the filesystem using'$FUSERMOUNT-u $MOUNT_POINT'"

$FUSERMOUNT-u $MOUNT_POINT

Elif [$SOLARIS-eq 1]; then

Logit info "umounting the filesystem using'$UMOUNT $MOUNT_POINT'"

$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 "filesystem $MOUNT_POINT not currently mounted, no need to stop"

Fi

'check' |' status')

# check to see if it is mounted

# fire off a short process in perl to do the check (need the alarm builtin)

Logit debug "Checking status now"

$PERL / dev/null 2 > & 1

Fi

$SLEEP 1

FORCE_CLEANUP=0

If [$STATUS_TIMEOUT-gt 1]; then

FORCE_CLEANUP=1

Else

$SCRIPTPATH status > / dev/null

If [$?-eq 0]; then FORCE_CLEANUP=1; fi

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 "running umount-f now"

$UMOUNT-f $MOUNT_POINT > / dev/null 2 > & 1

Fi

If [$LINUX-eq 1]; then

PIDS= `$PS-ef | $GREP-w "$MOUNT_POINT" | $GREP dbfs_client | $GREP-v grep |\

$AWK'{print $2}'`

If [- n "$PIDS"]; then $KILL-9$ PIDS; fi

PIDS= `$PS-ef | $GREP-w "$MOUNT_POINT" | $GREP mount.dbfs | $GREP-v grep |\

$AWK'{print $2}'`

If [- n "$PIDS"]; then $KILL-9$ PIDS; fi

Elif [$SOLARIS-eq 1]; then

PIDS= `$ PS-ef | $GREP dbfs_client | $GREP-v grep | $AWK'{print $2}'`

REALPIDS=''

For pid in $PIDS

Do

ARGS= `pargs $pid`

Echo $ARGS | grep "$MOUNT_POINT$" > / dev/null

RET=$?

If [$RET-eq 0]; then REALPIDS= "$REALPIDS $pid"; fi

Done

If [- n "$REALPIDS"]; then $KILL-9$ REALPIDS; fi

# do it a 2nd time to clean up others

If [- n "$REALPIDS"]; then $KILL-9$ REALPIDS; fi

PIDS= `$ PS-ef | $GREP dbfs_client | $GREP-v grep | $AWK'{print $2}'`

REALPIDS=''

For pid in $PIDS

Do

ARGS= `pargs $pid`

Echo $ARGS | grep "$MOUNT_POINT$" > / dev/null

RET=$?

If [$RET-eq 0]; then REALPIDS= "$REALPIDS $pid"; fi

Done

If [- n "$REALPIDS"]; then $KILL-9$ REALPIDS; fi

Fi

Exit 1

Fi

*)

$ECHO "Usage: $SCRIPTNAME {start | stop | check | status | restart | clean | abort}"

Esac

3.8 copy the modified files under the ORACLE_HOME/crs/scripts of the user of grid, and copy them to other nodes

(root) # dcli-g ~ / dbs_group-l root-d / u01/app/11.2.0.3/grid/crs/script. -f / tmp/mount-dbfs.sh

(root) # dcli-g ~ / dbs_group-l root chown oracle:dba / u01/app/11.2.0.3/grid/crs/script/mount-dbfs.sh

(root) # dcli-g ~ / dbs_group-l root chmod 750 / u01/app/11.2.0.3/grid/crs/script/mount-dbfs.sh

3.9 register dbfs resources to the ocr library

Generate a file in the home directory of grid, as follows:

# start script. Add-dbfs-resource.sh

#! / bin/bash

ACTION_SCRIPT=/u01/app/11.2.0/grid/crs/script/mount-dbfs.sh

RESNAME=dbfs_mount

DBNAME=test

DBNAMEL= `echo $DBNAME | tr Amurz az`

ORACLE_HOME=/u01/app/11.2.0.3/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

Pay attention to the contents of the above file. ACTION_SCRIPT,RESNAME,DBNAME,ORACLE_HOME needs to be modified according to the actual needs.

Then run this as the Grid Infrastructure owner (typically oracle) on one database server only:

(oracle) $sh. / add-dbfs-resource.sh

3.10 (grid) $sh. / add-dbfs-resource.sh

When successful, this command has no output.

3.11 launch dbfs_mount resources

(oracle) $/ bin/crsctl stat res dbfs_mount-t

NAME TARGET STATE SERVER STATE_DETAILS

Local Resources

Dbfs_mount

OFFLINE OFFLINE test1

OFFLINE OFFLINE test2

Start

(oracle) $/ bin/crsctl start resource dbfs_mount

CRS-2672: Attempting to start 'dbfs_mount' on' test1'

CRS-2672: Attempting to start 'dbfs_mount' on' test2'

CRS-2676: Start of 'dbfs_mount' on' test2' succeeded

CRS-2676: Start of 'dbfs_mount' on' test1' succeeded

(oracle) $/ bin/crsctl stat res dbfs_mount-t

NAME TARGET STATE SERVER STATE_DETAILS

Local Resources

Dbfs_mount

ONLINE ONLINE test1

ONLINE ONLINE test2

At this point, the study on "how to configure the dbfs file system in the exadata environment" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report