Part of this series of posts: Oracle Database 12c on Oracle Linux 6
Right-click the desktop and select Open in Terminal.
Type the following commands, pressing Enter after each command.
cd gedit .bash_profile
The previous command will open the oracle user’s existing .bash_profile script.
Add the lines below to the .bash_profile file.
#Oracle install specific environment settings umask 022
TMP=/tmp; export TMP TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=localhost.localdomain; export ORACLE_HOSTNAME ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1; export ORACLE_HOME ORACLE_SID=orcl; export ORACLE_SID ORACLE_TERM=xterm; export ORACLE_TERM
PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH; export PATH 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
Click Save and select File -> Quit to close gedit.
What about the old code block that we’ve seen for years in the .bash_profile that looked like this:
if [ $USER = “oracle” ]; then if [ $SHELL = “/bin/ksh” ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi
Our preinstall script actually sets the correct settings for the oracle user (it puts a file into /etc/security/limits.d/) and not only that, the ‘use this setting when you use ksh as your shell’ is actually wrong. The -p flag is a read only flag, you can’t actually set this.
Type the following command and press Enter.
Enter the following lines in the .bashrc file.
alias sqlplus=’rlwrap sqlplus’ alias rman=’rlwrap rman’ alias asmcmd=’rlwrap asmcmd’ alias adrci=’rlwrap adrci’ alias impdp=’rlwrap impdp alias expdp=’rlwrap expdp
Click Save and select File -> Quit. If you get a pop-up stating that the backup file couldn’t be created, just click Save Anyway.
rlwrap allows the up arrow key to return the previously entered command. By default the up arrow doesn’t work in Linux (and other Unix’s) which is very annoying. rlwrap removes that annoyance.
Type the following commands, pressing Enter after each one.
source .bash_profile source .bashrc
Sourcing the files will read their values into your current environment.