在Scientific Linux 4.0 上安装Oracle10g

发表于:2007-07-04来源:作者:点击数: 标签:
在Scientific Linux 4.0 上安装Oracle10g转载自 极速 论坛 作者:小眯的爸爸 第 1 部分: 准备工作 1、下载Oracle 10g安装文件 从官方站点下载安装文件到本地。经过一个漫长的过程,我获得了以下文件: [root@scientific linux]# cd /var/ftp/pub/database/Or

在Scientific Linux 4.0 上安装Oracle10g转载自极速论坛

作者:小眯的爸爸

第 1 部分: 准备工作

1、下载Oracle 10g安装文件

从官方站点下载安装文件到本地。经过一个漫长的过程,我获得了以下文件:

[root@scientific linux]# cd /var/ftp/pub/database/Oracle/10g/linux/
[root@scientific linux]# ll
total 1596644
-rw-r--r--  1 root root  47913091 Apr 21 16:08 htmldb_1.6.0.zip
-rw-r--r--  1 root root 423431309 Apr 21 16:21 ship.ccd.lnx32.cpio.gz
-rw-r--r--  1 root root 381603731 Apr 21 16:22 ship.client.lnx32.cpio.gz
-rw-r--r--  1 root root 131198605 Apr 21 16:21 ship.crs.lnx32.cpio.gz
-rw-r--r--  1 root root 649170233 Apr 21 16:24 ship.db.lnx32.cpio.gz
[root@scientific linux]#


2、检查内存和交换空间、临时硬盘空间

据Oracle官方称,在Linux上面安装Oracle需要至少512M内存,交换空间为至少1G或者内存容量大小的2倍。Oracle10g安装程序在安装过程中需要400M以上的临时硬盘空间。

下面我们检查一下内存、交换空间、临时硬盘空间是否足够:

2.1 检查内存容量:

[root@scientific linux]# grep MemTotal /proc/meminfo
MemTotal:      1027776 kB

2.2 检查交换空间:

[root@scientific linux]# grep SwapTotal /proc/meminfo
SwapTotal:     2031608 kB

2.3 检查临时硬盘空间:

[root@scientific linux]# df /tmp
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                     113146552  38078056  69320992  36% /

可见,我们的内存、交换空间、临时硬盘空间是足够的:)

如果不够怎么办呢?可以临时创建交换空间和临时硬盘空间。


3、检查软件包环境

3.1 检查内核(kernel)版本:

官方说只有高于2.4.9的内核版本才能正常装Oracle 10g。我用的linux发行版本当然满足这个条件,不过我还是show一下我的版本号吧:

[root@scientific linux]# uname -a
Linux scientific 2.6.9-5.0.5.EL #1 Tue Apr 19 14:33:20 CDT 2005 i686 i686 i386 GNU/Linux


3.2 检查glibc版本:

Oracle10g的安装要求glibc软件包版本至少为2.2.4.31.7。AS3和RH9自带的glibc完全满足这个需求,Scientific Linux 4.0 的软件包同AS4,我们再来show一下:

[root@scientific linux]# rpm -q glibc
glibc-2.3.4-2

3.3 检查gcc、make和binutils版本:

Oracle10g需要的最低gcc、make、binutils版本是:

gcc-3.2.3-2
make-3.79
binutils-2.11.90.0.8-12

我们的Scientific Linux 4.0的软件包版本是这样的:

[root@scientific linux]# rpm -q gcc make binutils
gcc-3.4.3-9.EL4
make-3.80-5
binutils-2.15.92.0.2-10.EL4

3.4 检查openmotif版本

需要的最低版本是:

openmotif-2.2.2-16

我们的Scientific Linux 4.0的软件包版本是这样的:

[root@scientific linux]# rpm -q openmotif
openmotif-2.2.3-6.RHEL4.2

3.5 检查setarch版本:

需要的最低版本是:

setarch-1.3-1

我们的Scientific Linux 4.0的软件包版本是这样的:

[root@scientific linux]# rpm -q setarch
setarch-1.6-1


4、检查磁盘可用空间:

在Linux上安装Oracle10g需要至少2.5 GB硬盘空间。

[root@scientific linux]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                     113146552  38078700  69320348  36% /
/dev/hda1               101086      9019     86848  10% /boot
none                    513888         0    513888   0% /dev/shm















第 2 部分: 为 Oracle 配置 Linux



2.1 添加用户

[root@scientific linux]# groupadd dba
[root@scientific linux]# groupadd oinstall
[root@scientific linux]# useradd -m -g oinstall -G dba oracle
[root@scientific linux]# id oracle
uid=501(oracle) gid=502(oinstall) groups=502(oinstall),501(dba)
[root@scientific linux]# passwd oracle
Changing password for user oracle.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@scientific linux]#


2.2 创建挂载点

[root@scientific linux]# mkdir -p /u01/app/oracle
[root@scientific linux]# chown -R oracle:oinstall /u01/app/oracle
[root@scientific linux]# chmod -R 775 /u01/app/oracle

2.3 配置内核参数

