Sunday, July 14, 2013

How to install Oracle Instant Client 12c and Oracle SQL Plus on Ubuntu

So you want to use your Ubuntu distribution and connect to an Oracle database.
Here you can find the steps to install and configure the Oracle Instant Client on Ubuntu 12.04.

First of all you need to go to the following link http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html and choose the Instant Client for your platform (in my case it is "Instant Client for Linux x86").

On the next web page select "Accept License Agreement" so you can download some rpm packets of the latest available Instant Client version (today is Version 12.1.0.1.0).

Click on oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm (Instant Client Package - Basic: All files required to run OCI, OCCI, and JDBC-OCI applications), oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm (Instant Client Package - SQL*Plus: Additional libraries and executable for running SQL*Plus with Instant Client) and oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm (Instant Client Package - SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client).

To be available to download those rpm packets you have also to sign in into the Oracle website.

Next step is to install alien on your distribution.
From the man page "alien is a program that converts between Red Hat rpm, Debian deb, Stampede slp, Slackware tgz, and Solaris pkg file formats. If you want to use a package from another linux distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it."

ubuntu@ubuntu-VirtualBox:~$ sudo apt-get install alien
Then go to your download directory and list the available rpm packets.
ubuntu@ubuntu-VirtualBox:~$ cd Downloads/
ubuntu@ubuntu-VirtualBox:~/Downloads$ ls
oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm
oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm
oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm
Let's install all of them using alien command:
ubuntu@ubuntu-VirtualBox:~/Downloads$ sudo alien -i oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm
    dpkg --no-force-overwrite -i oracle-instantclient12.1-sqlplus_12.1.0.1.0-2_i386.deb
Selecting previously unselected package oracle-instantclient12.1-sqlplus.
(Reading database ... 142987 files and directories currently installed.)
Unpacking oracle-instantclient12.1-sqlplus (from oracle-instantclient12.1-sqlplus_12.1.0.1.0-2_i386.deb) ...
Setting up oracle-instantclient12.1-sqlplus (12.1.0.1.0-2) ...
Now it's time for the Instant Client Basic Package:
ubuntu@ubuntu-VirtualBox:~/Downloads$ sudo alien -i oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm
    dpkg --no-force-overwrite -i oracle-instantclient12.1-basic_12.1.0.1.0-2_i386.deb
