Oracle RAC - .bash_profile of the user oracle
Oracle RAC Solution · Config document · referenced from Database creation and user environments
if tests in this file compare against strings in typographic quotes (“oracle”, “/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 database owner oracle. It sets the environment for the database home and the local instance, and defines the two aliases that switch the same shell to the Grid Infrastructure home and back.
| Item | Value |
|---|---|
| Path | /home/oracle/.bash_profile |
| Shown here | oradb01 |
| Deployed on | oradb01 and oradb02, two lines differ |
| Read by | every login shell of oracle, for example su - oracle |
| Owner and mode | not in the notes |
| Used with | grid_env and db_env |
The file
# Settings specific to the user "oracle" umask 022 # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs if [ $USER = “oracle” ]; then if [ $SHELL = “/bin/ksh” ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi # Oracle 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/oracle; export ORACLE_BASE ORACLE_SID=clsdb1; export ORACLE_SID ORACLE_HOME=/data/u01/app/oracle/db11204; export ORACLE_HOME ORACLE_TERM=xterm; export ORACLE_TERM GRID_HOME=/data/u01/app/grid11204; export GRID_HOME DB_HOME=$ORACLE_BASE/db11204; export DB_HOME 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 sysdba' alias grid_env='. /home/oracle/grid_env' alias db_env='. /home/oracle/db_env'
On the second node the notes show only the two lines that differ:
| Host | Line | Value |
|---|---|---|
oradb01 | ORACLE_HOSTNAME | oradb01.example.net |
oradb02 | ORACLE_HOSTNAME | oradb02.example.net |
oradb01 | ORACLE_SID | clsdb1 |
oradb02 | ORACLE_SID | clsdb2 |
The typographic quotes
The block under "User specific environment and startup programs" looks pasted from a formatted document: the quotes around oracle and /bin/ksh are the curly characters “ and ”, not the ASCII ". To the shell they are ordinary characters and part of the word. The first test therefore compares the user name oracle with the eight-character string “oracle”, which is never equal, and nothing inside the outer if runs: neither the ksh branch nor the else branch. No error is printed, which is why it went unnoticed.
The consequence is small, because the limits do not depend on this file. The hard and soft limits of oracle come from limits.conf, and /etc/profile.local carries a working block of the same kind, with ASCII quotes and with other values (131072). The block here is dead text.
The other lines
| Line | What it does |
|---|---|
umask 022 | Files created by oracle are readable by group and others |
ORACLE_HOSTNAME | The public name of the node, differs per node |
ORACLE_UNQNAME=clsdb | The unique name of the database |
ORACLE_SID | The local instance, clsdb1 or clsdb2 |
GRID_HOME, DB_HOME | Not read by Oracle. They are the two values grid_env and db_env copy into ORACLE_HOME |
BASE_PATH | The PATH as it was before any Oracle directory was added, plus /usr/sbin and $HOME/bin. PATH is always rebuilt from it, so switching homes replaces the Oracle bin directory and does not pile up entries |
alias sql | sqlplus / as sysdba, operating system authentication through the group dba |
alias grid_env, alias db_env | Source the two environment files into the current shell |
Checked against Oracle AI Database 26ai
| As built | Today |
|---|---|
umask 022 in the profile of the software owner | Still required, in the same words in the 11.2 and the 26ai installation guides |
ulimit block in the profile | Not in the 11.2.0.4-era or the current guides. Limits are set in limits.conf only and checked with ulimit -Sn, -Hn, -Su, -Hu |
ORACLE_UNQNAME exported for the database | DBCA no longer needs ORACLE_UNQNAME set in the environment |
The block that does not work is also the block that is not needed.