[root@scientific linux]# cat >> /etc/sysctl.conf >>EOF
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024     65000
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144
EOF
/sbin/sysctl -p


2.4 为 oracle 用户设置 Shell 限制


[root@scientific linux]# cat >> /etc/security/limits.conf >>EOF
oracle               soft    nproc   2047
oracle               hard    nproc   16384
oracle               soft    nofile  1024
oracle               hard    nofile  65536
EOF


[root@scientific linux]# cat >> /etc/pam.d/login >>EOF
session    required     /lib/security/pam_limits.so
EOF


[root@scientific linux]# cat >> /etc/profile >>EOF
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
EOF


[root@scientific linux]# cat >> /etc/csh.login >>EOF
if ( $USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
umask 022
endif
EOF




2.5 配置Oracle的环境变量

以Oracle用户登录系统,输入如下命令:

login as: oracle
oracle@192.168.2.114's password:
Last login: Thu Jun 23 03:06:06 2005 from 192.168.2.117
[oracle@scientific ~]$ vi /home/oracle/.bash_profile


umask 022
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
LD_LIBRARY_PATH=/usr/lib:/usr/X11R6/lib
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.1.0/db_1
ORACLE_SID=orcl
LD_LIBRARY_PATH=$ORACLE_HOME/jdk/fre/lib/i386:
  $ORACLE_HOME/jdk/jre/lib/i386/server:
  $ORACLE_HOME/rdbms/lib:$ORACLE_HOME/lib:
  $LD_LIBRARY_PATH
PATH=$ORACLE_HOME/bin:$PATH
export PATH LD_LIBRARY_PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID



存盘退出。


2.6 重新登录Oracle用户,用set | more命令查看Oracle用户的环境变量是否生效。



login as: oracle
oracle@192.168.2.114's password:
Last login: Thu Jun 23 03:31:03 2005 from 192.168.2.117
-bash: /u01/app/oracle/product/10.1.0/db_1/jdk/jre/lib/i386/server:: No such file or directory
-bash: /u01/app/oracle/product/10.1.0/db_1/rdbms/lib:/u01/app/oracle/product/10.1.0/db_1/lib:: No such file or directory
-bash: /u01/app/oracle/product/10.1.0/db_1/jdk/fre/lib/i386:: No such file or directory
[oracle@scientific ~]$ set | more
BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="3" [1]="00" [2]="15" [3]="1" [4]="release" [5]="i686-redhat-
linux-gnu")
BASH_VERSION='3.00.15(1)-release'
CATALINA_HOME=/usr/local/jakarta-tomcat-5.0.19
CLASSPATH=.:/usr/local/java/jdk1.4.2_08/lib/dt.jar:/usr/local/java/jdk1.4.2_08/l
ib/tools.jar
COLORS=/etc/DIR_COLORS.xterm
COLUMNS=80
DIRSTACK=()
EUID=501
GROUPS=()
G_BROKEN_FILENAMES=1
HISTFILE=/home/oracle/.bash_history
HISTFILESIZE=1000
HISTSIZE=1000
HOME=/home/oracle
HOSTNAME=scientific
HOSTTYPE=i686
IFS=$' \t\n'
INPUTRC=/etc/inputrc
JAVA_HOME=/usr/local/java/jdk1.4.2_08
KDEDIR=/usr
LANG=en_US.UTF-8
LD_LIBRARY_PATH=/u01/app/oracle/product/10.1.0/db_1/jdk/fre/lib/i386:
LESSOPEN='|/usr/bin/lesspipe.sh %s'
LINES=24
LOGNAME=oracle
LS_COLORS='no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;
01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.
btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31
:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:
*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;
35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:'
MACHTYPE=i686-redhat-linux-gnu
MAIL=/var/spool/mail/oracle
MAILCHECK=60
OPTERR=1
OPTIND=1
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_1
ORACLE_SID=orcl
OSTYPE=linux-gnu
PATH=/u01/app/oracle/product/10.1.0/db_1/bin:/bin:/usr/bin:/usr/local/bin:/usr/X
11R6/bin
PIPESTATUS=([0]="0")
PPID=4609
PROMPT_COMMAND='echo -ne "3]0;$@$:$7"'
PS1='[\u@\h \W]$ '
PS2='> '
PS4='+ '
PWD=/home/oracle
QTDIR=/usr/lib/qt-3.3
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:moni
tor
SHLVL=1
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SSH_CLIENT='192.168.2.117 2103 22'
SSH_CONNECTION='192.168.2.117 2103 192.168.2.114 22'
SSH_TTY=/dev/pts/4
SUPPORTED=zh_HK.UTF-8:zh_HK:zh:zh_CN.UTF-8:zh_CN:zh:zh_TW.UTF-8:zh_TW:zh:en_US.U
TF-8:en_US:en:ja_JP.UTF-8:ja_JP:ja:ko_KR.UTF-8:ko_KR:ko
TERM=xterm
UID=501
USER=oracle
_=ORACLE_SID
[oracle@scientific ~]$
[oracle@scientific ~]$




原文转自:http://www.ltesting.net