`
carvin
  • 浏览: 209518 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Redhat Linux Enterprise 5.5 安装 oracle10g 详解

阅读更多
一、       安装准备:
下载文件
l         Oracle Database 10g Release 2(10.2.0.1) Software
解压文件
解压文件命令:
unzip 10201_database_linux32.zip
解压后的文件夹可能“database”
Hosts文件
在/etc/hosts 文件中包含一个完整合法的服务器名
<IP-address> <fully-qualified-machine-name> <machine-name>

设置内核参数
在/etc/sysctl.conf中添加以下行:
#kernel.shmall = 2097152
#kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
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.wmen_max=262144

运行下面的命令应用以上OS参数
/sbin/sysctl -p
添加以下行到/ect/security/limits.conf文件中
*               soft    nproc   2047
*               hard    nproc   16384
*               soft    nofile 1024
*               hard    nofile 65536


如果/etc/pam.d/login文件中没有以下行,则添加以下内容:
session    required     /lib/security/pam_limits.so
修改/etc/selinux/config文件来关闭linux防火墙,确保SELINUX设置如下:
SELINUX=disabled

检查安装包
检查是否具备以下安装包:
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



用以下命令安装以下包:

rpm -Uvh [包名称]


添加组和用户
#groupadd oinstall
#groupadd dba
 
#useradd -g oinstall -G dba oracle
#passwd oracle


检查内存和磁盘
检查内存情况
# grep MemTotal /proc/meminfo
# grep SwapTotal /proc/meminfo


检查磁盘情况
#df -h

建立安装目录
建立oracle安装目录
#mkdir -p /opt/oracle
#chown -R oracle:install /opt/oracle
# chmod -R 775 /opt/oracle

版本信息
因为默认rhel5.5不支持10.2,0.1,所以要修改一些参数
编辑/etc/redhat-release文件替换现在的版本信息(Red Hat Enterprise Linux Server release 5.5 (Tikanga))

redhat-4

以可以通过修改安装文件oraparam.ini,添加redhat-5.5(二者选一即可)

# vi /10201_database_linux32/database/install/oraparam.ini

### #[Certified Versions]
Linux=redhat-3,SuSE-9,redhat-4,redhat-5.5,UnitedLinux-1.0,asianux-1,asianux-2]


再添加

[Linux-redhat-5.5-optional]

TEMP_SPACE=80

SWAP_SPACE=150

MIN_DISPLAY_COLORS=256


用户环境变量
以oracle用户登陆,在.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.0/db_1
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


二、开始安装

如果担心安装界面中文乱码设置环境变量(使用英文环境安装)
$ export LANG=C

1.   选择安装方式,选择高级安装
2.选择安装目录
3.   选择安装类型, 在选择安装类型时,选择产品语言,把中文选上,不选的话,数据库默认为支持的语言只有英文。
4.   安装详细路径
5.   软件要求检查
6.   配置选项 一般选择“创建数据库(C)”
7.   数据库配置 一般选择“一般用途(G)”
8.   数据库配置详情,字符集根据实际情况选择,可以选择AL32UTF8/ZHS16GBK,这样可以支持中文
9.   数据库管理选项 一般选择“使用Database Control管理数据库”
10.  数据库文件存储选项 一般选择“文件系统”
11.  备份和恢复选项 一般选择“不启用自动备份”
12.  设置密码 根据个人情况设置密码
14.  配置Assistants
15.  数据库配置助手
16.  密码管理
17.  运行脚本, 必须在root用户下运行。
18.  结束安装

三、常见问题(FAQ)
错误1
在./runInstaller运行时出现
检查监视器:颜色必须大于256色
无法使用命令 /usr/X11R6/bin/xdpyinfo 自动检查显示器颜色。请检查是否设置了DISPLAY 变量。
解决方法:
1)先查看是否设置了DISPLAY变量
$echo $DISPLAY

如果出现:0.0 或者ip:0.0表明已经设置
如果没有设置DISPLAY
$export DISPLAY=:0.0或者ip:0.0

2)如果设置了DISPLAY变量 还出现此问题。检查/usr/X11R6/bin 下是否有xdpyinfo,
如果没有,表明libXp.so.6没有安装。
安装方法:
1> 到 http://ftp.xfree86.org/pub/XFree86/,找到最新版本点进去,现在是4.8.0。
2> 如果对自己系统不熟悉,可以先下个Xinstall.sh。然后运行 sh Xinstall.sh -check
他会告诉你下哪个编译好的版本适合你的系统。我的是”Linux-ix86-glibc24″。
然后点binaries进去,不研究源码,只是拿来用,就下预编译的好了。接着点“Linux-ix86-glibc24”。
3> 这有很多tar,注意:你只要下Xbin.tgz就够了(现在是6.6M)
4> tar zxf Xbin.tgz -C /usr/X11R6
5> vi /etc/ld.so.conf,加入/usr/X11R6/lib
6> ldconfig

错误2
在./runInstaller运行时出现,
错误描述:Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2007-09-25_10-54-49PM/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.<clinit>(Unknown Source)
at java.awt.Component.<clinit>(Unknown Source)
这个错误的出现原因是因为RatHat Enterprise Linux 5标准安装时,缺少libXp-1.0.0-8.i386.rpm包的缘故,我安装时尽管选的是全安装,还是出现这个问题。在光盘的Server文件下找到libXp-1.0.0-8.i386.rpm,在该目录下使用命令:

错误3
在oracle Universal Installer:Install过程中出现,
错误描述:
Exception String: Error in invoking target 'all_no_orcl ihsodbc' of makefile '/oracle/oracle/product/10.2.0/rdbms/lib/ins_rdbms.mk'. See '/oracle/oraInventory/logs/installActions2007-09-25_03-42-11AM.log' for details.
Exception Severity: 1
这个原因也是由于缺少相应的包compat-libstdc++-33-3.2.3-61.i386.rpm,手动安装吧。进到光盘的Sever目录下,运行下面命令:
[root@localhost  Server ]#rmp -ivh compat-libstdc++-33-3.2.3-61.i386.rpm

错误4
如果在安装过程中(大概在63%左右)出现make file 'relink'/'ioracle'等等 出错,我安装的时候是点击retry然后就通过了。具体原因还不清楚,还请高手指点。

错误5
"Oracle Database Configuration Assistant" Failed On CentOS 6.3
错误信息如下:
INFO: Configuration assistant "Oracle Net Configuration Assistant" failed
-----------------------------------------------------------------------------
*** Starting OUICA ***
Oracle Home set to /opt/oracle/product/10.2.0/db_1
Configuration directory is set to /opt/oracle/product/10.2.0/db_1/cfgtoollogs. All xml files under the directory will be processed
INFO: The "/opt/oracle/product/10.2.0/db_1/cfgtoollogs/configToolFailedCommands" script contains all commands that failed, were skipped or were cancelled. This file may be used to run these configuration assistants outside of OUI. Note that you may have to update this script with passwords (if any) before executing the same.
-----------------------------------------------------------------------------
SEVERE: OUI-25031:Some of the configuration assistants failed. It is strongly recommended that you retry the configuration assistants at this time. Not successfully running any "Recommended" assistants means your system will not be correctly configured.
1. Check the Details panel on the Configuration Assistant Screen to see the errors resulting in the failures.
2. Fix the errors causing these failures.
3. Select the failed assistants and click the 'Retry' button to retry them.

解决方案:
查看uname -a , hostname 是否相同
查看/etc/hosts 和 /etc/sysconfig/network两个文件 是否添加和hostname相同的服务器名称。
四、测试Oracle 10g 数据库:
1. 启动Oracle10g 数据库sqlplus
$ sqlplus "scott/tiger as sysdba"

将出现如下连接数据库信息:
SQL*Plus: Release 10.1.0.2.0 - Production on 星期三 3月 24 16:23:27 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
表明登录数据库系统成功,运行startup命令启动数据库。
SQL> startup
ORACLE instance started.
Total System Global Area 336356520 bytes
Fixed Size 279720 bytes
Variable Size 268435456 bytes
Database Buffers 67108864 bytes
Redo Buffers 532480 bytes
Database mounted.
Database opened.
SQL>
表示数据库正常启动。
2. 关闭Oracle10g 数据库
$ sqlplus "scott/tiger as sysdba" //以sysdba用户登录数据库

成功登录数据库系统后,运行shudown命令关闭数据库。
SQL> shutdown immediate

3. 启动Oracle10g监听程序
Oracle的监听程序主要是为客户端的连接提供接口,在控制台窗口键入如下命令:
$ lsnrctl

将出现如下监听程序信息:
LSNRCTL for 32-bit Windows: Version 10.1.0.2.0 - Production on 24-3月 -2004 16
:59:51
Copyright (c) 1991, 2004, Oracle. All rights reserved.
欢迎来到LSNRCTL, 请键入"help"以获得信息。
LSNRCTL>
表明登录监听程序控制台成功,运行start命令启动监听程序。
LSNRCTL> start

将出现监听程序的一系列启动和配置情况信息列表。
信息行的最后一行是“The command completed successfully”字样时,监听程序启动成功。
4. 关闭Oracle10g监听程序
运行stop命令关闭监听程序。
LSNRCTL> stop


五、设置oracle自动启动与关闭
1、编辑 /etc/oratab,把所有的 instance 的重启动标志设置成 'Y',如:
fstest:/oracle/product/ 10.2.0:Y
2、做一个启动脚本 /etc/init.d/dbora ,如下所示:
#!/bin/sh
# description: Oracle auto start-stop script.

# chkconfig: - 20 80
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/oracle/product/10.2.0/
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
;;
'restart')
$0 stop
$0 start
;;
esac

3、赋予执行权限
chmod 750 /etc/init.d/dbora

作成以下链接:
ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora
ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora

执行以下命令:
chkconfig --level 345 dbora on



参考文档:
http://blog.csdn.net/picklove/archive/2008/01/25/2065022.aspx
http://bianbian.org/technology/242.html
http://www.linuxidc.com/Linux/2008-02/11275p3.htm
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics