LINUXOR.SK ... open source notes ...

Oracle RAC - .bash_profile of the user grid

category: solutionz · date: 2016-12-31 · updated: 2026-10-02 · author: LALA

Oracle RAC Solution · Config document · referenced from Database creation and user environments

noteThe if tests in this file compare against strings in typographic quotes (“grid”, “/bin/ksh”). They can never be true, so the ulimit lines never run. The file is shown as it was; do not copy that block.

The login profile of the Grid Infrastructure owner grid. It sets the environment for the Grid home and the local ASM instance. Unlike the profile of oracle it has one home only and no switching aliases.

ItemValue
Path/home/grid/.bash_profile
Shown hereoradb01
Deployed onoradb01 and oradb02, two lines differ
Read byevery login shell of grid, for example su - grid
Owner and modenot in the notes

The file

bash
# Settings specific to the user "grid"
umask 022

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs
if [ $USER = “grid” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

# Grid Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=oradb01.example.net; export ORACLE_HOSTNAME
ORACLE_UNQNAME=clsdb; export ORACLE_UNQNAME
ORACLE_BASE=/data/u01/app/grid; export ORACLE_BASE
GRID_HOME=/data/u01/app/grid11204; export GRID_HOME
ORACLE_HOME=$GRID_HOME; export ORACLE_HOME
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

BASE_PATH=/usr/sbin:$PATH:$HOME/bin; export BASE_PATH
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH

alias sql='sqlplus / as sysasm'

For the second node the notes show only two lines, without saying that the rest is the same; I read it as the same file with these two lines changed:

HostLineValue
oradb01ORACLE_HOSTNAMEoradb01.example.net
oradb02ORACLE_HOSTNAMEoradb02.example.net
oradb01ORACLE_SID+ASM1
oradb02ORACLE_SID+ASM2

The typographic quotes

As in the profile of oracle, the quotes around grid and /bin/ksh are the curly characters “ and ”. The shell treats them as part of the word, the user name grid never equals “grid”, and the whole ulimit block is skipped without an error. The limits of grid come from limits.conf and from the working block in /etc/profile.local.

The other lines

LineWhat it does
ORACLE_BASE=/data/u01/app/gridThe Oracle base of the Grid Infrastructure owner. The Grid home /data/u01/app/grid11204 lies beside it, not under it
ORACLE_HOME=$GRID_HOMEThe Grid home is the only home this user works with
ORACLE_SID=+ASM1The local ASM instance
ORACLE_UNQNAME=clsdbThe same line as in the profile of oracle. It names the database, which grid does not administer
BASE_PATHThe same construction as in the profile of oracle; no other file of this user reads it again
alias sqlsqlplus / as sysasm, operating system authentication through the group asmadmin

Checked against Oracle AI Database 26ai

As builtToday
umask 022 in the profile of the software ownerStill required, in the same words in the 11.2 and the 26ai installation guides
ulimit block in the profileNot in the 11.2.0.4-era or the current guides. Limits are set in limits.conf only
sqlplus / as sysasmStill the way to administer ASM: members of the OSASM group connect to the ASM instance as SYSASM with operating system authentication
grid in oinstall, asmadmin and asmdba, apart from the database ownerThe same role separation is documented today

The profile would do its job unchanged; the ulimit block can simply be deleted.

← solutionz