redhat Enterprise linux5.2下安装oracle10g

      通过实践成功操作后,整理出redhat Enterprise linux5.2下安装oracle10g的安装配置过程,记录下遇到的问题及其解决办法。

 

检查系统组件

安装oracle之前先检查swap分区是否够大,swap=1.5X内存+一点点,比如你的内存是2G,你可以设置2个swap文件,
1个为2000M,另一个为1064M,总和要3G以上,单个文件不要超过2G,32位系统不能识别大于2G的文件。

检查内存情况

# grep MemTotal /proc/meminfo

# grep SwapTotal /proc/meminfo

检查磁盘情况

#df -h
接下来就要检查组件安装情况

检查是否具备以下安装包

make-3.79.1 gcc-3.2.3-34 glibc-2.3.2-95.20 compat-db-4.0.14-5 compat-gcc-7.3-2.96.128 compat-gcc-c++-7.3-2.96.128

compat-libstdc++-7.3-2.96.128 compat-libstdc++-devel-7.3-2.96.128 libXp openmotif21-2.1.30-8 setarch-1.3-1

查询所需安装包是否已经安装完整

#rpm -q gcc make binutils openmotif setarch compat-db compat-gcc compat-gcc-c++ compat-libstdc++

compat-libstdc++-devel libXp

如果缺少某些软件包可以通过挂载oracle10g的安装文件

#mount -t iso9660 /dev/cdrom /mnt 

#cd /mnt 进入mnt目录

