發新話題
打印

安裝 Oracle 9i ( 9.2.0.4.0 ) on CentOS 4.6 (RHEL 4U6)

安裝 Oracle 9i ( 9.2.0.4.0 ) on CentOS 4.6 (RHEL 4U6)

http://tw.myblog.yahoo.com/jw!7KOAi5OEGQL9D1WOQ2X5/article?mid=-2&prev=5&l=a&fid=1

1‧安裝需求

Memory
A minimum of 512 MB of RAM is required to install Oracle9i Server.
A minimum of 512 MB of RAM is required to install Oracle9i Management and Infrastructure.
A minimum of 256 MB is required to install Oracle9i Client.

Swap space
Disk space equal to the system’s physical memory, or 1GB,
whichever is greater.

CD-ROM device
A CD-ROM drive capable of reading ISO 9660 format CD-ROM discs withRock
Ridge extensions.

Component Required Disk Space
Database software 3.5 GB
Seed database 1 GB

群組條件 :
oinstall-> 對應oracle群組 Ora_Inventory
可以對oracle作安裝、升級、移除

dba -> 可以透過作業系統驗證的方式取得sysdba權限。
sysdba可以對資料庫做任何事情、

oper -> 取得sysoper權限,
sysoper可以create database、backup database、restricted session、recovery database。

 

2 使用者、群組建立

OS帳號建立說明

oracle使用者隸屬oracl、oinstall群組、可以對資料庫作安裝、升級、移除,但無法管理資料庫(create database、drop database)。

所以登入的時候無法以系統認證的方式登入,也無法管理資料庫,除非oracle這個帳號加入dba群組



# useradd -g oracle -G oinstall oracle
# echo 'password' | passwd --stdin oracle

3 系統規劃
3.1 磁區劃分
/u01/app/oracle #用來存放oracle程式相關
/u02/oradata #用來存放oracle資料庫實體檔案

# mkdir -p /u01/app/oracle /u02/oradata

3.2 目錄權限
/u01/app/oracle 權限為755 擁有者為 oracle.oinstall
/u02/oradata 權限為755 擁有者為 oracle.oinstall

3.3 設定oracle使用者的環境變數 /home/oracle/.bash_profile
# vi /hoem/oracle/.bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs
PATH=$PATHHOME/bin
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/9.2.0/db_1
export PATH=$ORACLE_HOME/binORACLE_HOME/Apache/Apache/binPATH
export ORACLE_OWNER=oracle
export ORACLE_SID=orcl
export ORACLE_TERM=vt100
export LD_ASSUME_KERNEL=2.4.19
export THREADS_FLAG=native
export LD_LIBRARY_PATH=$ORACLE_HOME/libLD_LIBRARY_PATH
export PATH=$ORACLE_HOME/binPATH

export PATH
unset USERNAME

3.4 設定核心參數 /etc/sysctl.conf

kernel.shmmax = 1073741824
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

3.5 設定使用者對檔案資源的限制
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384

3.6 gcc 降級
# su - root
# mv /usr/bin/gcc /usr/bin/gcc34
# ln -s /usr/bin/gcc32 /usr/bin/gcc
# mv /usr/bin/g++ /usr/bin/g++34
# ln -s /usr/bin/g++32 /usr/bin/g++


3.7 所需套件
rpm -qa make \
compat-db \
compat-gcc-32 \
compat-gcc-32-c++ \
compat-oracle-rhel4 \
compat-libcwait \
compat-libgcc-296 \
compat-libstdc++-296 \
compat-libstdc++-33 \
gcc \
gcc-c++ \
gnome-libs \
gnome-libs-devel \
libaio-devel \
libaio \
make \
openmotif21 \
xorg-x11-deprecated-libs-devel \
xorg-x11-deprecated-libs

4 安裝oracle

4.1 安裝oracle 9i前要先安裝p3006854_9204_LINUX.zip修正程式。

# unzip p3006854_9204_LINUX.zip
# cd 3006854
# sh rhel3_pre_install.sh

注意這裡可能會出一些錯誤。比如如果沒有安裝gcc, 會出現下面的錯誤:
rhel3_pre_install.sh: line 36: gcc: command not found 而要是運行完了
rhel3_pre_install.sh出現 error while loading shared libraries:
/etc/libcwait.so:cannot open shared object file: No such file or directory
這種錯誤的時候,也不用急,就是因為這個補丁沒有正常打成功導致了一些問題,只要
刪掉/etc/ld.so.preload 這個文件就行了:

再來針對p4198954這個更新套件來安裝,解壓縮後會出現兩個套件

compat-oracle-rhel4-1.0-5.i386.rpm
compat-libcwait-2.0-2.i386.rpm

安裝上述兩套件會有相依性套件的要求。

# unzip p4198954_21_LINUX.zip
# rpm - ivh compat-oracle-rhel4-1.0-5.i386.rpm compat-libcwait-2.0-2.i386.rpm

4.2 安裝oracle
# su - oracle
$ . /home/oracle/.bash_profile (確定你已經使用剛剛所設定的環境變數)

上傳oracle程式

$ zcat ship_9204_linux_disk1.cpio.gz | cpio -idmv
$ zcat ship_9204_linux_disk2.cpio.gz | cpio -idmv
$ zcat ship_9204_linux_disk3.cpio.gz | cpio -idmv

解壓縮後產生 Disk1 Disk2 Disk3等資料夾

$ cd ./Disk1
$ ./runInstaller


4.3 安裝oracle後對一些工具進行修正

所需要的更新程式
p2617419_210_GENERIC.zip
P3238244_9204_LINUX.zip
這兩個到件要到Oracle matalink網站去下載,據說只有買過Oracle軟體才能註冊下載。

不過可以用Google搜尋一下,蠻多地方有的。


做法
# su - oracle
$ cd tmp
$ unzip p2617419_210_GENERIC.zip
$ unzip p3238244_9204_LINUX.zip

解壓縮後產生OPatch、3238244兩個目錄

$ chmod 777 /tmp/OPatch

$ chmod 777 /tmp/3238244

因為要到3238244這目錄中執行OPatch裡面的一些東西,所以直接把路徑export成環境變數。

$ export PATH=$PATH:/tmp/OPatch
$ export PATH=$PATH:/sbin

$ cd 3238244
$ opatch apply
$ cd $ORACLE_HOME/network/lib
$ make -f ins_oemagent.mk install
$ agentctl start (看到success 就算成功了可以用oracle帳號登入X-Window執行dbca了)


TOP

發新話題