RHEL4.4-x86_64 + Oracle 10.2.0.1安装笔记

硬件环境:

由于是安装64位的Linux+Oracle,所以需要64位的CPU;

本文的安装环境为:

CPU:AMD Athlon64 3200+ (939)

Memory: DDR400 1G

Harddisk: IDE 80G

(鱼漂注:此文档参考了网上的资料和Oracle官方文档,并对一些错误和不必要的步骤进行了修正。)

(文档作者:鱼漂[admin.net(at)163.com] 转载请注明,文档最新版本请访问http://www.eit.name/)


一.OS的安装和准备

1.需要安装的软件包

安装Linux时,需要安装X Window System, GNOME Desktop Enviroment,Development Tools,Legacy Software Development

安装完后,使用rpm -q命令,确保以下包已成功安装:

binutils-2.15.92.0.2-21.x86_64.rpm
compat-db-4.1.25-9.i386.rpm
compat-db-4.1.25-9.x86_64.rpm
compat-libstdc++-33-3.2.3-47.3.i386.rpm
compat-libstdc++-33-3.2.3-47.3.x86_64.rpm
control-center-2.8.0-12.rhel4.5.x86_64.rpm
gcc-3.4.6-3.x86_64.rpm
gcc-c++-3.4.6-3.x86_64.rpm
glibc-2.3.4-2.25.i686
glibc-2.3.4-2.25.x86_64.rpm
glibc-common-2.3.4-2.25.x86_64.rpm
glibc-devel-2.3.4-2.25.i386.rpm
glibc-devel-2.3.4-2.25.x86_64.rpm
glibc-headers-2.3.4-2.25.x86_64.rpm
glibc-kernheaders-2.4-9.1.98.EL.x86_64.rpm
gnome-libs-1.4.1.2.90-44.1.x86_64.rpm
libgcc-3.4.6-3.i386.rpm
libgcc-3.4.6-3.x86_64.rpm
libstdc++-3.4.6-3.i386.rpm
libstdc++-3.4.6-3.x86_64.rpm
libstdc++-devel-3.4.6-3.i386.rpm
libstdc++-devel-3.4.6-3.x86_64.rpm
libaio-0.3.105-2.i386.rpm
libaio-0.3.105-2.x86_64.rpm
make-3.80-6.EL4.x86_64.rpm
pdksh-5.2.14-30.3.x86_64.rpm
sysstat-5.0.5-11.rhel4.x86_64.rpm
xscreensaver-4.18-5.rhel4.11.x86_64.rpm
xorg-x11-deprecated-libs-6.8.2-1.EL.13.36.i386.rpm
xorg-x11-deprecated-libs-6.8.2-1.EL.13.36.x86_64.rpm

以下几个包也需要安装:

compat-gcc-32-3.2.3-47.3.x86_64.rpm
compat-gcc-32-c++-3.2.3-47.3.x86_64.rpm
compat-libstdc++-33-3.2.3-47.3.x86_64.rpm

此外,建议关闭访火墙,或打开相应的端口。关闭SELinux.

(鱼漂注:请仔细检查以上红色标识的软件包,在64位系统下安装Oracle,某些包需要x86_64的,也需要i386的)

2.磁盘和内存要求


所需最小 RAM 为 512MB,而所需最小交换空间为 1GB。

对于 RAM 小于或等于 2GB 的系统,交换空间应为 RAM 数量的两倍;对于 RAM 大于 2GB 的系统,交换空间应为 RAM 数量的一到两倍。

例如:
# grep MemTotal /proc/meminfo
MemTotal:512236 kB
# grep SwapTotal /proc/meminfo
SwapTotal:1574360 kB

Oracle 10g 软件还需要 2.5GB 的可用磁盘空间,而数据库则另需 1.2GB 的可用磁盘空间。/tmp 目录至少需要 400MB 的可用空间。

要检查系统上的可用磁盘空间,运行以下命令:
#df -h

3.编译环境要求

RHEL4.4默认安装的GCC版本是3.4.6,此版本在Oracle编译时,会产生很多错误,为便于安装,我们使用GCC 3.2.3来替换:

cd /usr/bin/
mv gcc gcc.script
mv g++ g++.script
ln -s gcc32 gcc
ln -s g++32 g++

(鱼漂注:需要先安装compat-gcc-32-3.2.3-47.3.x86_64.rpm, compat-gcc-32-c++-3.2.3-47.3.x86_64.rpm, compat-libstdc++-33-3.2.3-47.3.x86_64.rpm)

4.OS参数要求

vi /etc/sysctl.conf , 在行末添加以下内容


#use for oracle
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.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144

再运行sysctl -p应用以上参数

vi /etc/security/limits.conf 行末添加以下内容
#use for oracle
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536

vi /etc/pam.d/login 行末添加以下内容
session required pam_limits.so

vi /etc/selinux/config 确保以下内容
SELINUX=disabled

关闭SELIINUX

修改/etc/profile,在最后加入:

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=orcl


鱼漂补充说明:RHEL4.4已经修正了一些Bug,所以,不需额外安装compat-oracle-rhel4-1.0-5.i386.rpm,binutils,compat-libcwait,大部分文档仍然错误的要求安装这些补丁。

二.Oracle安装

1.创建和配置用户

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -m -g oinstall -G dba oracle
id oracle

为Oracle用户设置密码:

passwd oracle

2.创建安装目录

mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle

chmod -R 775 /u01/app/oracle

3.开始安装

从Oracle网站下载10201_database_linux_x86_64.cpio.gz到/pkg/oracle/

使用oracle用户登录后,解压此文件:

cd /pkg/oracle

gunzip 10201_database_linux_x86_64.cpio.gz

cpio -idmv 10201_database_linux_x86_64.cpio

以上操作将Oracle安装文件解压到database/目录

使用oracle用户,登录到图形界面后,运行database/目录下的runInstaller

cd /pkg/oracle/databse

./runInstaller

按照提示完成安装,最后一步会提示你,使用root登录,运行两个Shell脚本。

4. 自动运行Oracle

A.在/etc/profile的ORACLE_BASE后面,加上

export ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1

B. 修改/etc/oratab文件,将orcl那一行的N,设置为Y

C. 修改$ORACLE_HOME/bin/dbstart, dbshut ,将

ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle/bin/tnslsnr

改为

ORACLE_HOME_LISTNER=$ORACLE_HOME

D.新建一个启动脚本,如下:

#!/bin/bash
#
# chkconfig: 345 90 05
# description: Oracle 10g Server
# /etc/init.d/oracle
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin

ORA_OWNR="oracle"

# if the executables do not exist -- display error

if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display

case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
#su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORA_OWNR -c $ORACLE_HOME/bin/dbstart
touch /var/lock/oracle

su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
#su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
su $ORA_OWNR -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle

su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0

chmod a+x /etc/init.d/oracle

chkconfig oracle on

5. 服务介绍

oracle 10g在自身的dbstart已经启动了lsnrctl,所以上面的脚本上注释掉了lsnrctl的启动
主要服务启动方式
a:$ORACLE_HOME/bin/dbstart | dbshut
b:$ORACLE_HOME/bin/lsnrctl start | stop 监听器启动|关闭。

c:$ORACLE_HOME/bin/emctl start | stop dbconsole
访问 http://yourIP:1158/em

d:$ORACLE_HOME/bin/isqlplusctl start | stop
访问 http://yourIP:5560/isqlplus


三.Oracle升级

以下步骤将10.2.0.1升级到10.2.0.3

1. Download p5337014_10203_Linux-x86-64.zip From MetaLink

2. Stop All Oracle Services (login as root)

3. Backup Oracle ( or Use RMAN backup whole database)

4. unzip p5337014_10203_Linux-x86-64.zip (login as oracle)

5. cd Disk1(login as oracle)

6. run ./runInstaller (run as oracle)

7. Select the oracle Home, and Next, Next..

8. Run root.sh (run as root) and finish install,

9. For Oracle single-instance installations, start the listener as follows: $ lsnrctl start

10. Run Oracle Database Upgrade Assistant($ORACLE_HOME/bin/) :$ dbua

11. Update $ORACLE_HOME/bin/dbstart & dbshut, set ORACLE_HOME_LISTNER=$ORACLE_HOME

12. Done, Reboot or Restart Oracle.

DB | 评论(0) | 引用(0) | 阅读(11914)