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 Client セットアップ概要

0
Last updated at Posted at 2024-11-12

Oracle Databaseに接続するためには,クライアント側に接続ドライバ(ライブラリ)を用意する必要がありますが,その方式においては主に次の2つがあります。

  • Thick系
    • Oracle Client libraries(OCIなど)を利用して接続
    • Oracle Database ClientまたはOracle Instant Clientの導入が必要
  • Thin系
    • OCIを使わず,ドライバ単体で接続
    • JDBC Thin など,クライアント導入不要のケースあり

本記事では,特に利用頻度が高いであろう,Oracle Instant Clientを中心に整理します。

Thick系

ドキュメントリンク

Oracle Database Client

Oracle Universal Installer(OUI)を使って導入する,フル機能のパッケージです。
選択するインストールタイプによっても変わりますが,Databaseに関わる管理・移行ツールがまとめて同梱されています。orapkimkstoreコマンドはInstant Clientには含まれていないため,こちらを使用する必要があります。1

GUIでのインストールに加え,runInstallerを使用したCLIによるインストールもすることができます。2

Oracle Instant Client

FAQ

接続に必要な最小限のファイル(OCI/OCCI/ODBC/JDBC-OCI など)をパッケージ化したものです。
PythonやPHPなど,よく使用されるプログラミング言語環境で使用する際に使われるミドルウェアや,SQL*PlusやOracle Data Pumpなどのスタンドアロンで簡易にデータを扱えるツールが追加で提供されています。
また,ORACLE_HOMEの設定が不要のため,アプリケーションのデプロイを単純化できます。

ダウンロードおよびインストールはZipまたはRPMで完了することができ,主に以下表にある8つのパッケージ形式で提供されています。また,コンテナの形式も用意されており,DockerfileはGitHubから,イメージはOracleの提供するGitHubコンテナレジストリから入手できます。

パッケージ 説明
Basic Oracle Database用のOracle Call Interface (OCI),OCCIおよびJDBC-OCIアプリケーションの実行に必要なすべてのファイル
Basic Light Basicパッケージの簡易バージョン。英語のエラー・メッセージとUnicode,ASCII,西欧キャラクタ・セットのみをサポート
SDK OCIおよびOCCIアプリケーションを開発するための追加のヘッダー・ファイルとmakefileサンプル
SQL*Plus SQLとPL/SQLの文およびスクリプトを実行するためのSQL*Plusコマンドライン・ツールを備える追加のパッケージ
ツール Data Pump,SQL*Loader,Workload Replay Clientなどの追加のツール
ODBC ODBCを提供する追加ライブラリ
プリコンパイラ ProCおよびProCOBOLプリコンパイラを提供する追加のツールおよびライブラリ
JDBC OCIの追加ライブラリ 国際化をサポートする追加ライブラリ

すべての導入でBasicまたはBasic Lightが必須で,他は必要に応じて追加します。インストールする環境によってすべてのパッケージが用意されているわけではないようなので,その部分は注意します。

例えば,Oracle Databaseに接続する接続手法としてCUIベースのクライアントソフトであるSQL*Plusがあると思いますが,このSQL*Plusを使用できるようになるためには以下の2つのパッケージをインストールする必要があります。

  • Oracle Instant Client Basic
  • Oracle Instant Client Sqlplus

後者のSqlplusパッケージは前者のBasicパッケージに依存しているので,Basic → Sqlplus の順番でインストールします。

クラウドダウンロードリンク

各プラットフォームごとのパッケージのダウンロードリンクは探すのが面倒のため,基本的なものは以下にまとめています。

上では代表的なものを挙げていますが,親元のリンクはこちらです。自身の環境がない場合は覗いてみてください。

yum/dnfでインストールする

yum/dnfでインストールする際のコマンドメモです

➜  ~ sudo dnf search oracle-instant
Last metadata expiration check: 10:13:54 ago on Mon 13 Oct 2025 12:30:33 AM JST.
============================================= Name Matched: oracle-instant =============================================
oracle-instantclient-basic.x86_64 : Oracle Instant Client Basic package
oracle-instantclient-release-23ai-el8.src : Oracle Software yum repository configuration
oracle-instantclient-release-23ai-el8.x86_64 : Oracle Software yum repository configuration
oracle-instantclient-release-el8.src : Oracle Instant Client yum repository configuration
oracle-instantclient-release-el8.x86_64 : Oracle Instant Client yum repository configuration
oracle-instantclient-tools.x86_64 : Tools for Oracle Instant Client
oracle-instantclient19.10-basic.x86_64 : Oracle Instant Client Basic package
oracle-instantclient19.10-basiclite.x86_64 : Oracle Instant Client Light package
...
sudo dnf -y install oracle-instantclient-basic.x86_64
sudo dnf -y install oracle-instantclient19.9-sqlplus.x86_64

Thin系

Oracle Databaseに接続するためのドライバーは様々ありますが,JDBC ThinのようにOracle Clientの導入が不要で接続できるケースもあります。例えば,SQLclはデフォルトでJDBC Thinを使用しているため,Oracle Clientのインストールせずとも使用ができます。3
また,python-oracledb4node-oracledbなどでは,クライアント不要なThinとInstant Client 等が必要なThickの2つの接続モードが選択可能です。

モードによって使用できる機能に若干の差があるので注意します。5

  1. https://asktom.oracle.com/ords/f?p=100%3A11%3A%3A%3A%3A%3AP11_QUESTION_ID%3A9546923300346833859

  2. https://docs.oracle.com/cd/F19136_01/lacli/running-oracle-universal-installer-to-install-oracle-database-client.html

  3. https://docs.oracle.com/en/database/oracle/sql-developer-command-line/25.2/sqcug/configuring-thick-driver-support-sqlcl.html

  4. https://python-oracledb.readthedocs.io/en/latest/user_guide/introduction.html#python-oracledb-thin-mode-architecture

  5. https://node-oracledb.readthedocs.io/en/latest/user_guide/appendix_a.html#featuresummary

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?