RedHat EL4.0(X86) + Oracle9iR2 服务器安装说明
使用说明
本文介绍在RedHat EL4.0(X86) 安装 Oracle9iR2 数据库。
安装环境
操作系统:Red Hat Enterprise Linux Advanced Server 4 (Kernel 2.6.9-5.ELsmp , glibc-2.3.4-2)
软件:Oracle9i (版本号:9.2.0.4)
安装RHEL4注意
安装RPM时候,选定义。
Application
Servers
Web Server X
FTP Server OK!
legacy Network Server OK!
Development
Development Tools OK!
Legacy Software Development OK!
0. 准备oracle9i安装文件和补丁包,拷贝到/tmp目录下。
ship_9204_linux_disk1.cpio.gz
ship_9204_linux_disk2.cpio.gz
ship_9204_linux_disk3.cpio.gz
p4198954_21_linux.zip
p2617419_220_GENERIC.zip
p3238244_9204_LINUX.zip
1.安装RPM包(最后两个由Oralce补丁p4198954_21_linux.zip解压产生)
rpm -ivh sysstat-5.0.5-1.i386.rpm disk4
rpm -ivh openmotif21-2.1.30-11.RHEL4.2.i386.rpm disk3
rpm -ivh libaio-0.3.102-1.i386.rpm disk3
rpm -ivh libaio-devel-0.3.102-1.i386.rpm disk3
rpm -ivh freetype-devel-2.1.9-1.i386.rpm disk3
rpm -ivh fontconfig-devel-2.2.3-7.i386.rpm disk3
rpm -ivh xorg-x11-devel-6.8.1-23.EL.i386.rpm disk3
rpm -ivh xorg-x11-deprecated-libs-devel-6.8.1-23.EL.i386.rpm disk3
rpm -ivh glib-devel-1.2.10-15.i386.rpm disk4
rpm -ivh ORBit-devel-0.5.17-14.i386.rpm disk4
rpm -ivh gtk+-devel-1.2.10-33.i386.rpm disk4
rpm -ivh alsa-lib-devel-1.0.6-4.i386.rpm disk3
rpm -ivh audiofile-devel-0.2.6-1.i386.rpm disk3
rpm -ivh esound-devel-0.2.35-2.i386.rpm disk3
rpm -ivh libjpeg-devel-6b-33.i386.rpm disk3
rpm -ivh libtiff-devel-3.6.1-7.i386.rpm disk3
rpm -ivh libungif-devel-4.1.3-1.i386.rpm disk3
rpm -ivh imlib-devel-1.9.13-23.i386.rpm disk3
rpm -ivh gnome-libs-devel-1.4.1.2.90-44.1.i386.rpm disk4
rpm -ivh compat-oracle-rhel4-1.0-5.i386.rpm (p4198954_21_linux.zip)
rpm -ivh compat-libcwait-2.0-2.i386.rpm (p4198954_21_linux.zip)
2. 新建oracle 用户和用户组
groupadd dba
groupadd oinstall
useradd oracle -g oinstall -G dba
cd /opt
mkdir app
cd app
mkdir oracle
cd oracle
mkdir product
cd product
mkdir 9.2.0
cd /opt
chown -R oracle.dba /opt
chown -R oracle.dba /ora_data
chmod 755 /opt
3.解压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
4.设置Shared Memory
# echo 250 32000 100 128 > /proc/sys/kernel/sem
# echo 2147483648 > /proc/sys/kernel/shmmax
修改配置文件# vi /etc/sysctl.conf,添加
# Set oracle environment variable
net.core.rmem_max=262144
net.core.wmem_max=262144
kernel.shmmax=2147483648
kernel.sem=250 32000 100 128
#vm.pagecache=1 15 15
#fs.aio-max-size=2147483648
net.ipv4.ip_local_port_range=1024 65000
退出后运行# /sbin/sysctl -p
5.修改#vi /home/oracle/.bash_profile文件,添加
# +------------------------------------------------------------+
# | FILE : .bash_profile |
# +------------------------------------------------------------+
umask 022
# +--------------------------+
# | SETUP ORACLE ENVIRONMENT |
# +--------------------------+
# Set the LD_ASSUME_KERNEL environment variable only for Red Hat 9 and
# for Red Hat Enterprise Linux Advanced Server 3 (RHEL AS 3) !!
# Use the "Linuxthreads with floating stacks" implementation instead of NPTL:
export LD_ASSUME_KERNEL=2.4.19
export ORACLE_SID=test
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/9.2.0
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN_AMERICA.zhs16gbk
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export ORACLE_OWNER=oracle
export ORACLE_TERM=xterm
# +--------------------------+
# | LINUX STUFF |
# +--------------------------+
# +--------------------------+
# | SETUP SEARCH PATH |
# +--------------------------+
export PATH=$PATH:$ORACLE_HOME/bin
# +--------------------------+
# | SETUP JAVA ENVIRONMENT |
# +--------------------------+
# +-------------+
# | "GREETINGS" |
# +-------------+
#./lowermap
#ulimit -n 63536
#ulimit -u 16384
echo ".bash_profile executed"
6. 修改#vi /etc/security/limits.conf文件,添加:
oracle soft nofile 4096
oracle hard nofile 63536
oracle soft nproc 2047
oracle hard nproc 16384
7. 下面是安装数据库的主要几个步骤(用oracle用户登陆):
su - oracle
$ source .bash_profile
.bash_profile executed
$ cd /tmp
$ cd Disk1/
$ ./runInstaller
- Welcome Screen: Click Next
- Inventory Location: Click Next
- Unix Group Name: Use "oinstall" and click Next
When asked to run /tmp/orainstRoot.sh, run it before you click Continue
- At the end of the installation, exit runInstaller.
8. 下面是打Agent补丁. 包括安装p3238244_9204_LINUX.zip补丁和opatch软件包:p2617419_220_GENERIC.zip。
su - oracle
$ cp p2617419_210_GENERIC.zip /tmp
$ cd /tmp
$ unzip p2617419_210_GENERIC.zip
$ export PATH=$PATH:/tmp/OPatch
$ export PATH=$PATH:/sbin # the patch needs "fuser" which is located in /sbin
$ chmod 777 /tmp/OPatch/opatch
$ unzip p3238244_9204_LINUX.zip
$ cd 3238244
$ opatch apply
$ cd $ORACLE_HOME/network/lib
$ make -f ins_oemagent.mk install
9. 配置开机后自启动脚本。Oralce不建议开机后自动启动:(
修改#vi /etc/rc.local文件添加
touch /var/lock/subsys/local
umount /dev/shm
mount -t ramfs ramfs /dev/shm
chown oracle:dba /dev/shm
/sbin/insmod hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
#start Oracle8i
su - oracle -c 'dbstart'
su - oracle -c 'lsnrctl start'
修改 #vi /etc/oratab文件,N修改为Y
test:/opt/app/oracle/product/9.2.0:Y
拷贝pfile文件到$ORACLE_HOME/dbs目录,pfile文件生产spfile.
#cp $ORACLE_BASE/admin/jcd/pfile/inittest.ora* $ORACLE_HOME/dbs/inittest.ora
修改#vi /etc/cron.daily/slocate.cron文件。屏蔽nightly slocate cron job
#!/bin/sh
#. /etc/updatedb.conf
#[ "$DAILY_UPDATE" != "yes" ] && exit 0
#renice +19 -p $$ >/dev/null 2>&1
#/usr/bin/updatedb
10. 扩展SGA到2.7G(可选)。
su - oracle
shutdown
% cd $ORACLE_HOME/rdbms/lib
% cp ksms.s ksms.s_orig ....if ksms.s exists, back it up first.
% genksms -s 0x15000000 > ksms.s ...you may be able to use a lower value like 0x12000000, but this will require thorough testing.
% make -f ins_rdbms.mk ksms.o
% make -f ins_rdbms.mk ioracle
startup pfile=/opt/app/oracle/product/9.2.0/dbs/initjcd.ora
create spfile from pfile='/opt/app/oracle/product/9.2.0/dbs/initjcd.ora';
11. Patching Oracle9i R2 (9.2.0.4) on RH AS 4(
9.2.0.4 Required
9.2.0.5 Skipped
9.2.0.6 patches needed for EMT64T 4261532 & 4233179)
Download the patch 3948480 (Oracle9i Patch Set Release 2 (9.2.0.6) Patch Set 5) from http://metalink.oracle.com and execute the following commands:
su - oracle
$ cp p3948480_9206_LINUX.zip /tmp
$ cd /tmp
$ unzip p3948480_9206_LINUX.zip
Archive: p3948480_9206_LINUX.zip
creating: Disk1/
creating: Disk1/stage/
creating: Disk1/stage/Patches/
...
Now download the patch 4188455 from http://metalink.oracle.com.
This patch is needed for launching the runInstaller that came with the patch 3948480 we just downloaded above.
su - oracle
$ cp p4188455_10103_LINUX.zip /tmp
$ cd /tmp
$ unzip p4188455_10103_LINUX.zip
Archive: p4188455_10103_LINUX.zip
inflating: oraparam.ini
inflating: README.txt
$
The /tmp/oraparam.ini file will now be used for launching the runInstaller that came with the patch 3948480.
To patch the runInstaller itself, run:
su - oracle
$ echo $LD_ASSUME_KERNEL
2.4.19
$ /tmp/Disk1/install/runInstaller -paramFile /tmp/oraparam.ini
- Welcome Screen: Click Next
- File Locations: Use default values (in my example: /tmp/Disk1/stage/products.xml)
- Available Products: Select "Oracle Universial Installer 10.1.0.3.0 !"
- Summary: Click Install
- At the end of the installation, you must exit runInstaller!
Ensure that no Oracle processes are running:
ps -ef | grep ora
Now to patch Oracle9iR2, run:
su - oracle
$ echo $LD_ASSUME_KERNEL # it is important that this variable is set!
2.4.19
$ /tmp/Disk1/install/runInstaller -paramFile /tmp/oraparam.ini
- Welcome Screen: Click Next
- File Locations: Use default values (in my example: /tmp/Disk1/stage/products.xml)
- Available Products: Select "Oracle 9iR2 Patchset 9.2.0.6.0"
- Summary: Click Install
When are asked to run root.sh, run it before you click Continue
- At the end of the installation, exit runInstaller.
After the 9.2.0.6 patchset has been applied, download the patch 4190568 from http://metalink.oracle.com. Also, download the opatch utility for release 10.1.0.2 (patch 2617419) from http://metalink.oracle.com.
To install opatch, run:
su - oracle
$ cp p2617419_10102_GENERIC.zip /tmp
$ cd /tmp
$ unzip p2617419_10102_GENERIC.zip
$ cp -a /tmp/OPatch/ $ORACLE_HOME
To apply the 4190568 patch, run
su - oracle
$ unzip p4190568_9206_LINUX.zip
$ cd 4193454
$ export PATH=$PATH:$ORACLE_HOME/OPatch
$ opatch apply
If you intend to use Direct I/O Support, you must also download and apply patch 2448994.
Now you should be able to create a database with dbca:
su - oracle
dbca
When dbca died on my system with the following error:
/u01/app/oracle/product/9.2.0/bin/dbca: line 124: 26649 Segmentation fault
$JRE_DIR/bin/jre -DORACLE_HOME=$OH -DJDBC_PROTOCOL=thin -mx64m -classpath $CLASSPATH oracle.sysman.assistants.dbca.Dbca $ARGUMENTS
I executed the following command:
su - root
touch /etc/rac_on