RHEL 5.4安装oracle 10.2.0

本文提供了一步一步的指南,用于在Linux环境下安装Oracle 10g数据库。从准备环境到最终配置自启动脚本,涵盖了安装过程中的所有关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.从网上下载oracle 10g for linux的安装包到本地计算机。

2.我把linux安装光盘挂载到/media/cd下。
在/media 下新建文件夹 /rhel :mkdir /media/cd
然后挂载5.4的dvd安装盘: mount /dev/cdrom /media/cd
3.确保系统中已经安装了如下软件包(您的版本号可能有所不同),如果缺少,请自行安装(这些包在安装红帽子的时候基本都默认安装了。)
# rpm -qa |grep yum
yum-3.2.19-18.el5
yum-security-1.1.16-13.el5
yum-updatesd-0.9-2.el5
yum-rhn-plugin-0.5.3-30.el5
yum-metadata-parser-1.1.2-2.el5
4.编辑/etc/yum.repos.d/rhel-debuginfo.repo,添加如下内容
baseurl=file:///media/cd/Server
enabled=1

5.执行yum update命令
[root@node1 yum]# yum update
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
rhel-debuginfo                                                                         | 1.3 kB     00:00    
rhel-debuginfo/primary                                                                 | 732 kB     00:00    
rhel-debuginfo                                                                                      2292/2292
Skipping security plugin, no data
Setting up Update Process
No Packages marked for Update
6.至此可以方便地使用yum来安装oracle安装过程中需要的rpm包了。

7.查看liunx版本
# uname -r   ,版本为: 2.6.18-128.e15

8.检查系统上的可用磁盘空间
#fdisk -l
 Filesystem            Size  Used Avail Use% Mounted on
 /dev/hda2             7.7G  2.0G  5.3G  28% /
 /dev/hda6             988M   18M  920M   2% /tmp
 /dev/hda5             9.2G  150M  8.6G   2% /bank
 /dev/hda1              99M   11M   83M  12% /boot
 tmpfs                 506M     0  506M   0% /dev/shm

9. 验证系统要求
# grep MemTotal /proc/meminfo
    MemTotal:512236 kB
# grep SwapTotal /proc/meminfo
    SwapTotal:1574360 kB

所需最小 RAM 为 512MB,而所需最小交换空间为 1GB。对于 RAM 小于或等于 2GB 的系统,交换空间应为 RAM 数量的两倍;对于 RAM 大于 2GB 的系统,交换空间应为 RAM 数量的一到两倍。

10.验证程序包安装和更新
# rpm -q gcc make binutils openmotif setarch compat-db compat-gcc-34 openmotif compat-gcc-34-c++ compat-libstdc++-33 compat-libstdc++-296 libXp

gcc-3.2.3-20
    make-3.79.1-17
    binutils-2.14.90.0.4-26
    package openmotif is not installed

    setarch-1.3-1
    package compat-db is not installed
    compat-gcc-7.3-2.96.122
    compat-gcc-c++-7.3-2.96.122
    compat-libstdc++-7.3-2.96.122
    compat-libstdc++-devel-7.3-2.96.122

11.接下来使用yum来安装缺少的支持包,运行一下两个命令:

yun install openmotif和yun install compat

12.再次.验证程序包安装

# rpm -q gcc make binutils openmotif setarch compat-db compat-gcc-34 openmotif compat-gcc-34-c++ compat-libstdc++-33 compat-libstdc++-296 libXp

gcc-4.1.2-46.el5
make-3.81-3.el5
binutils-2.17.50.0.6-12.el5
openmotif-2.3.1-2.el5
setarch-2.0-1.1
compat-db-4.2.52-5.1
compat-gcc-34-3.4.6-4
openmotif-2.3.1-2.el5
compat-gcc-34-c++-3.4.6-4
compat-libstdc++-33-3.2.3-61
compat-libstdc++-296-2.96-138
libXp-1.0.0-8.1.el5

