一、安装前准备

0、打补丁包

p4198954_21_LINUX.zip

实际上此包里的内容只是compat-oracle-rhel4-1.0-5.i386.rpm、compat-libcwait-2.1-1.i386.rpm两个rpm包,使用rpm -ivh安装上即可.

除此之外还要搭上下面的补丁包

Oracle9i安装_安装包Oracle9i安装_linux_02
rpm -q 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++

glibc

glibc-common

glibc-devel

glibc-headers

glibc-kernheaders

libgcc

make
View Code

1、创建用户、设置环境变量

Oracle9i安装_安装包Oracle9i安装_linux_02
#!/usr/bin/bash
groupadd -g 1000 oinstall
groupadd -g 1300 dba
groupadd -g 1301 oper

useradd -u 1101 -g oinstall -G dba,oper -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
echo "oracle" | passwd --stdin oracle
echo 'export PS1="`/bin/hostname -s`-> "' >> /home/oracle/.bash_profile
echo "export TMP=/tmp" >> /home/oracle/.bash_profile
echo 'export TMPDIR=$TMP'>>/home/oracle/.bash_profile
echo "export ORACLE_HOSTNAME=ora9i">> /home/oracle/.bash_profile
echo "export ORACLE_SID=ora9idb">> /home/oracle/.bash_profile
echo "export ORACLE_BASE=/u01/app/oracle">> /home/oracle/.bash_profile
echo 'export ORACLE_HOME=$ORACLE_BASE/product/9.2.0/db_1'>> /home/oracle/.bash_profile
echo "export ORACLE_UNQNAME=ora9idb">> /home/oracle/.bash_profile
echo 'export TNS_ADMIN=$ORACLE_HOME/network/admin' >> /home/oracle/.bash_profile
echo "export ORACLE_TERM=xterm">> /home/oracle/.bash_profile
echo 'export PATH=/usr/sbin:$PATH'>> /home/oracle/.bash_profile
echo 'export PATH=$ORACLE_HOME/bin:$PATH'>> /home/oracle/.bash_profile
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib'>> /home/oracle/.bash_profile
echo 'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib' >> /home/oracle/.bash_profile
echo "export EDITOR=vi" >> /home/oracle/.bash_profile
echo "export LANG=en_US" >> /home/oracle/.bash_profile
echo "export NLS_LANG=american_america.AL32UTF8" >> /home/oracle/.bash_profile
echo "export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'" >> /home/oracle/.bash_profile
echo "export DISPLAY=192.168.1.168:0.0" >> /home/oracle/.bash_profile
echo "umask 022">> /home/oracle/.bash_profile
注意修改里面的环境变量值与自己实际的机器相匹配

2、建立相关目录、分配相应权限

Oracle9i安装_安装包Oracle9i安装_linux_02
[root@ora9i ~]# vi b_predir.sh 

#!/usr/bin/bash
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chmod -R 775 /u01

echo "direcotry created successfully!";
与自己所见目录相匹配;或者按照脚本里的也可以;

3、配置内核参数

  设置系统参数:编辑/etc/sysctl.conf档,增加以下内容

Oracle9i安装_安装包Oracle9i安装_linux_02
kernel.sem=250 32000 100 128
kernel.shmmax=4294967295
kernel.shmmni=128
kernel.msgmnb=65536
kernel.msgmni=2878
fs.file-max=65536
net.ipv4.ip_local_port_range=1024 65000
View Code

   编辑/etc/security/limits.conf档,增加以下内容

Oracle9i安装_安装包Oracle9i安装_linux_02
* - nproc 16384
* - nofile 16384
View Code

4、解压安装包

