Oracle Database Post Installation Tasks

  • Logrotate for oracle database and listener log.

Using Logrotate to Manage Oracle Database Alert and Listener Log Files

  • Periodically delete the database archive logs

Using RMAN to Delete Oracle Database Archive Logs

  • Setting user environment variables for multiple instances.
~]$ sed -i '/for Oracle/,$d' /home/oracle/.bash_profile
~]$ cat >> /home/oracle/.bash_profile << "EOF"
# The following is added for Oracle
umask 022
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export CV_ASSUME_DISTID=OEL7

echo " Select your environment "
echo " ================================================================ "
echo " Option SID LISTEN:PORT VERSION Description "
echo " ---------------------------------------------------------------- "
echo
echo " 1 ORCL LI_ORCL:3300 19.3.0.0 "
echo
echo " 2 COCO LI_COCO:3400 19.3.0.0 "
echo
echo " ================================================================ "
echo " your choice (1~2) ?"

read INPUT_VAL

if (( INPUT_VAL == 1)); then
export ORACLE_SID=ORCL
fi

if (( INPUT_VAL == 2)); then
export ORACLE_SID=COCO
fi

export PS1='[$ORACLE_SID]\u@\h:$PWD# '
EOF
  • Setting SQLPLUS prompt.
~]$ cat >>$ORACLE_HOME/sqlplus/admin/glogin.sql <<"EOF"
SET LINESIZE 200 PAGESIZE 50
SET SQLPROMPT "_user'@'_connect_identifier> "
EOF