Selecting previously unselected package oracle-instantclient12.1-basic.
(Reading database ... 143000 files and directories currently installed.)
Unpacking oracle-instantclient12.1-basic (from oracle-instantclient12.1-basic_12.1.0.1.0-2_i386.deb) ...
Setting up oracle-instantclient12.1-basic (12.1.0.1.0-2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
And finally it's time for Instant Client SDK Package:
ubuntu@ubuntu-VirtualBox:~/Downloads$ sudo alien -i oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm
    dpkg --no-force-overwrite -i oracle-instantclient12.1-devel_12.1.0.1.0-2_i386.deb
Selecting previously unselected package oracle-instantclient12.1-devel.
(Reading database ... 143016 files and directories currently installed.)
Unpacking oracle-instantclient12.1-devel (from oracle-instantclient12.1-devel_12.1.0.1.0-2_i386.deb) ...
Setting up oracle-instantclient12.1-devel (12.1.0.1.0-2) ...
Let's try to issue the sqlplus command
ubuntu@ubuntu-VirtualBox:~$ sqlplus / as sysdba
sqlplus: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
Ops.. it fails because of a missing shared object file: libaio.so.1 So install libaio1 using the usual apt-get command.
ubuntu@ubuntu-VirtualBox:~$ sudo apt-get install libaio1
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following NEW packages will be installed:
  libaio1
0 upgraded, 1 newly installed, 0 to remove and 608 not upgraded.
Need to get 6,648 B of archives.
After this operation, 53.2 kB of additional disk space will be used.
Get:1 http://it.archive.ubuntu.com/ubuntu/ precise/main libaio1 i386 0.3.109-2ubuntu1 [6,648 B]
Fetched 6,648 B in 0s (12.5 kB/s)
Selecting previously unselected package libaio1.
(Reading database ... 143067 files and directories currently installed.)
Unpacking libaio1 (from .../libaio1_0.3.109-2ubuntu1_i386.deb) ...
Setting up libaio1 (0.3.109-2ubuntu1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Let's try to run sqlplus again.
ubuntu@ubuntu-VirtualBox:~/Downloads$ sqlplus / as sysdba
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
sqlplus complains about missing libraries. You can solve creating/editing the oracle.conf file issuing the following command and simply adding a line (the path where were installed all the libraries of the Instant Client packages: /usr/lib/oracle/12.1/client/lib):
ubuntu@ubuntu-VirtualBox:~/Downloads$sudo vi /etc/ld.so.conf.d/oracle.conf
/usr/lib/oracle/12.1/client/lib
Now update the information of all the shared libraries on your system.
ubuntu@ubuntu-VirtualBox:~/Downloads$sudo ldconfig
Run sqlplus again... and as you can see it works...
ubuntu@ubuntu-VirtualBox:~$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Sun Jul 14 20:01:37 2013

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-12162: TNS:net service name is incorrectly specified
... even if there's no database to connect to...
On the next post a new Oracle Database 12c will be finally available.

That's all.

10 comments:

Anonymous said...

Excelent work!!
Congratulations!!

Test Lorem Ipsum said...

I did exactly the same but at the end, it asks for username and password. Since no password is given during installation, WHAT is my username and password? Can I reset password using commandline? HELP please!

Jai said...

what is the default user name and password pleaseee

Avinash pal said...

please help me default username & password is not working for me its urgent
please.....
help me

oakleyses said...

oakley sunglasses, prada handbags, oakley sunglasses, longchamp handbags, longchamp handbags, louboutin shoes, louis vuitton handbags, coach factory outlet, tiffany and co, coach purses, louis vuitton outlet, polo ralph lauren outlet, air max, prada outlet, longchamp outlet, oakley sunglasses cheap, ray ban sunglasses, louboutin outlet, michael kors outlet, michael kors outlet, tiffany and co, burberry outlet, christian louboutin shoes, coach outlet store online, jordan shoes, polo ralph lauren outlet, louboutin, kate spade handbags, michael kors outlet, coach outlet, air max, gucci outlet, michael kors outlet, ray ban sunglasses, chanel handbags, michael kors outlet, tory burch outlet, nike free, kate spade outlet, louis vuitton outlet, burberry outlet, louis vuitton outlet stores, louis vuitton, nike shoes, michael kors outlet

oakleyses said...

jordan shoes, christian louboutin, uggs outlet, michael kors outlet online, uggs on sale, louis vuitton outlet, louis vuitton outlet, louis vuitton, ray ban sunglasses, replica watches, christian louboutin uk, chanel handbags, michael kors outlet online, uggs outlet, longchamp outlet, nike air max, michael kors outlet, burberry handbags, tiffany and co, polo outlet, nike free, nike air max, ugg boots, oakley sunglasses, ray ban sunglasses, michael kors outlet online, oakley sunglasses, christian louboutin outlet, longchamp outlet, prada handbags, gucci handbags, prada outlet, oakley sunglasses wholesale, michael kors outlet, oakley sunglasses, kate spade outlet, christian louboutin shoes, louis vuitton outlet, tory burch outlet, ugg boots, michael kors outlet online, burberry outlet, cheap oakley sunglasses, louis vuitton, ray ban sunglasses, nike outlet, longchamp outlet

oakleyses said...

sac vanessa bruno, new balance, vans pas cher, ray ban uk, nike blazer pas cher, true religion outlet, michael kors outlet, true religion outlet, replica handbags, polo lacoste, oakley pas cher, coach purses, hollister uk, abercrombie and fitch uk, nike free uk, north face uk, louboutin pas cher, polo ralph lauren, hollister pas cher, nike air max uk, michael kors pas cher, nike air max, true religion jeans, timberland pas cher, nike air max uk, coach outlet, air max, michael kors, jordan pas cher, sac hermes, north face, lululemon canada, coach outlet store online, nike roshe, sac longchamp pas cher, nike air force, mulberry uk, hogan outlet, ralph lauren uk, longchamp pas cher, michael kors, converse pas cher, burberry pas cher, nike roshe run uk, true religion outlet, kate spade, nike free run, nike tn, ray ban pas cher, guess pas cher

oakleyses said...

moncler uk, louis vuitton, thomas sabo, wedding dresses, barbour, moncler, gucci, montre pas cher, supra shoes, hollister, barbour uk, nike air max, karen millen uk, pandora uk, moncler, canada goose uk, coach outlet, ugg, juicy couture outlet, swarovski, canada goose, louis vuitton, moncler outlet, louis vuitton, hollister, ugg,ugg australia,ugg italia, canada goose outlet, replica watches, pandora jewelry, ugg,uggs,uggs canada, moncler, canada goose outlet, ugg pas cher, louis vuitton, juicy couture outlet, swarovski crystal, louis vuitton, canada goose, pandora charms, canada goose outlet, links of london, marc jacobs, lancel, converse, converse outlet, toms shoes, doudoune moncler, moncler, pandora jewelry, canada goose jackets, vans, canada goose

sameer said...



بعد التقدم المزهل في مجال التكنولجيا و العلم اصبح الجميع يبحث عن وسائل سهله و سريعه في نشر الخدمات المختلفه و كذلك المنتجات التي يريد طرحها في الاوسواق , و لم يقتصر الاشخاص في نشر بضائعهم علي طرحها في الاعلانات التي يتم طرحها علي التلفزيون فقط , بل اصبح من السهل الحصول علي موقع خاص بكل شخص من خلال
شركة تصميم مواقع
أو شركه تصميم وتطوير مواقع
كذلك يقوم الافراد بالبحث عن شركة تسويق أليكتروني للقيام بعمل دعايا كبيره لتلك المواقع التي تقدم خدمات الشركه او المؤسسسه سواء علي الفي سبوك او تويتر و غيرها من مواقع التواصل الاجتماعي مما يعود بفضل كبير علي الموقع لذلك يجب الاهتمام ب الـ
التسويق الالكتروني
و يجب الاهتمام بجانب يعد هو الاهم من امتلاك الموقع فعند القيام ببناء موقع خاص بك لن تجده في نتائج البحث ( فعلي سبيل المثال اذا كان موقعك يتحدث عن خدمات الرحلات و قومت بالبحث في جوجل عن شركه تنظيم رحلات ستجد الكثير من المواقع و لن تجد موقعك بين تلك المواقع و هذا لان الموقع يحتاج الي عمليات
بناء باك لينك
و التي تعد اهم جزء من الاجزاء التي يتم القيام بها لـ
تصدر نتائج البحث
و
جعل الموقع في النتائج الاولي
و تلك الخدمات تنطوي تحت ما تسمي ب
خدمات السيو
و هي التي تعمل علي مسك روابط الموقع بالكلمات التي تريد ظهور موقعك عند البحث عنها في مواقع البحث مثل جوجل

و عند امتلاكك موقع منذ فترات كبيره ستجد انه يحتاج الي تطوير وهذا لكي يتناسب مع التقدم الحديث في مجال المتصفحات و التي لم تعد تقتصر علي الكومبوتر او اللاب توب بل اصبح متعدد مثل الاندوريد و ال التاب و الاجهزه المختلفه و لهذا فانت بحاجه الي شركة تطوير مواقع
لكي يصبح موقعك مؤهلا بشكل كامل لتتفاعل مع جميع المتصفحات و يمتلك قوه كبيره لدي محركات البحث و سهل الاستخدام مع العملاء

و لكي تمتلك موقعك الخاص فانت بحاجه الي أفضل شركات تصميم المواقع و أهم شركات تصميم المواقع
و أرخص شركات تصميم المواقع
و التي تمتلك القدره العاليه علي تلبيه جميع طلباتكم و تنفيذ جميع الافكار التي يحتاج اليها كل فرد منكم و هذا لان تلك الشركه تمتلك افضل العروض و الامكانيات التي تجعلها رقم واحد بنصر و دول الشرق الاوسط بشكل عام لهذا فنحن ننصحكم بالتعامل مع شركه دبليو أم
لتصميم المواقع ............

نصيحه :
يجب علينا مواكبه التقدم السريع في عالم التكنوليجا و عدم التهاون في تلك البقعه من العالم حتي لا نختفي بين الاشخاص .....مع تمنياتي لكم بالتوفيق و النجاح .

Unknown said...

Good work!!
Congratulations!!
Thanks for Sharing Oracle Database.