Amazon

2014年2月2日日曜日

Debian/UbuntuにOracleクライアントをインストールする。

Oracleクライアントは、OTNからダウンロードできます。
zipファイルとRPMファイルがダウンロードできるのでRPM版をdebパッケージに変換しaptでインストールしました。

$ ls
oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-basiclite-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-devel-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-jdbc-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-odbc-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-tools-12.1.0.1.0-1.x86_64.rpm
$ mkdir debian
$ cd debian/
$ fakeroot alien --to-deb --scripts ../oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-basic_12.1.0.1.0-2_amd64.deb generated
$ ls
oracle-instantclient12.1-basic_12.1.0.1.0-2_amd64.deb
$ fakeroot alien --to-deb --scripts ../oracle-instantclient12.1-odbc-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-odbc_12.1.0.1.0-2_amd64.deb generated
$ fakeroot alien --to-deb --scripts ../oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-sqlplus_12.1.0.1.0-2_amd64.deb generated
$ sudo dpkg -i oracle-instantclient12.1-basic_12.1.0.1.0-2_amd64.deb 
Selecting previously unselected package oracle-instantclient12.1-basic.
(Reading database ... 86128 files and directories currently installed.)
Unpacking oracle-instantclient12.1-basic (from oracle-instantclient12.1-basic_12.1.0.1.0-2_amd64.deb) ...
Setting up oracle-instantclient12.1-basic (12.1.0.1.0-2) ...
Processing triggers for libc-bin ...
$ dpkg -L oracle-instantclient12.1-basic 
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/oracle-instantclient12.1-basic
/usr/share/doc/oracle-instantclient12.1-basic/copyright
/usr/share/doc/oracle-instantclient12.1-basic/changelog.Debian.gz
/usr/lib
/usr/lib/oracle
/usr/lib/oracle/12.1
/usr/lib/oracle/12.1/client64
/usr/lib/oracle/12.1/client64/bin
/usr/lib/oracle/12.1/client64/bin/adrci
/usr/lib/oracle/12.1/client64/bin/genezi
/usr/lib/oracle/12.1/client64/lib
/usr/lib/oracle/12.1/client64/lib/xstreams.jar
/usr/lib/oracle/12.1/client64/lib/libclntsh.so.12.1
/usr/lib/oracle/12.1/client64/lib/libnnz12.so
/usr/lib/oracle/12.1/client64/lib/ojdbc6.jar
/usr/lib/oracle/12.1/client64/lib/libons.so
/usr/lib/oracle/12.1/client64/lib/libocci.so.12.1
/usr/lib/oracle/12.1/client64/lib/liboramysql12.so
/usr/lib/oracle/12.1/client64/lib/ojdbc7.jar
/usr/lib/oracle/12.1/client64/lib/libociei.so
/usr/lib/oracle/12.1/client64/lib/libocijdbc12.so
/usr/lib/oracle/12.1/client64/lib/libclntshcore.so.12.1
$ sudo dpkg -i oracle-instantclient12.1-odbc_12.1.0.1.0-2_amd64.deb 
Selecting previously unselected package oracle-instantclient12.1-odbc.
(Reading database ... 86149 files and directories currently installed.)
Unpacking oracle-instantclient12.1-odbc (from oracle-instantclient12.1-odbc_12.1.0.1.0-2_amd64.deb) ...
Setting up oracle-instantclient12.1-odbc (12.1.0.1.0-2) ...
Processing triggers for libc-bin ...
$ dpkg -L oracle-instantclient12.1-odbc 
/.
/usr
/usr/share
/usr/share/oracle
/usr/share/oracle/12.1
/usr/share/oracle/12.1/client64
/usr/share/oracle/12.1/client64/ODBCRelnotesUS.htm
/usr/share/oracle/12.1/client64/ODBCRelnotesJA.htm
/usr/share/oracle/12.1/client64/odbc_update_ini.sh
/usr/share/oracle/12.1/client64/ODBC_IC_Readme_Unix.html
/usr/share/doc
/usr/share/doc/oracle-instantclient12.1-odbc
/usr/share/doc/oracle-instantclient12.1-odbc/copyright
/usr/share/doc/oracle-instantclient12.1-odbc/changelog.Debian.gz
/usr/lib
/usr/lib/oracle
/usr/lib/oracle/12.1
/usr/lib/oracle/12.1/client64
/usr/lib/oracle/12.1/client64/lib
/usr/lib/oracle/12.1/client64/lib/libsqora.so.12.1
$ sudo dpkg -i oracle-instantclient12.1-sqlplus_12.1.0.1.0-2_amd64.deb 
Selecting previously unselected package oracle-instantclient12.1-sqlplus.
(Reading database ... 86160 files and directories currently installed.)
Unpacking oracle-instantclient12.1-sqlplus (from oracle-instantclient12.1-sqlplus_12.1.0.1.0-2_amd64.deb) ...
Setting up oracle-instantclient12.1-sqlplus (12.1.0.1.0-2) ...
$ dpkg -L oracle-instantclient12.1-sqlplus 
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/oracle-instantclient12.1-sqlplus
/usr/share/doc/oracle-instantclient12.1-sqlplus/copyright
/usr/share/doc/oracle-instantclient12.1-sqlplus/changelog.Debian.gz
/usr/bin
/usr/lib
/usr/lib/oracle
/usr/lib/oracle/12.1
/usr/lib/oracle/12.1/client64
/usr/lib/oracle/12.1/client64/bin
/usr/lib/oracle/12.1/client64/bin/sqlplus
/usr/lib/oracle/12.1/client64/lib
/usr/lib/oracle/12.1/client64/lib/libsqlplus.so
/usr/lib/oracle/12.1/client64/lib/glogin.sql
/usr/lib/oracle/12.1/client64/lib/libsqlplusic.so
/usr/bin/sqlplus64
$ 

環境変数を設定して接続を確認します。

$ export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib:$LD_LIBRARY_PATH
$ export PATH=/usr/lib/oracle/12.1/client64/bin:$PATH
$ sqlplus

SQL*Plus: Release 12.1.0.1.0 Production on Sat Feb 1 23:34:52 2014

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

Enter user-name: scott/tiger@ubuntu13:1521/XE

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> 

0 件のコメント: