ねもぷらす

ふぁいんでぃんぐねもの日記。プログラミングとか育児とか

Mac に Oracle Database を導入する軌跡

※さくっと終わらせようとしてまだ完了してませんorz以下編集中。

DB本体のインストール

以下のページからDatabase本体のソースコードをダウンロード。
http://www.oracle.com/technology/global/jp/software/products/oracle10g/10103macos/10103macos_trial_dl.html

記載されている手順に従って解凍すると、Disk1 というディレクトリが出来ました。

$ cd ~/Downloads
$ gunzip ship_mac_db.cpio.gz 
$ cpio -idmv < ship_mac_db.cpio
...
$ ls Disk1/
doc          install      runInstaller welcome.htm
fonts        response     stage

インストール方法は以下のヘルプを参照。システム要件からユーザの作成方法まで読みづらいけど丁寧に書かれています。
http://download.oracle.com/docs/html/B13954_01/toc.htm

Table of Contents
  1. Pre-Install Tasks
    1. ハードウェアシステム要件をチェック
    2. ソフトウェア(GCCとかJavaとか)システム要件チェック
    3. Oracleユーザ/グループの追加
    4. カーネルパラメータ、シェル制限の設定
    5. Oracleクライアント等格納先ディレクトリの設定
    6. Oracle格納ディレクトリの設定
    7. Oracle Databaseとリカバリファイル格納先の設定
    8. Oracle Databaseとリカバリファイル格納先ディレクトリ作成
    9. ASM(Automatic Storage Management)ディスクの設定
    10. パーティーションの設定
    11. 動いているOracleを停止
    12. 環境変数の設定
  2. Installation Tasks
    1. インストール概要
    2. DB本体の入手
    3. CD、DVDからDBインストーラをコピーする場合
    4. インストールの実行
sh-3.2# /usr/sbin/system_profiler SPHardwareDataType | grep Memory 
      Memory: 2 GB

sh-3.2# df -h /tmp
Filesystem     Size   Used  Avail Capacity  Mounted on
/dev/disk0s2   56Gi   38Gi   17Gi    69%    /

sh-3.2# sw_vers
ProductName:	Mac OS X
ProductVersion:	10.5.6
BuildVersion:	9G55

sh-3.2# gcc -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5465~16/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5465)
sh-3.2# dscl . create /Groups/oinstall gid 600
sh-3.2# dscl . create /Groups/dba gid 601
sh-3.2# dscl . create /Users/oracle gid 600
sh-3.2# dscl . create /Users/oracle shell /bin/bash

クライアント

$ sudo port install oracle-instantclient
Password:
--->  Fetching oracle-instantclient
Warning: MacPorts may not be able to download the necessary distfiles for oracle-instantclient. If you get a checksum error, please download instantclient-basic-macosx-10.2.0.4.0.zip and instantclient-sdk-macosx-10.2.0.4.0.zip manually from http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/intel_macsoft.html and place them in /opt/local/var/macports/distfiles/oracle-instantclient
--->  Attempting to fetch instantclient-basic-macosx-10.2.0.4.0.zip from http://download.oracle.com/otn/mac/instantclient/10204/
--->  Attempting to fetch instantclient-sdk-macosx-10.2.0.4.0.zip from http://download.oracle.com/otn/mac/instantclient/10204/
--->  Verifying checksum(s) for oracle-instantclient
Error: Checksum (md5) mismatch for instantclient-basic-macosx-10.2.0.4.0.zip
Error: Checksum (sha1) mismatch for instantclient-basic-macosx-10.2.0.4.0.zip
Error: Checksum (rmd160) mismatch for instantclient-basic-macosx-10.2.0.4.0.zip
Error: Checksum (md5) mismatch for instantclient-sdk-macosx-10.2.0.4.0.zip
Error: Checksum (sha1) mismatch for instantclient-sdk-macosx-10.2.0.4.0.zip
Error: Checksum (rmd160) mismatch for instantclient-sdk-macosx-10.2.0.4.0.zip
Error: Target org.macports.checksum returned: Unable to verify file checksums
Error: Status 1 encountered during processing.

おこられた…
どうやら以下のソースファイルは自分でダウンロードしないといけないらしい。

  • instantclient-basic-macosx-10.2.0.4.0.zip
  • instantclient-sdk-macosx-10.2.0.4.0.zip

先ずは以下にアクセス。
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/intel_macsoft.html

$ ls -l /opt/local/var/macports/distfiles/oracle-instantclient/
total 32
-rw-r--r--  1 root  admin  4132  1 20 21:49 instantclient-basic-macosx-10.2.0.4.0.zip
-rw-r--r--  1 root  admin  4126  1 20 21:49 instantclient-sdk-macosx-10.2.0.4.0.zip
$ mv ~/Downloads/instantclient-* /opt/local/var/macports/distfiles/oracle-instantclient/
$ ls -l /opt/local/var/macports/distfiles/oracle-instantclient/
total 67632
-rw-r--r--@ 1 macu  macg  34020719  4 23  2008 instantclient-basic-macosx-10.2.0.4.0.zip
-rw-r--r--@ 1 macu  macg    603493  4 23  2008 instantclient-sdk-macosx-10.2.0.4.0.zip

準備完了。再度実行してみる。

$ sudo port install oracle-instantclient--->  Verifying checksum(s) for oracle-instantclient
--->  Extracting oracle-instantclient
--->  Configuring oracle-instantclient
--->  Building oracle-instantclient with target all
--->  Staging oracle-instantclient into destroot
--->  Installing oracle-instantclient 10.2.0.4.0_1
--->  Activating oracle-instantclient 10.2.0.4.0_1
--->  Cleaning oracle-instantclient