#find . -type f|grep 软件包名 查找缺少的软件包
如有返回结果,会是/Server/*.rpm  即可进入Server目录 通过 rpm -Uvh *.rpm 安装软件包;如果安装文件中没有所缺少的软件安装包。 
可到http://rpm.pbone.net/index.php3/stat/4/idpl/7212934/com/libXp-1.0.0-11.fc9.i386.rpm.html查找下载安装
[root@localhost /]# mount -t iso9660 /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@localhost /]# cd /mnt
[root@localhost /]# cd /mnt
[root@localhost mnt]# ls
Cluster                RELEASE-NOTES-es.html        RELEASE-NOTES-U1-ta.html
ClusterStorage         RELEASE-NOTES-fr.html        RELEASE-NOTES-U1-te.html
EULA                   RELEASE-NOTES-gu.html        RELEASE-NOTES-U1-zh_CN.html
eula.en_US             RELEASE-NOTES-hi.html        RELEASE-NOTES-U1-zh_TW.html
GPL                    RELEASE-NOTES-it.html        RELEASE-NOTES-U2-as.html
images                 RELEASE-NOTES-ja.html        RELEASE-NOTES-U2-bn.html
isolinux               RELEASE-NOTES-kn.html        RELEASE-NOTES-U2-de.html
README-as.html         RELEASE-NOTES-ko.html        RELEASE-NOTES-U2-en.html
README-bn.html         RELEASE-NOTES-ml.html        RELEASE-NOTES-U2-es.html
README-de.html         RELEASE-NOTES-mr.html        RELEASE-NOTES-U2-fr.html
README-en              RELEASE-NOTES-or.html        RELEASE-NOTES-U2-gu.html
README-en.html         RELEASE-NOTES-pa.html        RELEASE-NOTES-U2-hi.html
README-es.html         RELEASE-NOTES-pt_BR.html     RELEASE-NOTES-U2-it.html
README-fr.html         RELEASE-NOTES-ru.html        RELEASE-NOTES-U2-ja.html
README-gu.html         RELEASE-NOTES-si.html        RELEASE-NOTES-U2-kn.html
README-hi.html         RELEASE-NOTES-ta.html        RELEASE-NOTES-U2-ko.html
README-it.html         RELEASE-NOTES-te.html        RELEASE-NOTES-U2-ml.html
README-ja.html         RELEASE-NOTES-U1-as.html     RELEASE-NOTES-U2-mr.html
README-kn.html         RELEASE-NOTES-U1-bn.html     RELEASE-NOTES-U2-or.html
README-ko.html         RELEASE-NOTES-U1-de.html     RELEASE-NOTES-U2-pa.html
README-ml.html         RELEASE-NOTES-U1-en.html     RELEASE-NOTES-U2-pt_BR.html
README-mr.html         RELEASE-NOTES-U1-es.html     RELEASE-NOTES-U2-ru.html
README-or.html         RELEASE-NOTES-U1-fr.html     RELEASE-NOTES-U2-si.html
README-pa.html         RELEASE-NOTES-U1-gu.html     RELEASE-NOTES-U2-ta.html
README-pt_BR.html      RELEASE-NOTES-U1-hi.html     RELEASE-NOTES-U2-te.html
README-ru.html         RELEASE-NOTES-U1-it.html     RELEASE-NOTES-U2-zh_CN.html
README-si.html         RELEASE-NOTES-U1-ja.html     RELEASE-NOTES-U2-zh_TW.html
README-ta.html         RELEASE-NOTES-U1-kn.html     RELEASE-NOTES-zh_CN.html
README-te.html         RELEASE-NOTES-U1-ko.html     RELEASE-NOTES-zh_TW.html
README-zh_CN.html      RELEASE-NOTES-U1-ml.html     RPM-GPG-KEY-redhat-beta
README-zh_TW.html      RELEASE-NOTES-U1-mr.html     RPM-GPG-KEY-redhat-release
RELEASE-NOTES-as.html  RELEASE-NOTES-U1-or.html     Server
RELEASE-NOTES-bn.html  RELEASE-NOTES-U1-pa.html     TRANS.TBL
RELEASE-NOTES-de.html  RELEASE-NOTES-U1-pt_BR.html  VT
RELEASE-NOTES-en       RELEASE-NOTES-U1-ru.html
RELEASE-NOTES-en.html  RELEASE-NOTES-U1-si.html
[root@localhost mnt]# rpm -q gcc make binutils openmotif setarch compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel libXp
package gcc is not installed
make-3.81-3.el5
binutils-2.17.50.0.6-6.el5
package openmotif is not installed
setarch-2.0-1.1
package compat-db is not installed
package compat-gcc is not installed
package compat-gcc-c++ is not installed
package compat-libstdc++ is not installed
package compat-libstdc++-devel is not installed
package libXp is not installed
[root@localhost mnt]# find . -type f|grep gcc
./Server/compat-gcc-34-3.4.6-4.i386.rpm
./Server/compat-gcc-34-c++-3.4.6-4.i386.rpm
./Server/compat-gcc-34-g77-3.4.6-4.i386.rpm
./Server/compat-libgcc-296-2.96-138.i386.rpm
./Server/gcc-4.1.2-42.el5.i386.rpm
./Server/gcc-c++-4.1.2-42.el5.i386.rpm
./Server/gcc-gfortran-4.1.2-42.el5.i386.rpm
./Server/gcc-gnat-4.1.2-42.el5.i386.rpm
./Server/gcc-java-4.1.2-42.el5.i386.rpm
./Server/gcc-objc++-4.1.2-42.el5.i386.rpm
./Server/gcc-objc-4.1.2-42.el5.i386.rpm
./Server/libgcc-4.1.2-42.el5.i386.rpm
[root@localhost mnt]# cd Server
//**安装gcc*//
[root@localhost Server]# rpm -Uvh kernel-headers-2.6.18-92.el5.i386.rpm
warning: kernel-headers-2.6.18-92.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:kernel-headers         ########################################### [100%]
[root@localhost Server]# rpm -Uvh glibc-headers-2.5-24.i386.rpm
warning: glibc-headers-2.5-24.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:glibc-headers          ########################################### [100%]
[root@localhost Server]# rpm -Uvh glibc-devel-2.5-24.i386.rpm
warning: glibc-devel-2.5-24.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:glibc-devel            ########################################### [100%]
[root@localhost Server]# rpm -Uvh libgomp-4.1.2-42.el5.i386.rpm
warning: libgomp-4.1.2-42.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:libgomp                ########################################### [100%]
[root@localhost Server]# rpm -Uvh gcc-4.1.2-42.el5.i386.rpm
warning: gcc-4.1.2-42.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:gcc                    ########################################### [100%]
//*安装openmotif*//
[root@localhost Server]# rpm -Uvh libXp-1.0.0-8.1.el5.i386.rpm
warning: libXp-1.0.0-8.1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:libXp                  ########################################### [100%]
[root@localhost Server]# rpm -Uvh openmotif-2.3.0-0.5.el5.i386.rpm
warning: openmotif-2.3.0-0.5.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:openmotif              ########################################### [100%]

//*安装compat-db*//
[root@localhost Server]# rpm -Uvh compat-db-4.2.52-5.1.i386.rpm
warning: compat-db-4.2.52-5.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: failed to stat /mnt/hgfs: No such file or directory
Preparing...                ########################################### [100%]
   1:compat-db              ########################################### [100%]