13。修改/etc/redhat-release文件

# vi /etc/redhat-release
把Red Hat Enterprise Linux Server release 5 (Tikanga)改成
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)

14.修改系统内核参数,添加下面内容
# vi /etc/sysctl.conf

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

15.使上述配置文件生效
# /sbin/sysctl -p

16.添加用户组和用户
# groupadd oinstall
# groupadd dba

17.添加oracle用户
# useradd -m -g oinstall -G dba oracle

18.修改oracle用户密码
# passwd oracle

19.创建程序文件夹
# mkdir -p /u01/001

20.给文件夹赋予权限
# chown -R oracle:oinstall /u01/001
# chmod -R 755 /u01/001

21为oracle用户设置Shell限制,添加以下参数到/etc/security/limits.conf文件
# vi /etc/security/limits.conf

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

22添加以下参数到/etc/pam.d/login文件
# vi /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so

23添加以下参数到/etc/security/limits.conf文件
# vi /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

24.查看修改Hosts文件
#vi /etc/hosts

25查看/etc/selinux/config文件是否有如下参数,确认SELINUX已经禁用:
#vi /etc/selinux/config
SELINUX=disabled

26.执行下列命令,使x—server接收客户端的信号量
#xhost +

27给安装程序赋予执行权限
#chown -R 755 【oracle安装程序所在路径】

28切换成oracle用户
# su - oracle

29编辑.bash_profile文件
$ vi ~/.bash_profile

export ORACLE_BASE=/u01/001  
export ORACLE_SID=orcl
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBARY_PATH=$ORACLE_HOME/lib
export PATH
umask 022

30切换到安装程序所在目录
$cd 安装程序所在目录

31执行安装
$ ./runInstaller

32安装临近结束时,需要以root身份执行以下两个脚本文件
[root@node1 ~]# /u01/001/oraInventory/orainstRoot.sh
Changing permissions of /u01/001/oraInventory to 770.
Changing groupname of /u01/001/oraInventory to oinstall.
The execution of the script is complete
[root@node1 ~]# /u01/001/product/10.2.0/db_1/root.sh
Running Oracle10 root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/001/product/10.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
[root@node1 ~]#
33安装结束,改回操作系统版权信息
# vi /etc/redhat-release
把Red Hat Enterprise Linux AS release 4 (Nahant Update 4)改回成
Red Hat Enterprise Linux Server release 5 (Tikanga)

34启动监听器
$ lsnrctl start

35启动DBCA创建数据库
$ dbca

36切换到root用户
$su - root

37创建自启动脚本
# vi /etc/rc.d/init.d/oracle

#!/bin/bash
#
# chkconfig: 35 95 1
# de script ion: init   script to start/stop oracle database 10g, TNS listener, EMS
# match these values to your environment:
export ORACLE_BASE=/DBSoftware/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=/u01/app/oracle/bin:$ORACLE_HOME/bin:$PATH
export ORACLE_SID=orcl
export ORACLE_USER=oracle
# see how we are called:
case $1 in
     start)
         su - "$ORACLE_USER"<<EOO
         lsnrctl start
         sqlplus /nolog<<EOS
         connect / as sysdba
         startup
     EOS
     emctl start dbconsole
     EOO
     touch /var/lock/subsys/$ script name
     ;;
     stop)
         su - "$ORACLE_USER"<<EOO
         lsnrctl stop
         sqlplus /nolog<<EOS
         connect / as sysdba
         shutdown immediate
     EOS
     emctl stop dbconsole
     EOO
     rm -f /var/lock/subsys/ script name
     ;;
*)
echo "Usage: $0 "
;;
esac
38赋予权限和并设置组和用户信息
#chown root.root /etc/rc.d/init.d/oracle

#chmod 755 /etc/rc.d/init.d/oracle

=============至此,所有步骤执行完成,已经在机器上安装通过============

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值