3
Articles from Database administrator workshop 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." view plainprint? 1. ubuntu@ubuntu-VirtualBox:~$ sudo apt-get install alien Then go to your download directory and list the available rpm packets. view plainprint? 1. ubuntu@ubuntu-VirtualBox:~$ cd Downloads/ 2. ubuntu@ubuntu-VirtualBox:~/Downloads$ ls 3. oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm 4. oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm 5. oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm Let's install all of them using alien command: view plainprint? 1. ubuntu@ubuntu-VirtualBox:~/Downloads$ sudo alien -i oracle- instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm 2. dpkg --no-force-overwrite -i oracle-instantclient12.1-sqlplus_12.1.0.1.0- 2_i386.deb 3. Selecting previously unselected package oracle-instantclient12.1-sqlplus. 4. (Reading database ... 142987 files and directories currently installed.) 5. Unpacking oracle-instantclient12.1-sqlplus (from oracle-instantclient12.1- sqlplus_12.1.0.1.0-2_i386.deb) ... 6. Setting up oracle-instantclient12.1-sqlplus (12.1.0.1.0-2) ... Now it's time for the Instant Client Basic Package:

How to install oracle instant client 12c and oracle sql plus on Ubuntu

  • Upload
    marco-v

  • View
    3.456

  • Download
    4

Embed Size (px)

DESCRIPTION

http://dbaworkshop.blogspot.it/2013/07/How-to-install-Oracle-Instant-Client-12c-and-Oracle-SQL-Plus-12c-on-Ubuntu.html How to install oracle instant client 12c and oracle sql plus on Ubuntu

Citation preview

Page 1: How to install oracle instant client 12c and oracle sql plus on Ubuntu

Articles from Database administratorworkshop

How to install Oracle Instant Client 12c and OracleSQL 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 onUbuntu 12.04.

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

On the next web page select "Accept License Agreement" so you can downloadsome rpm packets of the latest available Instant Client version (today is Version12.1.0.1.0).

Click on oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm (Instant ClientPackage - 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 InstantClient) and oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm (Instant ClientPackage - SDK: Additional header files and an example makefile for developingOracle applications with Instant Client).

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

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

view plainprint?

1. ubuntu@ubuntu-VirtualBox:~$ sudo apt-get install alien

Then go to your download directory and list the available rpm packets. view plainprint?

1. ubuntu@ubuntu-VirtualBox:~$ cd Downloads/ 2. ubuntu@ubuntu-VirtualBox:~/Downloads$ ls 3. oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm 4. oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm 5. oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm

Let's install all of them using alien command: view plainprint?

1. ubuntu@ubuntu-VirtualBox:~/Downloads$ sudo alien -i oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm

2. dpkg --no-force-overwrite -i oracle-instantclient12.1-sqlplus_12.1.0.1.0-2_i386.deb

3. Selecting previously unselected package oracle-instantclient12.1-sqlplus. 4. (Reading database ... 142987 files and directories currently installed.) 5. Unpacking oracle-instantclient12.1-sqlplus (from oracle-instantclient12.1-

sqlplus_12.1.0.1.0-2_i386.deb) ... 6. Setting up oracle-instantclient12.1-sqlplus (12.1.0.1.0-2) ...

Now it's time for the Instant Client Basic Package:

Page 2: How to install oracle instant client 12c and oracle sql plus on Ubuntu

view plainprint?

1. ubuntu@ubuntu-VirtualBox:~/Downloads$ sudo alien -i oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm

2. dpkg --no-force-overwrite -i oracle-instantclient12.1-basic_12.1.0.1.0-2_i386.deb

3. Selecting previously unselected package oracle-instantclient12.1-basic. 4. (Reading database ... 143000 files and directories currently installed.) 5. Unpacking oracle-instantclient12.1-basic (from oracle-instantclient12.1-

basic_12.1.0.1.0-2_i386.deb) ... 6. Setting up oracle-instantclient12.1-basic (12.1.0.1.0-2) ... 7. Processing triggers for libc-bin ... 8. ldconfig deferred processing now taking place

And finally it's time for Instant Client SDK Package: view plainprint?

1. ubuntu@ubuntu-VirtualBox:~/Downloads$ sudo alien -i oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm

2. dpkg --no-force-overwrite -i oracle-instantclient12.1-devel_12.1.0.1.0-2_i386.deb

3. Selecting previously unselected package oracle-instantclient12.1-devel. 4. (Reading database ... 143016 files and directories currently installed.) 5. Unpacking oracle-instantclient12.1-devel (from oracle-instantclient12.1-

devel_12.1.0.1.0-2_i386.deb) ... 6. Setting up oracle-instantclient12.1-devel (12.1.0.1.0-2) ...

Let's try to issue the sqlplus command view plainprint?

1. ubuntu@ubuntu-VirtualBox:~$ sqlplus / as sysdba 2. 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 libaio1using the usual apt-get command. view plainprint?

1. ubuntu@ubuntu-VirtualBox:~$ sudo apt-get install libaio1 2. Reading package lists... Done 3. Building dependency tree 4. Reading state information... Done 5. The following NEW packages will be installed: 6. libaio1 7. 0 upgraded, 1 newly installed, 0 to remove and 608 not upgraded. 8. Need to get 6,648 B of archives. 9. After this operation, 53.2 kB of additional disk space will be used.

10. Get:1 http://it.archive.ubuntu.com/ubuntu/ precise/main libaio1 i386 0.3.109-2ubuntu1 [6,648 B]

11. Fetched 6,648 B in 0s (12.5 kB/s) 12. Selecting previously unselected package libaio1. 13. (Reading database ... 143067 files and directories currently installed.) 14. Unpacking libaio1 (from .../libaio1_0.3.109-2ubuntu1_i386.deb) ... 15. Setting up libaio1 (0.3.109-2ubuntu1) ... 16. Processing triggers for libc-bin ... 17. ldconfig deferred processing now taking place

Let's try to run sqlplus again. view plainprint?

1. ubuntu@ubuntu-VirtualBox:~/Downloads$ sqlplus / as sysdba 2. 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 theoracle.conf file issuing the following command and simply adding a line (the pathwhere were installed all the libraries of the Instant Client packages:/usr/lib/oracle/12.1/client/lib): view plainprint?

1. ubuntu@ubuntu-

Page 3: How to install oracle instant client 12c and oracle sql plus on Ubuntu

VirtualBox:~/Downloads$sudo vi /etc/ld.so.conf.d/oracle.conf 2. /usr/lib/oracle/12.1/client/lib

Now update the information of all the shared libraries on your system. view plainprint?

1. ubuntu@ubuntu-VirtualBox:~/Downloads$sudo ldconfig

Run sqlplus again... and as you can see it works... view plainprint?

1. ubuntu@ubuntu-VirtualBox:~$ sqlplus / as sysdba 2. 3. SQL*Plus: Release 12.1.0.1.0 Production on Sun Jul 14 20:01:37 2013 4. 5. Copyright (c) 1982, 2013, Oracle. All rights reserved. 6. 7. ERROR: 8. 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.