Solution:-
A) First we’ll install oracle database and then install the sql developer ide.
Steps:-
Follow the below steps to install the 11g database(latest when this post was written)
Download the latest oracle version for ubuntu
- Unzip using the command:
unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
- Install required packages using the command:
sudo apt-get install alien libaio1 unixodbc
- Convert RPM package format to DEB package format (that is used by Ubuntu) using the command:
sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm
- Create the required chkconfig script using the command::
sudo pico /sbin/chkconfig
The pico text editor is started and the commands are shown at the bottom of the screen. Now copy and paste the following into the file and save:
#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Ubuntu
file=/etc/init.d/oracle-xe
if [[ ! `tail -n1 $file | grep INIT` ]]; then
echo >> $file
echo '### BEGIN INIT INFO' >> $file
echo '# Provides: OracleXE' >> $file
echo '# Required-Start: $remote_fs $syslog' >> $file
echo '# Required-Stop: $remote_fs $syslog' >> $file
echo '# Default-Start: 2 3 4 5' >> $file
echo '# Default-Stop: 0 1 6' >> $file
echo '# Short-Description: Oracle 11g Express Edition' >> $file
echo '### END INIT INFO' >> $file
fi
update-rc.d oracle-xe defaults 80 01 - Change the permission of the chkconfig file using the command:
sudo chmod 755 /sbin/chkconfig
- Set kernel parameters. Oracle 11gR2 XE requires additional kernel parameters which you need to set using the command:
sudo pico /etc/sysctl.d/60-oracle.conf
Copy the following into the file and save:
# Oracle 11g XE kernel parameters
fs.file-max=6815744
net.ipv4.ip_local_port_range=9000 65000
kernel.sem=250 32000 100 128
kernel.shmmax=536870912Verify the change using the command:
sudo cat /etc/sysctl.d/60-oracle.conf
You should see what you entered earlier. Now load the kernel parameters:
sudo service procps start
Verify the new parameters are loaded using:
sudo sysctl -q fs.file-max
You should see the file-max value that you entered earlier.
- Set up /dev/shm mount point for Oracle. Create the following file using the command:
sudo pico /etc/rc2.d/S01shm_load
Copy the following into the file and save.
#!/bin/sh
case "$1" in
start) mkdir /var/lock/subsys 2>/dev/null
touch /var/lock/subsys/listener
rm /dev/shm 2>/dev/null
mkdir /dev/shm 2>/dev/null
mount -t tmpfs shmfs -o size=2048m /dev/shm ;;
*) echo error
exit 1 ;;
esacChange the permissions of the file using the command:
sudo chmod 755 /etc/rc2.d/S01shm_load
- [This step was not included in the screencast, but you should do it.] Execute the following commands:
sudo ln -s /usr/bin/awk /bin/awk
sudo mkdir /var/lock/subsys
sudo touch /var/lock/subsys/listener - REBOOT your Ubuntu VM.
- Install the oracle DBMS using the command:
sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb
- Configure Oracle using the command:
sudo /etc/init.d/oracle-xe configure
Enter the following information:
- A valid HTTP port for the Oracle Application Express (the default is 8080)
- A valid port for the Oracle database listener (the default is 1521)
- A password for the SYS and SYSTEM administrative user accounts
- Confirm password for SYS and SYSTEM administrative user accounts
- Whether you want the database to start automatically when the computer starts (next reboot).
- Setup environment variables by editting your .bashrc file:
pico ~/.bashrc
Add the following lines to the end of the file:
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATHLoad the changes by executing your profile:
. ~/.profile
- Start the Oracle 11gR2 XE:
sudo service oracle-xe start
- Add user YOURUSERNAME to group dba using the command
sudo usermod -a -G dba YOURUSERNAME
- Start the Oracle XE 11gR2 server using the command:
sudo service oracle-xe start
This step is most likely not necessary, but I am documenting the command here anyway.
- Start command line shell as the system admin using the command:
sqlplus sys as sysdba
Enter the password that you gave while configuring Oracle earlier. You will now be placed in a SQL environment that only understands SQL commands.
- Create a regular user account in Oracle using the SQL command:
create user USERNAME identified by PASSWORD;
Replace USERNAME and PASSWORD with the username and password of your choice. Please remember this username and password.
- Grant privileges to the user account using the SQL command:
grant connect, resource to USERNAME;
Replace USERNAME and PASSWORD with the username and password of your choice. Please remember this username and password.
- Exit the sys admin shell using the SQL command:
exit;
- Start the commandline shell as a regular user using the command:
sqlplus
You will be prompted for a username and password. Once authenticated, you will be able to type in the standard SQL commands learned in class.
B) After our successfull installation of oracle, we are going to configure sql developer IDE.
Download the latest sql developer edition
1.sudo alien –scripts -d sqldeveloper-version.noarch.rpm
A file named sqldeveloper_version_all.deb will be generated. To run this file, execute the following statement:
2.sudo dpkg –install sqldeveloper_version_all.deb
Create a .sqldeveloper directory in your home folder:
3.sudo mkdir /home/.sqldeveloper/
Run SQL Developer from the terminal.
4.sudo /opt/sqldeveloper/sqldeveloper.sh
5.Enter the path for java installed on your system
How to find path by using the command whereis jvm
generally its installed inside /usr/lib/jvm/java-version
$ sudo alien --scripts -d sqldeveloper-4.2.0.17.089.1709-1.noarch.rpm
[sudo] password for user:
sqldeveloper_4.2.0.17.089.1709-2_all.deb generated
user@test:~/Documents/Northstar/oracle$ sudo dpkg --install sqldeveloper_4.2.0.17.089.1709-2_all.deb
Selecting previously unselected package sqldeveloper.
(Reading database ... 277479 files and directories currently installed.)
Preparing to unpack sqldeveloper_4.2.0.17.089.1709-2_all.deb ...
Unpacking sqldeveloper (4.2.0.17.089.1709-2) ...
Setting up sqldeveloper (4.2.0.17.089.1709-2) ...
Processing triggers for libc-bin (2.23-0ubuntu7) ...
user@test:~/Documents/test/oracle$ sudo mkdir /home/.sqldeveloper/ms@test:~/Documents/test/oracle$ sudo /opt/sqldeveloper/sqldeveloper.sh
Oracle SQL Developer
Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
Type the full pathname of a JDK installation (or Ctrl-C to quit), the path will be stored in /home/mandeep/.sqldeveloper/4.2.0/product.conf
/usr/lib/jvm/java-1.8.0-openjdk-amd64
6.Accept the default settings for any window pop ups
7. All done, check the first look of SQL developer to work with oracle.
Note:-
Login as sys user using terminal:-
sqlplus / as sysdba , enter username and password > execute the queries
Reference documents:-
http://www2.hawaii.edu/~lipyeow/ics321/2014fall/installoracle11g.html
One reply on “Install oracle free edition with IDE on Linux machine?”
very good post. crisp and clear. Thanks for writing this!!