0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Oracle Instant Client

0
Last updated at Posted at 2026-09-06

Oracle Database Client をインストールするには、インフラチームへの申請が必要となるが、今すぐ使いたい。

そんな要望は、ちらほらあるかと思う。

そんな時に使用できるのが、Oracle Instant Client。インストール不要で、ZIP圧縮されたファイルを解凍すれば使えるとのことで、試してみることにした。

■ Oracle Instant Client公式HP

-Oracle Instant Client ダウンロード-
Instant Clientは、Oracleより入手する。

各パッケージの説明は下記のとおりだが、SQL*Plusを動かすには「SQL*Plus Package」だけでなく、「Basic Package」または「Basic Light Package」も必要となる。

【全体の流れ】
1.「SQL*Plus Package(ZIP) 」および「Basic Package(ZIP)」ダウンロード
2.同一ディレクトリに双方のZIPを解凍
3.環境変数のパスをとおす

image.png

以下のページより、「Instant Client for Linux x86-64」をクリック。

image.png

遷移先の画面では「SQL*Plus Package(ZIP)」および「Basic Package(ZIP)」をダウンロードする。(他にも多数のバージョンがあるので、用途に応じて適したものを選択する)

image.png

image.png

今回ダウンロードしたのは以下の2ファイル。

 instantclient-basic-linux.x64-23.26.3.0.0.zip
 instantclient-sqlplus-linux.x64-23.26.3.0.0.zip

-Oracle Instant Client セットアップ-

Oracle Instant Clientのセットアップを行いたいサーバに、上記2ファイルを配置する。

① ダウンロードファイルの配置
[root@localhost oracle]# pwd
/work/oracle
[root@localhost oracle]# ls -ltr ./
合計 138528
-rwxrwxrwx. 1 root root 136114689  9月  6 16:29 instantclient-basic-linux.x64-23.26.3.0.0.zip
-rwxrwxrwx. 1 root root   5731358  9月  6 16:41 instantclient-sqlplus-linux.x64-23.26.3.0.0.zip

資材配置後、解凍する。

② ダウンロードファイルの解凍
[root@localhost oracle]# unzip -q ./instantclient-basic-linux.x64-23.26.3.0.0.zip
[root@localhost oracle]# ls -ltr ./
合計 138532
-rwxrwxrwx. 1 root root 136114689  9月  6 16:29 instantclient-basic-linux.x64-23.26.3.0.0.zip
-rwxrwxrwx. 1 root root   5731358  9月  6 16:41 instantclient-sqlplus-linux.x64-23.26.3.0.0.zip
drwxr-xr-x. 2 root root        64  9月  6 16:58 META-INF
drwxr-xr-x. 3 root root      4096  9月  6 16:58 instantclient_23_26
[root@localhost oracle]#
[root@localhost oracle]# unzip -q ./instantclient-sqlplus-linux.x64-23.26.3.0.0.zip
replace META-INF/MANIFEST.MF? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
[root@localhost oracle]# ls -ltr ./
合計 138532
-rwxrwxrwx. 1 root root 136114689  9月  6 16:29 instantclient-basic-linux.x64-23.26.3.0.0.zip
-rwxrwxrwx. 1 root root   5731358  9月  6 16:41 instantclient-sqlplus-linux.x64-23.26.3.0.0.zip
drwxr-xr-x. 2 root root        64  9月  6 17:10 META-INF
drwxr-xr-x. 3 root root      4096  9月  6 17:10 instantclient_23_26
[root@localhost oracle]#

環境変数を設定し、PATHをとおす。

③ 環境変数の設定
[root@localhost oracle]# export NLS_LANG=Japanese_Japan.AL32UTF8
[root@localhost oracle]# export ORACLE_HOME=/work/oracle/instantclient_23_26
[root@localhost oracle]# export LD_LIBRARY_PATH=$ORACLE_HOME/
[root@localhost oracle]# export ORACLE_LIBRARY=$ORACLE_HOME/libclntsh.so
[root@localhost oracle]# export PATH=$ORACLE_HOME:$PATH

事前に作成しておいたOracle Databaseへ接続する。
※ 接続するためのユーザおよび、サービス等を用意しておく

④ Oracle Databaseへ接続
[root@localhost oracle]# sqlplus TEST_USER01/******@192.168.56.100:1521/TEST_SERVICE

SQL*Plus: Release 23.26.3.0.0 - Production on 日 9月 6 17:46:03 2026
Version 23.26.3.0.0

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

最終正常ログイン時間: 日 9月  06 2026 17:45:06 +09:00


Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
に接続されました。
SQL> sho user
ユーザーは"TEST_USER01"です。
SQL> exit
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0との接続が切断されました。
[root@localhost oracle]#

この後、$ORACLE_HOME/network/admin 配下にtnsnames.oraを作成すれば、tnsnames.ora経由での接続も可能となる。

⑤ tnsnames.oraの作成
[root@localhost oracle]# cd /work/oracle/instantclient_23_26/network/admin/
[root@localhost admin]# pwd
/work/oracle/instantclient_23_26/network/admin
[root@localhost admin]# vi ./tnsnames.ora
[root@localhost admin]# cat ./tnsnames.ora
TESTDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.100)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = TEST_SERVICE)
    )
  )

ネット・サービス名で接続。

⑤ tnsnames.oraの作成
[root@localhost admin]# sqlplus TEST_USER01/******@TESTDB

SQL*Plus: Release 23.26.3.0.0 - Production on 日 9月 6 18:14:56 2026
Version 23.26.3.0.0

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

最終正常ログイン時間: 日 9月  06 2026 18:14:02 +09:00


Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
に接続されました。
SQL>
SQL> sho user
ユーザーは"TEST_USER01"です。
SQL> exit
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0との接続が切断されました。
[root@localhost admin]#

接続できた。

- 参考 -

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?