2017/10/28

macOS High SierraにOracle Instant Client(12.2.0.1.0)をインストール

macOS 向けの Oracle Instant Client 12.2 がリリースされたようですのでインストールしたときのメモです。

ダウンロード

コマンドラインでのダウンロードを試みましたが、OTN ソフトウェアも eDelivery 経由でのダウンロードになってから SSO 認証での上手いやり方が見つかりませんでしたのでブラウザで手動でダウンロードします。

インストール

手順は前回と同様です。zip ファイルを展開するだけです。

% for f in ~/Downloads/instantclient-*-macos.x64-12.2.0.1.0.zip; do unzip -o $f -d ~/local; done
12.2 のクライアントもとくに DYLD_LIBRARY_PATH 環境変数を設定しなくても接続できるようです。
% ~/local/instantclient_12_2/sqlplus system/Oradoc_db1@localhost/orclpdb1

SQL*Plus: Release 12.2.0.1.0 Production on Sat Oct 28 20:01:29 2017

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL>
詳しい仕組みは理解していませんが、インストール手順の Noteに -rpath について言及があるように、実行ファイルからの相対パス上にライブラリファイルがあることを想定しているようですので、同じ場所に解凍すればそれだけで大丈夫そうです。
% otool -L ~/local/instantclient_12_2/sqlplus
/Users/yoshikaw/local/instantclient_12_2/sqlplus:
        @rpath/libsqlplus.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libclntsh.dylib.12.1 (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libclntshcore.dylib.12.1 (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libnnz12.dylib (compatibility version 0.0.0, current version 0.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
        /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)

アーカイブ内のファイル一覧

そういえば 12.2 の Instant Client の tools には SQL*Loader や Data Pump が含まれるようになっていますね。

% for f in ~/Downloads/instantclient-*-macos.x64-12.2.0.1.0.zip; do unzip -l $f; done | grep instantclient_12_2 | perl -pe 's/( *\d+) +(\d+-\d+)-(\d+) (.{5}) +/$3-$2 $4 $1 /' | sort -u
2001-04-25 02:04        60 instantclient_12_2/sdk/demo/occiobj.typ
2002-10-15 18:19      2115 instantclient_12_2/sdk/include/occi.h
2005-07-07 19:38      4048 instantclient_12_2/sdk/include/ocidem.h
2005-07-07 19:38      8953 instantclient_12_2/sdk/include/ociextp.h
2005-07-07 19:39     10361 instantclient_12_2/sdk/include/oci8dp.h
2005-09-26 03:58      6204 instantclient_12_2/sdk/include/ociapr.h
2005-09-26 03:58      6494 instantclient_12_2/sdk/include/ocikpr.h
2005-09-26 03:58     43001 instantclient_12_2/sdk/include/ocidef.h
2005-09-26 03:59      7203 instantclient_12_2/sdk/include/oci1.h
2006-08-02 13:13     15083 instantclient_12_2/sdk/include/orid.h
2006-08-02 13:13    102775 instantclient_12_2/sdk/include/ori.h
2006-09-06 12:59      9892 instantclient_12_2/sdk/include/xa.h
2007-10-30 12:29     24778 instantclient_12_2/sdk/include/occiObjects.h
2010-02-16 17:50     39934 instantclient_12_2/sdk/include/occiData.h
2013-03-19 07:45      6181 instantclient_12_2/help/us/blafdoc.css
2013-03-19 07:46      2122 instantclient_12_2/help/us/oracle.gif
2013-03-19 07:46      7468 instantclient_12_2/help/us/map.xml
2013-03-19 07:48     13107 instantclient_12_2/help/us/img/odbcmodel.gif
2013-03-19 07:48     13174 instantclient_12_2/help/us/img/setup_ora.gif
2013-03-19 07:48     14486 instantclient_12_2/help/us/img/setup_work.gif
2013-03-19 07:48     16950 instantclient_12_2/help/us/img/odbcdrvarch.gif
2013-03-19 07:48     19937 instantclient_12_2/help/us/img/setup_ssmig.gif
2013-03-19 07:48     26457 instantclient_12_2/help/us/img/setup_app.gif
2013-03-19 07:49      1035 instantclient_12_2/help/us/img_text/setup_ora.htm
2013-03-19 07:49      1040 instantclient_12_2/help/us/img_text/setup_app.htm
2013-03-19 07:49      1044 instantclient_12_2/help/us/img_text/setup_work.htm
2013-03-19 07:49      1051 instantclient_12_2/help/us/img_text/setup_ssmig.htm
2013-03-19 07:49      1311 instantclient_12_2/help/us/img_text/odbcmodel.htm
2013-03-19 07:49      2746 instantclient_12_2/help/us/img_text/odbcdrvarch.htm
2014-03-12 08:25      1140 instantclient_12_2/sdk/demo/oraaccess.xml
2014-04-10 19:33      1043 instantclient_12_2/help/ja/img_text/setup_ora.htm
2014-04-10 19:33      1049 instantclient_12_2/help/ja/img_text/setup_ssmig.htm
2014-04-10 19:33      1057 instantclient_12_2/help/ja/img_text/setup_work.htm
2014-04-10 19:33      1061 instantclient_12_2/help/ja/img_text/setup_app.htm
2014-04-10 19:33      1451 instantclient_12_2/help/ja/img_text/odbcmodel.htm
2014-04-10 19:33      2122 instantclient_12_2/help/ja/oracle.gif
2014-04-10 19:33      3315 instantclient_12_2/help/ja/img_text/odbcdrvarch.htm
2014-04-10 19:33      6126 instantclient_12_2/help/ja/blafdoc.css
2014-04-10 19:33      7389 instantclient_12_2/help/ja/map.xml
2014-04-10 19:33     13107 instantclient_12_2/help/ja/img/odbcmodel.gif
2014-04-10 19:33     13174 instantclient_12_2/help/ja/img/setup_ora.gif
2014-04-10 19:33     14486 instantclient_12_2/help/ja/img/setup_work.gif
2014-04-10 19:33     16950 instantclient_12_2/help/ja/img/odbcdrvarch.gif
2014-04-10 19:33     19937 instantclient_12_2/help/ja/img/setup_ssmig.gif
2014-04-10 19:33     26457 instantclient_12_2/help/ja/img/setup_app.gif
2014-05-05 13:17     18742 instantclient_12_2/ODBC_IC_Readme_Unix.html
2014-06-25 18:45     42866 instantclient_12_2/sdk/include/oro.h
2014-06-25 18:45    158261 instantclient_12_2/sdk/include/orl.h
2014-10-11 03:30      8138 instantclient_12_2/sdk/include/ocixmldb.h
2015-03-16 11:24     17656 instantclient_12_2/sdk/demo/cdemo81.c
2015-04-25 04:49       342 instantclient_12_2/glogin.sql
2015-04-30 00:20     44851 instantclient_12_2/sdk/include/ldap.h
2015-05-06 21:43      1966 instantclient_12_2/sdk/demo/occidemod.sql
2015-05-06 21:43      4902 instantclient_12_2/sdk/demo/occiobj.cpp
2015-05-06 21:43      7649 instantclient_12_2/sdk/demo/occidml.cpp
2015-05-06 21:43      8358 instantclient_12_2/sdk/demo/occidemo.sql
2015-05-06 21:46     11649 instantclient_12_2/sdk/include/occiAQ.h
2015-05-06 21:46     11782 instantclient_12_2/sdk/include/ocidfn.h
2015-05-06 21:46     35604 instantclient_12_2/sdk/include/occiCommon.h
2015-05-06 21:46     72561 instantclient_12_2/sdk/include/occiControl.h
2015-05-06 21:46    123766 instantclient_12_2/sdk/include/ort.h
2015-05-06 21:53      6798 instantclient_12_2/sdk/demo/setuporamysql.sh
2015-07-25 07:06      5959 instantclient_12_2/help/us/cpyr.htm
2015-07-25 07:06    182874 instantclient_12_2/help/us/sqora.htm
2015-07-25 07:08      9486 instantclient_12_2/help/us/toc.htm
2015-07-29 11:39        76 instantclient_12_2/help/us/META-INF/MANIFEST.MF
2015-09-08 08:37      4663 instantclient_12_2/odbc_update_ini.sh
2015-09-10 10:07     10044 instantclient_12_2/sdk/admin/oraaccess.xsd
2015-10-01 08:15    438428 instantclient_12_2/sdk/include/ociap.h
2016-01-21 08:37     78862 instantclient_12_2/sdk/include/nzt.h
2016-05-20 22:13        76 instantclient_12_2/help/ja/META-INF/MANIFEST.MF
2016-05-20 22:13      7100 instantclient_12_2/help/ja/cpyr.htm
2016-05-20 22:13      9583 instantclient_12_2/help/ja/toc.htm
2016-05-20 22:13    205437 instantclient_12_2/help/ja/sqora.htm
2016-05-31 21:28     32313 instantclient_12_2/sdk/include/odci.h
2016-07-27 03:10     37493 instantclient_12_2/sdk/include/nzerror.h
2016-08-13 10:03    111273 instantclient_12_2/sdk/include/ocixstream.h
2016-09-30 14:00      6506 instantclient_12_2/sdk/include/oratypes.h
2016-10-20 13:14       898 instantclient_12_2/sdk/ott
2016-10-29 06:25    194752 instantclient_12_2/sdk/include/oci.h
2016-12-14 01:39   4036257 instantclient_12_2/ojdbc8.jar
2016-12-17 18:21     88120 instantclient_12_2/orai18n-mapping.jar
2016-12-17 18:21   1661088 instantclient_12_2/orai18n.jar
2017-01-26 17:36     74230 instantclient_12_2/xstreams.jar
2017-01-26 18:59    312974 instantclient_12_2/sdk/ottclasses.zip
2017-06-29 13:22    201980 instantclient_12_2/libons.dylib
2017-06-29 13:24   8179072 instantclient_12_2/libnnz12.dylib
2017-07-12 20:29   1639388 instantclient_12_2/libsqlplusic.dylib
2017-07-12 20:35   1465312 instantclient_12_2/libocci.dylib.12.1
2017-07-14 21:04   4685408 instantclient_12_2/libclntshcore.dylib.12.1
2017-08-08 16:32    151748 instantclient_12_2/libocijdbc12.dylib
2017-08-08 16:33     13916 instantclient_12_2/libheteroxa12.dylib
2017-08-08 16:49     22980 instantclient_12_2/libnfsodm12.dylib
2017-08-08 17:29   5573896 instantclient_12_2/libsqora.dylib.12.1
2017-08-08 17:31  85621532 instantclient_12_2/libclntsh.dylib.12.1
2017-08-08 19:09     84988 instantclient_12_2/liboramysql12.dylib
2017-10-05 23:02   1267088 instantclient_12_2/libsqlplus.dylib
2017-10-05 23:09       400 instantclient_12_2/BASIC_README
2017-10-05 23:09   6349764 instantclient_12_2/libociicus.dylib
2017-10-05 23:09 124769196 instantclient_12_2/libociei.dylib
2017-10-05 23:10        18 instantclient_12_2/libocci.dylib
2017-10-05 23:10        20 instantclient_12_2/libclntsh.dylib
2017-10-05 23:10       410 instantclient_12_2/BASIC_LITE_README
2017-10-05 23:10     10036 instantclient_12_2/adrci
2017-10-05 23:10     40360 instantclient_12_2/genezi
2017-10-05 23:10    146084 instantclient_12_2/uidrvci
2017-10-05 23:11         0 instantclient_12_2/
2017-10-05 23:11         0 instantclient_12_2/help/
2017-10-05 23:11         0 instantclient_12_2/help/ja/
2017-10-05 23:11         0 instantclient_12_2/help/ja/META-INF/
2017-10-05 23:11         0 instantclient_12_2/help/ja/img/
2017-10-05 23:11         0 instantclient_12_2/help/ja/img_text/
2017-10-05 23:11         0 instantclient_12_2/help/us/
2017-10-05 23:11         0 instantclient_12_2/help/us/META-INF/
2017-10-05 23:11         0 instantclient_12_2/help/us/img/
2017-10-05 23:11         0 instantclient_12_2/help/us/img_text/
2017-10-05 23:11         0 instantclient_12_2/sdk/
2017-10-05 23:11         0 instantclient_12_2/sdk/admin/
2017-10-05 23:11         0 instantclient_12_2/sdk/demo/
2017-10-05 23:11         0 instantclient_12_2/sdk/include/
2017-10-05 23:11       396 instantclient_12_2/sdk/SDK_README
2017-10-05 23:11       398 instantclient_12_2/JDBC_README
2017-10-05 23:11       400 instantclient_12_2/TOOLS_README
2017-10-05 23:11       404 instantclient_12_2/SQLPLUS_README
2017-10-05 23:11      3910 instantclient_12_2/sdk/demo/demo.mk
2017-10-05 23:11      8480 instantclient_12_2/sqlplus
2017-10-05 23:11    223984 instantclient_12_2/expdp
2017-10-05 23:11    236192 instantclient_12_2/impdp
2017-10-05 23:11    381364 instantclient_12_2/imp
2017-10-05 23:11    731952 instantclient_12_2/exp
2017-10-05 23:11   1018516 instantclient_12_2/wrc
2017-10-05 23:11   1843764 instantclient_12_2/sqlldr
BASIC の README。
% cat BASIC_README
Basic Package Information
=========================

Thu Oct  5 07:09:59 PDT 2017

Client Shared Library 64-bit - 12.2.0.1.0

System name:    Darwin
Release:        15.6.0
Version:        Darwin Kernel Version 15.6.0: Sun Jun  4 21:43:07 PDT 2017; root:xnu-3248.70.3~1/RELEASE_X86_64
Machine:        x86_64

Operating in ORACLE_HOME environment.

Small timezone file = timezone_26.dat
Large timezone file = timezlrg_26.dat
今回試した macOS のバージョン。
% uname -v
Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64

SDKの動作確認

いつものとおり SDK の動作確認として cpanm で DBD::Oracle をビルドしてみます。

% cpanm DBD::Oracle
--> Working on DBD::Oracle
Fetching http://www.cpan.org/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.74.tar.gz ... OK
Configuring DBD-Oracle-1.74 ... OK
Building and testing DBD-Oracle-1.74 ... OK
Successfully installed DBD-Oracle-1.74
1 distribution installed
12.1 の時には @rpath が解決できないエラーが出て install_name_tool(1) で共有ライブラリ中のパスを書き換える必要がありましたが、12.2 ではとくに何も出ませんでした。というかライブラリのファイル名だけをみると 12.1 相当に見えます。
% otool -D libclntsh.dylib.12.1
libclntsh.dylib.12.1:
@rpath/libclntsh.dylib.12.1
接続してクライアント情報を見てみると 12.2 っぽいのでファイル名は気にしてはいけないのかも知れません。
% ~/local/instantclient_12_2/sqlplus system/Oradoc_db1@localhost/orclpdb1 <<'SQL'
select client_version, client_driver, client_connection, client_oci_library from v$session_connect_info fetch first 1 rows only;
SQL

SQL*Plus: Release 12.2.0.1.0 Production on Sat Oct 28 21:18:39 2017

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

Last Successful login time: Sat Oct 28 2017 21:18:24 +09:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL>
CLIENT_VERSION                           CLIENT_DRIVER
---------------------------------------- ------------------------------
CLIENT_CONNEC CLIENT_OCI_LIBRARY
------------- ---------------------------
12.2.0.1.0                               SQL*PLUS
Heterogeneous Full Instant Client

おわりに

相変わらずインストール手順しか試していませんね。。。

最近はほぼ起動していない VirtualBox 上のデータベースのメンテナンスが面倒なので、データベースへの接続確認には Docker を使いました。

% docker run -d -p 1521:1521 -it --name orcl -e DB_DOMAIN='' -v OracleDBData:/ORCL store/oracle/database-enterprise:12.2.0.1
Unable to find image 'store/oracle/database-enterprise:12.2.0.1' locally
12.2.0.1: Pulling from store/oracle/database-enterprise
4ce27fe12c04: Pull complete
9d3556e8e792: Pull complete
fc60a1a28025: Pull complete
0c32e4ed872e: Pull complete
b465d9b6e399: Pull complete
Digest: sha256:40760ac70dba2c4c70d0c542e42e082e8b04d9040d91688d63f728af764a2f5d
Status: Downloaded newer image for store/oracle/database-enterprise:12.2.0.1
c97e8cc558b50363f84c14de633d17b1639cbbd4be93db41146dc0b7854217b8
% docker ps
CONTAINER ID        IMAGE                                       COMMAND                  CREATED             STATUS                   PORTS                              NAMES
c97e8cc558b5        store/oracle/database-enterprise:12.2.0.1   "/bin/sh -c '/bin/..."   3 minutes ago       Up 3 minutes (healthy)   0.0.0.0:1521->1521/tcp, 5500/tcp   orcl
Docker コンテナとして Oracle Database が動作することの旨みがまだあまり見えていませんが、このような接続手順の確認程度であれば楽ですね。 Instant Client のコンテナもあるので、あまり macOS ネイティブで SQL*Plus を使うシチュエーションがいまのところほとんどありませんが、場合に応じて使い分けできればと思います。
% docker run -i --rm --link=orcl store/oracle/database-instantclient:12.2.0.1 sqlplus -L system/Oradoc_db1@orcl/orclpdb1 <<'SQL'
select client_connection, client_oci_library, client_version, client_driver, process from v$session natural join v$session_connect_info where sid = userenv('sid') fetch first 1 rows only;
SQL
Unable to find image 'store/oracle/database-instantclient:12.2.0.1' locally
12.2.0.1: Pulling from store/oracle/database-instantclient
497341ef9d71: Pull complete
598d27c2564a: Pull complete
Digest: sha256:e83a2a223a14f24e6e433847d15d817ff7799a3a1a2dd2e4b224437358e996a0
Status: Downloaded newer image for store/oracle/database-instantclient:12.2.0.1

SQL*Plus: Release 12.2.0.1.0 Production on Sat Oct 28 12:26:32 2017

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

Last Successful login time: Sat Oct 28 2017 12:25:40 +00:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL>
CLIENT_CONNEC CLIENT_OCI_LIBRARY
------------- ---------------------------
CLIENT_VERSION                           CLIENT_DRIVER
---------------------------------------- ------------------------------
PROCESS
------------------------
Homogeneous   Full Instant Client
12.2.0.1.0                               SQL*PLUS
1 


SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

そういえば 11 月 17 日に開催される JPOUG のイベントは Docker 縛りの Oracle 話ということなのでとてもとても楽しみです。

1 件のコメント:

  1. Not able to Install Oracle Database on MacOS? Contact DB Installation Support to tackle this issue
    Keep in mind that, introducing Oracle database on any MacOS isn't a simple undertaking since it requires heaps of specialized works et cetera. Official for this you need to connect with any help organization who helpfully introduce Oracle database on MacOS. For this, you need to contact Cognegic's Oracle DB Configuration Support or Database Administration Tool. We offer Database Management Services to take care of that sort of issues.
    For More Info: https://cognegicsystems.com/
    Contact Number: 1-800-450-8670
    Email Address- info@cognegicsystems.com
    Company’s Address- 507 Copper Square Drive Bethel Connecticut (USA) 06801

    返信削除