Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Unix知識 >> BSD

在 NetBSD/i386 上跑 Oracle 9i:完整移植筆記

原文出處:https://www.telefonica.net/web2/joseyluis/|作者:Jose Luis Rodriguez Garcia|版本 1.2,2005 年 11 月 27 日|聯絡:joseyluis at gmail dot com

標題原文為 Running Oracle 9.2.0.4/9.2.0.7 on NetBSD/i386。目前可以在 NetBSD/i386 上建立並使用 Oracle 資料庫,且下列工具/服務可用:

  • Database Configuration Assistant(dbca)
  • Net Configuration Assistant(netca)
  • Oracle Enterprise Manager(OEM)Console 獨立模式(oemapp console)
  • Oracle Performance Manager
  • Oracle Listener(lsnrctl)

目前仍無法工作的是 Intelligent Agent。

本文涵蓋:Oracle 9.0.4 安裝指南、9.2.0.7 補丁安裝、資料庫建立(圖形與手動)、OracleNet 網路設定、圖形化管理、已知問題、截圖、kdumps 等日誌,以及文件修訂紀錄。

一、內核與前置條件

首先你需要一個包含 Linux 相容 IPC 最新修正的 NetBSD 內核。Current 在 2005 年 11 月 10 日之後的版本已包含全部必要補丁;3.x(2005 年 11 月 5 日後)與 Current(2005 年 11 月 3 日後)只需套用 diff.linux-shm.6;而 2.x、3.x 與 Current 的較早版本則需同時套用 diff.linux-shm.6 與 diff.semopm。

NetBSD 1.6.x 不可行,因為 Linux 版 Java 在該版本上跑不起來,而安裝程式與圖形工具都是 Java 寫的。

需要的 SuSE 相容套件:

suse_base-9.1nb7      Linux 相容基礎套件
suse_expat-9.1nb1     expat
suse_fontconfig-9.1   fontconfig
suse_freetype2-9.1    FreeType2
suse_libjpeg-9.1nb1   JPEG
suse_libpng-9.1nb1    PNG
suse_libtiff-9.1nb1   TIFF
suse_x11-9.1nb2       X11
suse_gtk2-9.1nb3      GTK2
suse_locale-9.1       locale 檔案
suse_glx-9.1          GL
suse_compat-9.1       舊版共享函式庫

另外必須安裝 Java 1.3 才能跑 Oracle Installer:

sun-jre13-1.0.15nb2   Sun Java Runtime Environment 1.3.1

二、準備 Linux 執行環境

下載並解開以下 RPM:

binutils-2.15.90.0.1.1-31.i586.rpm
coreutils-5.2.1-23.8.i586.rpm
cpp-3.3.3-41.i586.rpm
gcc-c++-3.3.3-41.i586.rpm
gcc_old-2.95.3-175.2.i586.rpm
glibc-devel-2.3.3-98.i586.rpm
grep-2.5.1-416.i586.rpm
libstdc++-devel-3.3.3-41.i586.rpm
make-3.80-184.i586.rpm
orarun-1.8-109.15.i586.rpm

解 RPM 的方式:

# cd /emul/linux
# rpm2pkg /路徑/RPM檔

把預設的 Linux gcc/g++ 切到 2.95:

$ cd /emul/linux/usr/bin
$ mv c++ c++.old
$ mv g++ g++.old
$ ln -s ../../opt/gcc295/bin/gcc gcc
$ ln -s ../../opt/gcc295/bin/c++ c++
$ ln -s ../../opt/gcc295/bin/gcc g++

為 awk 與 sed 建立連結:

$ cd /emul/linux/bin
$ ln -s /usr/bin/awk awk
$ ln -s /usr/bin/sed sed

建立 arch 腳本(Oracle 會呼叫它):

$ cd /emul/linux/bin
$ cat > arch
#!/emul/linux/bin/bash
echo i686
^D
$ chmod a+x arch

三、取得並解開 Oracle 軟體

從 https://www.oracle.com/technology/software/products/oracle9i/index.html 下載 Oracle 9i Database Release 2 Enterprise/Standard Edition for Linux 的三片 CD(需免費註冊)。解開:

# gzcat ship_9204_linux_disk1.cpio | cpio -idmv
# gzcat ship_9204_linux_disk2.cpio | cpio -idmv
# gzcat ship_9204_linux_disk3.cpio | cpio -idmv

在 /etc/fstab 加上以 linux 選項掛載的 procfs:

/emul/linux/proc  procfs  rw,linux

掛載並補上 Oracle 會查找的檔案:

# mount procfs
# 把 stat 與 swaps 複製到 /proc

四、帳號與群組

需要一個 oracle 使用者,我選用 Linux bash 作為它的 shell。群組方面,oinstall 擁有該機器上所有 Oracle 安裝的檔案(若同時裝 9i 與 10g,oracle8 與 oracle9 兩個帳號都必須以 oinstall 為主要群組),dba 則是管理權限;oinstall 必須是主要群組(也就是 /etc/passwd 中 gid 那一位)。可選的第三個群組 oper 權限受限,適合運維人員。

/etc/passwd:
oracle:*:101:100:Oracle administrator:/usr/oracle:/emul/linux/bin/bash

/etc/group:
oinstall:*:1000:oracle
dba:*:1001:oracle
oper:*:1002:oracle

五、內核選項

options          SYSVMSG    # System V 訊息佇列
options          SYSVSEM    # System V 訊號量
options          SEMMNI=128 # 訊號量識別碼數量
options          SEMMNS=256 # 系統中訊號量總數
#options         SEMUME=10  # 每個行程的最大 undo 項目數

把這些選項編進內核之後,NetBSD/i386 就能透過 Linux 相容層執行 Oracle 9i 的安裝程式與圖形化工具了。實務上最常卡住的三個點是:內核 IPC 補丁沒打、Java 1.3 沒裝、以及 gcc 版本沒切回 2.95,逐項核對即可。

Copyright © Linux教程網 All Rights Reserved