Oracle9i安装_安装包Oracle9i安装_linux_02
#gunzip ship_9204_linux_disk1.cpio.gz
#gunzip ship_9204_linux_disk2.cpio.gz
#gunzip ship_9204_linux_disk3.cpio.gz
#cpio -idmv < ship_9204_linux_disk1.cpio
#cpio -idmv < ship_9204_linux_disk2.cpio
#cpio -idmv < ship_9204_linux_disk3.cpio
解压
Oracle9i安装_安装包Oracle9i安装_linux_02
[root@ora9i bin]# cd
[root@ora9i ~]# ll
total 15244
-rw-r--r--  1 root root     1018 Jul 24 21:36 anaconda-ks.cfg
-rwxr-xr-x  1 root root     1627 Jul 26 17:58 a_preusers.sh
-rwxr-xr-x  1 root root      130 Jul 26 17:37 b_predir.sh
drwxr-xr-x  7 root root     4096 Mar 10  2004 Disk1
drwxrwxr-x  3 root root     4096 Mar 10  2004 Disk2
drwxrwxr-x  3 root root     4096 Mar 10  2004 Disk3
-rw-r--r--  1 root root    50886 Jul 24 21:36 install.log
-rw-r--r--  1 root root     3113 Jul 24 21:36 install.log.syslog
-rwxr-xr-x  1 root root 15485212 Jul 24 19:29 j2re-1_3_1_19-linux-i586.bin
drwxr-xr-x  2 root root     4096 Jul 26 18:36 rpms_ora9i
[root@ora9i ~]# chown -R oracle:oinstall Disk1/ Disk2/ Disk3/
[root@ora9i ~]# ll
total 15244
-rw-r--r--  1 root   root         1018 Jul 24 21:36 anaconda-ks.cfg
-rwxr-xr-x  1 root   root         1627 Jul 26 17:58 a_preusers.sh
-rwxr-xr-x  1 root   root          130 Jul 26 17:37 b_predir.sh
drwxr-xr-x  7 oracle oinstall     4096 Mar 10  2004 Disk1
drwxrwxr-x  3 oracle oinstall     4096 Mar 10  2004 Disk2
drwxrwxr-x  3 oracle oinstall     4096 Mar 10  2004 Disk3
-rw-r--r--  1 root   root        50886 Jul 24 21:36 install.log
-rw-r--r--  1 root   root         3113 Jul 24 21:36 install.log.syslog
-rwxr-xr-x  1 root   root     15485212 Jul 24 19:29 j2re-1_3_1_19-linux-i586.bin
drwxr-xr-x  2 root   root         4096 Jul 26 18:36 rpms_ora9i
[root@ora9i ~]# mv Disk1/ Disk2/ Disk3/ /home/oracle/
[root@ora9i ~]# su - oracle
ora9i-> ll
total 12
drwxr-xr-x  7 oracle oinstall 4096 Mar 10  2004 Disk1
drwxrwxr-x  3 oracle oinstall 4096 Mar 10  2004 Disk2
drwxrwxr-x  3 oracle oinstall 4096 Mar 10  2004 Disk3
移动安装包、修改目录所属组;
Oracle9i安装_安装包Oracle9i安装_linux_02
ora9i-> vi Disk1/install/linux/oraparam.ini

[Oracle]
DISTRIBUTION=TRUE
SOURCE=../../stage/products.jar
LICENSE_LOCATION=
JRE_LOCATION=/usr/jre1.3.1
OUI_LOCATION=../../stage/Components/oracle.swd.oui/2.2.0.18.0/1/DataFiles/Expanded
JRE_MEMORY_OPTIONS=" -mx48m"
DEFAULT_HOME_LOCATION=
DEFAULT_HOME_NAME=OUIHome
NO_BROWSE=/net
NLS_ENABLED=TRUE
BOOTSTRAP=TRUE
OUI_VERSION=2.2.0.18.0
~
~
~
~
~
~
~
~
~
ora9i-> 
修改安装文件中JRE_LOCATION=/usr/jre1.3.1参数

5、j2re-1_3_1_19-linux-i586.bin安装

Oracle9i安装_安装包Oracle9i安装_linux_02
#su - root
#chmod +x j2re-1_3_1_19-linux-i586.bin
#./jere-1_3_1_19-linux-i586.bin
#mv jre1.3.1_19 /usr/jre1.3.1
#/usr/jre1.3.1/bin/java -version
View Code

6、更改gcc

Oracle9i安装_安装包Oracle9i安装_linux_02
[root@ora9i ~]# cd /usr/bin/
[root@ora9i bin]# ll -l gcc*
-rwxr-xr-x  1 root root   914 Feb 23  2005 gcc
-rwxr-xr-x  2 root root 84760 Feb 21  2005 gcc32
-rwxr-xr-x  2 root root 93136 Jun 14  2006 gcc.orig
[root@ora9i bin]# mv ./gcc ./gcc34
[root@ora9i bin]# mv ./gcc32 ./gcc
[root@ora9i bin]# ll -l gcc*
-rwxr-xr-x  2 root root 84760 Feb 21  2005 gcc
-rwxr-xr-x  1 root root   914 Feb 23  2005 gcc34
-rwxr-xr-x  2 root root 93136 Jun 14  2006 gcc.orig
[root@ora9i bin]# 
View Code