在RedHat Linux Enterprise5上安装Oracle10g

来源:互联网 发布:淘宝企业用户注册 编辑:程序博客网 时间:2024/05/01 00:09

1.装Linux 版本RedHat EnterPrise5

安装LINUX时需要注意磁盘空间的分配,本人在虚拟机上进行安装测试的.以下空间分配是必须的

/boot 100MB

/         如果安装LINUX图形界面的话,最好给10GB

/swap 至少1.5GB,建议2GB以上

/tmp   至少400MB , 建议1GB

 

2. 装ORACLE所需安装包,类似打补丁 插入LINUX光盘
检查系统,查看系统所需要的软件包,如果没有则必须安装
加载光盘
#mount /dev/cdrom /mnt
#cd /mnt/Server

 

3.安装FTP服务(技巧,使用TAB键,自动完成文件名的输入)[可选]
#rpm -ivh vsftpd-2.0.5-16.e15.i386.rpm
编辑FTP配置文件,使匿名用户可以访问
#vim /etc/vsftpd/vsftpd.conf
修改配置文件(按i键插入编辑,按ESC键退出编辑状态,输入:wq!回车,表示写入保存并退出)
#anon_upload_enaber=YES
#anon_mkdir_write_enable=YES
去掉上述两行前面的注释标记#即可
修改FTP用户权限
#chown ftp /var/ftp/pub
启动FTP服务
#service vsftpd start
设置FTP服务自动开启
#chkconfig --level 35 vsftpd on
测试FTP服务,将ORACLE10g安装包上传至FTP

 

4. 安装配置YUM[可选]
由于安装软件包时,存在太多依赖关系,建议使用YUM来安装
安装YUM 服务器端配置
将LINUX光盘中的内容COPY至FTP
#cp -r /mnt/Server /var/ftp/pub
#cd /var/ftp/pub/Server
安装软件
#rpm -ivh createrepo?.rpm
生成包之间的关联关系
#createrepo ./

配置YUM客户端
#cd /etc/yum.repos.d/
COPY一个REPO文件的副本,并修改其内容
#cp rhel-debuginfo.repo yum.repo
#vim yum.repo

[rhel1]
name=Red Hat Enterprise Linux
baseurl=ftp://192.168.2.100/pub/Server
enabled=1

使用下面的命令查询未安装的包
# rpm -q gcc make binutils openmotif setarch compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compatlibstdc++-
devel

使用YUM安装未安装的包
#yum install openmotif
依次装完所需安装的包

 

5. 修改内核参数
#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
修改完内核参数后,需要重启
#reboot

 

 6. 解压ORACLE安装包
新建目录用于存放ORACLE安装文件
#mkdir -p /u01/app/oracle/product/10.2/
通过FTP将安装包上传至LINUX服务器
#cp /var/ftp/pub/10201_database_linux32.zip /u01/
#cd /u01/
#unzip 10201_database_linux32.zip

 

7. 安装ORACLE之前,设置好环境变量,添加用户及组等
创建ORACLE用户及所属组
#groupadd oinstall
#groupadd dba
#useradd -m -g oinstall -g dba oracle
#passwd oracle [回车后开始设置密码]

将/u01文件夹所有者给ORACLE
#chown -R oracle.oinstall /u01
#chmod -R 775 /u01

设置ORACLE环境变量(使用ORACLE账号登录)
#vi ~/.bash_profile
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2/; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

oracle_base,oracle_home,oracle_sid,要根据自己的情况配,和在Windows下写环境变量是一样的

 

8.开始安装ORACLE10g
#cd /u01/database
#./ runInstaller

如果安装界面出现显示不全或是乱码,切换语言到英文即可

#LANG='en_US'

 

另:

1. 在配置完所有内容,运行./runinstaller的时候,报错
错误信息:

  Exception in thread "main" java.lang.UnsatisfiedLinkError:
  /tmp/OraInstall2007-12-03_09-02-02AM/jre/1.4.2/lib/i386/libawt.so:
  libXp.so.6: cannot open shared object file:


  No such file or directory
  at java.lang.ClassLoader$NativeLibrary.load(Native Method)
  at java.lang.ClassLoader.loadLibrary0(Unknown Source)
  at java.lang.ClassLoader.loadLibrary(Unknown Source)
  at java.lang.Runtime.loadLibrary0(Unknown Source)
  at java.lang.System.loadLibrary(Unknown Source)
  at sun.security.action.LoadLibraryAction.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
  at sun.awt.DebugHelper.(Unknown Source)
  at java.awt.Component.(Unknown Source)

 

原因是由于缺少了libXp.so.6包,根据Oracle的解决方案需要安装xorg-x11-deprecated-libs-6.8.2-1.EL.13.20.i386.rpm包。

请检查YUM安装时,是否安装完整,将缺少的RPM包安装完即可

 

2. 安装完成后,出现错误提示:

OUI - 10058

Message

The OUI Inventory on this system does not exist or is not writable. The possible POTENTIAL/POSSIBLE CAUSES are:1. The script <path>/orainstRoot.sh was not executed with root privileges, or an error occurred during execution.2. You are not a member of the specified installer group.

Potential Causes

One of the following situations may apply:

  • The permissions for the orainstRoot.sh script are not set correctly for execution as "root" user.

  • You are not part of the particular group specified at the start of installation.

Possible Solutions

  • Make sure that the script is run as user "root."

  • Make sure that you are a part of the particular group specified at the start of installation. Check the group "dba" as shown in the following example:

    %cat /etc/group | grep dbadba:x:502:oracle

    In this example, the group is dba, the group ID is 502, and the user oracle is a part of the dba group.

解决办法: 使用root账号登录,执行该脚本即可

#cd /home/oracle/

#./orainstRoot.sh