//*安装*//
[root@localhost virtualredhatenterpriseshare]# cd /home/package
[root@localhost package]# ls
compat-gcc-7.3-2.96.118.i386.rpm
compat-gcc-c++-7.3-2.96.118.i386.rpm
compat-libstdc++-7.3-2.96.118.i386.rpm
compat-libstdc++-devel-7.3-2.96.118.i386.rpm
[root@localhost package]# rpm -Uvh compat-gcc-7.3-2.96.118.i386.rpm compat-gcc-c++-7.3-2.96.118.i386.rpm compat-libstdc++-7.3-2.96.118.i386.rpm compat-libstdc++-devel-7.3-2.96.118.i386.rpm
warning: compat-gcc-7.3-2.96.118.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
Preparing...                ########################################### [100%]
   1:compat-libstdc++       ########################################### [ 25%]
   2:compat-libstdc++-devel ########################################### [ 50%]
   3:compat-gcc             ########################################### [ 75%]
   4:compat-gcc-c++         ########################################### [100%]
  
  
[root@localhost mnt]# find . -type f|grep libaio-deve


./Server/libaio-devel-0.3.106-3.2.i386.rpm
[root@localhost mnt]#
[root@localhost mnt]#
[root@localhost mnt]# cd Server
[root@localhost Server]# rpm -ivh libaio-devel-0.3.106-3.2.i386.rpm
warning: libaio-devel-0.3.106-3.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: failed to stat /mnt/hgfs: No such file or directory
Preparing...                ########################################### [100%]
   1:libaio-devel           ########################################### [100%]
[root@localhost Server]# cd ..
[root@localhost mnt]# find . -type f|grep readline-devel-4.3-13
[root@localhost mnt]# find . -type f|grep readline-devel
./Server/readline-devel-5.1-1.1.i386.rpm
[root@localhost mnt]# cd Server
[root@localhost Server]# rpm -ivh readline-devel-5.1-1.1.i386.rpm
warning: readline-devel-5.1-1.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
        libtermcap-devel is needed by readline-devel-5.1-1.1.i386
[root@localhost Server]# cd ..
[root@localhost mnt]# find . -type f|grep libtermcap-devel
./Server/libtermcap-devel-2.0.8-46.1.i386.rpm
[root@localhost mnt]# cd Server
[root@localhost Server]# rpm -ivh libtermcap-devel-2.0.8-46.1.i386.rpm
warning: libtermcap-devel-2.0.8-46.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: failed to stat /mnt/hgfs: No such file or directory
Preparing...                ########################################### [100%]
   1:libtermcap-devel       ########################################### [100%]
[root@linmusheng Server]# rpm -ivh readline-devel-5.1-1.1.i386.rpm
warning: readline-devel-5.1-1.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: failed to stat /mnt/hgfs: No such file or directory
Preparing...                ########################################### [100%]
   1:readline-devel         ########################################### [100%]
       
创建oracle用户和组

#groupadd dba
#groupadd oinstall
#useradd -g oinstall -G dba -m oracle
#passwd oracle

创建oracle安装目录,并设置权限

#mkdir -p /opt/oracle
#chown -R oracle.oinstall /opt/oracle

#chmod -R 775 /opt/oracle

解压oracle安装文件

#cd /home/oracle/
#unzip oracle_10201_database_linux32.zip

设置环境变量

# su - oracle
$ vi ~/.bash_profile

增加如下内容

export ORACLE_BASE=/home/opt/oracle
export ORACLE_SID=orcl
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0.1/db_1
export PATH=$PATH:$ORACLE_HOME/bin

保存后使用如下命令,使设置生效

$ source ~/.bash_profile

修改Linux发行版本信息

由于Oracle 10g发行的时候,RedHat Enterprise Linux 5没有发行,所以Oracle 10g并没有对RedHat Enterprise Linux 5确认支持,
采用如下方法可以让Oracle 10g支持RedHat Enterprise Linux 5。
[方法]:
手工修改Linux的发行注记,让Oracle 10g支持RedHat Enterprise Linux 5。
编辑/etc/redhat-release文件
# vi /etc/redhat-release
将其中的内容Red Hat Enterprise Linux Server release 5.1(Tikanga)修改为Red Hat Enterprise Linux AS release 4(Tikanga)

