This blog post is an HowTo "Setup SQL*Plus to work on BASH" The commands illustrated in this howto are tested on Ubuntu 9.10 with Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production Installed.
What is SQL * Plus ?
SQL*Plus is a command line SQL and PL/SQL language interface and reporting tool that ships with the Oracle Database Client and Server software. It can be used interactively or driven from scripts. SQL*Plus is frequently used by DBAs and Developers to interact with the Oracle database.
Oracle Database 10g Express Edition Release 10.2.0.1.0 Installed
Once you have Oracle 10g Installed successfully you can go to
Applications > Oracle Database 10g Express Edition > Run SQL Command Line
and successfully run all your SQL PL/SQL easily but using SQL*Plus directly on BASH is the real fun, Below are the steps which will enable you to use SQL*Plus on BASH
1) set ORACLE_HOME
1. Create oracle User Account
Login as root and create te user oracle which belongs to dba group.
# groupadd dba
# useradd -g dba oracle
# mkdir /home/oracle
# chown oracle:dba /home/oracle
2. Setting System parameters
Edit the /etc/sysctl.conf and add following lines:
kernel.sem = 250 32000 100 128
kernel.shmmax = 2147483648
kernel.shmmni = 128
kernel.shmall = 2097152
kernel.msgmnb = 65536
kernel.msgmni = 2878
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
Note: You need execute “sysctl -p” command or reboot system to apply
Edit the /etc/security/limits.conf file and add following lines:
* - nproc 16384
* - nofile 16384
3. Setting Oracle Enviroment
Edit the /home/oracle/.bash_profile file and add following lines: