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.
Note:
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.
gedit .bashrc
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.
Note:
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
Note:
Sourcing the files will read their values into your current environment.
Oracle Database 12c on Oracle Linux 6 – Step 20: Download and Extract Oracle Database 12c Grid Infrastructure < Previous Post – Next Post > Oracle Database 12c on Oracle Linux 6 – Step 22: Install Oracle Grid Infrastructure, Oracle Restart and ASM
April 21st, 2014 at 6:49 pm
[…] Step 21: Edit the oracle User’s .bash_profile and .bashrc […]
May 12th, 2014 at 4:52 pm
[…] Oracle Database 12c on Oracle Linux 6 – Step 19: Download and Extract Oracle Database 12c < Previous Post – Next Post > Oracle Database 12c on Oracle Linux 6 – Step 21: Edit the oracle User’s .bash_profile and .bash… […]
May 12th, 2014 at 6:00 pm
[…] Oracle Database 12c on Oracle Linux 6 – Step 21: Edit the oracle User’s .bash_profile and .bash… < Previous Post – Next Post > Oracle Database 12c on Oracle Linux 6 – Step 23: Create the FRA Disk Group […]
March 8th, 2015 at 3:43 pm
[…] Based on the above, I might change things a bit in this post from my 12c Install Series. […]
July 3rd, 2015 at 3:29 pm
[…] rlwrap for various Oracle commands like sqlplus, rman, etc. (See this post to install rlwrap, and this post to configure the aliases to use with rlwrap) then CTRL-r will also work in those commands […]