配置 Linux 内核参数
# vi /etc/sysctl.conf
kernel.shmall = 2097152         /*该参数表示系统一次可以使用的共享内存总量(以页为单位)。缺省值就是2097152,通常不需要修改
kernel.shmmax = 2147483648      /*该参数定义了共享内存段的最大尺寸(以字节为单位)。缺省为32M,对于oracle来说,该缺省值太低了,通常将其设置为2G
kernel.shmmni = 4096            /* 这个内核参数用于设置系统范围内共享内存段的最大数量。该参数的默认值是 4096 。通常不需要更改
kernel.sem = 250 32000 100 128  /* 表示设置的信号量
fs.file-max = 65536             /*表示文件句柄的最大数量。文件句柄设置表示在linux系统中可以打开的文件数量
net.ipv4.ip_local_port_range = 1024 65000
如果系统的参数设置的比上述参数值小,则编辑 /etc/sysctl.conf 文件,添加或更改这些参数。完成后,运行以下命令激活更改:
#/sbin/sysctl -p
可执行如下命令(以root身份):
#cat >> /etc/sysctl.conf <<EOF
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
EOF
/sbin/sysctl -p

为 oracle 用户设置 Shell 限制
Oracle 建议对每个 Linux 帐户可以使用的进程数和打开的文件数设置限制。要进行这些更改,以 root 用户的身份执行下列命令:

cat >> /etc/security/limits.conf <<EOF
oracle               soft    nproc   2047
oracle               hard    nproc   16384
oracle               soft    nofile  1024
oracle               hard    nofile  65536
EOF

cat >> /etc/pam.d/login <<EOF
session    required     /lib/security/pam_limits.so
EOF

配置Linux主机

修改/etc/hosts 文件将127.0.0.1改为你的ip(例如:192.168.0.200) 否则网络检查通不过
注意:安装完成后要添加127.0.0.1 loopback localhost 否则oracle监听器启动时会出现

安装
root 用户下
[root@localhost ~]#xhost +
access control disabled, clients can connect from any host
切换到oracle用户
[root@localhost ~]$ #su - oracle
[oracle@localhost ~]$
[oracle@localhost ~]$ ls
10201_database_linux32.zip  database
[oracle@localhost ~]$ cd database
[oracle@localhost database]$
[oracle@localhost database]$ ls
doc  install  response  runInstaller  stage  welcome.html
[oracle@localhost database]$
[oracle@localhost database]$ sh runInstaller //启动Oracle智能安装向导(Oracle Universal Installer ),就出现了图形界面,再按照提示一步一步安装


在安装快要完成的时候会出现提示,提示中有如下两个文件名:

/opt/oracle/oraInventory/orainstRoot.sh
/opt/oracle/product/10.2.0.1/db_1/root.sh
打开新的终端以root用户模式运行pt/oracle/product/10.2.0.1/db_1/root.sh /opt/oracle/oraInventory/orainstRoot.sh

 

按提示完成安装

 

结束安装

 

编辑 /etc/redhat-release 文件把RHEL的版本信息改回去

 

Red Hat Enterprise Linux Server release 5.2(Tikanga) 

 

安装成功之后,接着要创建监听以及创建数据库 

创建监听程序,使用Oracle提供的NET CONFIGURATION ASSISTANT创建TNS监听

 $ netca    /*基本上就是一直Next就可以了,可以在这期间修改TNS的监听端口号

TNS监听创建完成后可以使用如下命令进行检查
# netstat -atln   /* 检查TNS的监听端口是否已经打开
$ lsnrctl status   /* 检查TNS监听状态
确认监听已经成功启动后

$ dbca  /*执行Database Configure Assistant进行数据库的创建
在创建数据库的过程中,建议将数据库的字符集设置为Unicode UTF-8,防止出现乱码。

 

重启后

监听器 数据库 数据库管理器 并没有随系统自动启动

若手动启动监听器时 报错 TNS-12547: TNS:lost contact 原因有以下两个:
一.lintener.log日志文件太大了,超过2G了,所以无法启动,
二.可能是/etc/hosts 目录下没有 127.0.0.1     loopback localhost 记录
这是通常导致此错误的常见原因

一 解决方法

先删除rm lintener.log,然后touch一个listener.log,再启动监听器

Lsnrctl stop  -----先停掉listener
rm listener.log ----cd $ORACLE_HOME/network/log
touch listener.log
lsnrctl start

 

启动监听器 数据库 企业管理器
lsnrctl start
sqlplus
startup
emctl start dbconsole

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值