I'm aware of some tutorials where people tell you to use "alien" to convert Oracle RPMs to DEBs but I preffer to use ZIPs, so I'll post here how it works including the Basic package along with the SQL*Plus and the SDK.
I'll be using the Virtual Machine created in my first post, you might want to use your own computer with Ubuntu already installed and the only difference is that you might already have the required packages installed.
- Get the following files from Oracle Download site:
instantclient-basic-linux.x64-188.8.131.52.0.zip instantclient-sdk-linux.x64-184.108.40.206.0.zip instantclient-sqlplus-linux.x64-220.127.116.11.0.zip
- You will need unzip for the files and SQL*Plus requires the Linux kernel AIO access library, to install the packages use the following:
sudo apt-get install unzip libaio1
- Instant Client will be installed under /usr/lib/oracle, from the directory where you have the ZIP files enter the following commands:
sudo unzip instantclient-basic-linux.x64-18.104.22.168.0.zip -d /usr/lib/oracle sudo unzip instantclient-sdk-linux.x64-22.214.171.124.0.zip -d /usr/lib/oracle sudo unzip instantclient-sqlplus-linux.x64-126.96.36.199.0.zip -d /usr/lib/oracle
- You need two Symbolic Links for compilation purposes, create them with the following commands:
sudo ln -s /usr/lib/oracle/instantclient_11_2/libclntsh.so.11.1 /usr/lib/oracle/instantclient_11_2/libclntsh.so sudo ln -s /usr/lib/oracle/instantclient_11_2/libocci.so.11.1 /usr/lib/oracle/instantclient_11_2/libocci.so
- Dynamic Linker Run-Time Bindings must be configured, create a new file with the following command:
And insert the following line:
sudo vi /etc/ld.so.conf.d/oracle.conf
Save the file and run the configuration of the Dynamic Linker Run-Time Bindings with the following command:
- Some environment variables are required and you can add the directory to the path, create a new file with the following command:
And insert the following lines:
sudo vi /etc/profile.d/oracle.sh
Please note, the NLS_LANG environment variable must match the configuration of your Oracle Database or you will have character problems I normally use one of AMERICAN_AMERICA.AL32UTF8, MEXICAN SPANISH_MEXICO.AL32UTF8, MEXICAN SPANISH_MEXICO.WE8ISO8859P1 or MEXICAN SPANISH_MEXICO.WE8ISO8859P15 but you might need another.
export ORACLE_HOME=/usr/lib/oracle/instantclient_11_2 export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 export TNS_ADMIN=/etc/oracle export PATH=$PATH:$ORACLE_HOME
- Log out and log in again to make the new environment variables available to your user.
- Finally, the tnsnames.ora file must be created in the path defined in the environment variable TNS_ADMIN, create the directory with the following command:
Create the file with the following command:
sudo mkdir /etc/oracle
And insert the lines you need to configure your connections, for example:
sudo vi /etc/oracle/tnsnames.ora
ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.87)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = orcl) ) )
Feel free to use "alien" to make your own DEBs, I'm not against that in any way, I'm just posting this because some people I've worked with believe that just by installing those DEB files everything will work as espected ignoring some missing steps are needed. Hopefully, this will save you some time.
I hope this will help someone out there, please feel free to send any comments.