RedHat EL5 x86-64上命令行安装Oracle 10g笔记
RedHat EL5 x86-64上命令行安装Oracle 10g笔记
声明:本文中所描述的系统命令,未经特殊标示,均为“#”代表root权限,“$”代表Oracle权限。
安装前的准备
准备工作要用登录为root用户来进行。
选择安装环境的语言
Oracle安装时可以通过环境变量LANG指定安装语言,如果Linux命令行不能显示中文,就要将语言环境设置为英语。
例如:export LANG=en_US.UTF-8
修改gennttab
Oracle 10g在一些Linux系统下安装可能会被中断,在安装日志文件$ORACLE_HOME/install/make.log里可以看见以下错误信息:
/bin/sed: -e expression #1, char 7: unterminated `s' command
要解决这个问题就必须编辑文件 gennttab。
先解压Oracle安装目录下的 stage/Components/oracle.network.rsf/10.2.0.1.0/1/DataFiles/filegroup6.jar,可以用以下方法之一进行解压
用jar解压:
$jar -xf filegroup6.jar bin/gennttab
用unzip解压:
$unzip filegroup6.jar bin/gennttab
再用文本编辑器(例如vi)打开解压出来的 gennttab,将以下内容
LIB=`$ECHO ${TtoLIB} | $SED 's/ /\\ /g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
INI=`$ECHO ${TtoINI} | $SED 's/ /\\ /g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
BAS=`$ECHO ${TtoBAS} | $SED 's/ /\\ /g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
改为
LIB=`$ECHO ${TtoLIB} | $SED 's/ /\n/g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
INI=`$ECHO ${TtoINI} | $SED 's/ /\n/g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
BAS=`$ECHO ${TtoBAS} | $SED 's/ /\n/g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
保存后再用将gennttab更新到filegroup6.jar里面。
网上有用jar打包的方法,如下:
用jar更新:
$jar -uvf filegroup6.jar bin/gennttab
我在用jar打包出现了同题,就是这么个问题花了我3天时间来找。用jar打包后新的jar 包再用jar –xf 解时解不了!这真是个可笑的问题,自己打的包自己解不了。
我测试过用zip是可以的,不会破环jar包。用zip更新:
$zip -vu filegroup6.jar bin/gennttab
修改内核参数
编辑文件 /etc/sysctl.conf,修改以下项目,如果没有可以自己添加。
# 可以使用的共享内存的总量。
kernel.shmall = 4294967296
# 最大共享内存段大小。
kernel.shmmax = 68719476736
# 整个系统共享内存段的最大数目。
kernel.shmmni = 4096
# 每个信号对象集的最大信号对象数;系统范围内最大信号对象数;每个信号对象支持的最大操作数;系统范围内最大信号对象集数。
kernel.sem = 250 32000 100 128
# 系统中所允许的文件句柄最大数目。
fs.file-max = 65536
# 应用程序可使用的IPv4端口范围。
net.ipv4.ip_local_port_range = 1024 65000
# 套接字接收缓冲区大小的缺省值
net.core.rmem_default = 1048576
# 套接字接收缓冲区大小的最大值
net.core.rmem_max = 1048576
# 套接字发送缓冲区大小的缺省值
net.core.wmem_default = 262144
套接字发送缓冲区大小的最大值
net.core.wmem_max = 262144 #
注:内核参数并非必须修改,可以根据自己实际情况而定。
为Oracle创建DBA组和用户
安装Oracle必须指定拥有DBA权限的组和运行Oracle的用户。
创建组:
#groupadd dba
#groupadd oinstall
#groupadd oper
创建用户:
#useradd -g oinstall -G dba oracle
#passwd oracle
下面修改 oracle用户的.bash_profile文件
注:组名和用户名可以任意指定,不一定要照搬本文。
su - oracle
vi .bash_profile
#--------------------------------------
# Set for Oracle10g Install |
#--------------------------------------
trap " " 0 1 2 3 5 9 15
trap clear 0
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SID=UIP
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/usr/X11R6/lib64/
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LD_ASSUME_KERNEL=2.6.9
export NLS_LANG="Simplified Chinese_china".UTF8
LC_CTYPE=zh_CN.UTF8
LC_ALL=zh_CN.UTF8
LANG=zh_CN.UTF8
umask 022
#
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
#------------------- Set Over
在改了环境变量后用source命令使环境变量立即生效。
$source /home/oracle/.bash_profile
在生效时可能会报错如下:
bash: ulimit: open files: cannot modify limit: 不允许的操作
在安装Oracle 过程中还有其他几个地方参数配置:
我们查看imits.conf文件时,在最上面有参数的解释:
#cat limits.conf
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain> <type> <item> <value>
#
#Where:
#<domain> can be:
# - an user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
#
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
#<item> can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit (KB)
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
# - nice - max nice priority allowed to raise to values: [-20, 19]
# - rtprio - max realtime priority
#
#<domain> <type> <item> <value>
这个参数的意思和ulimit 的-u 和-n 参数作用是一样的。
-u 用户最大可用的进程数。
-n 可以打开最大文件描述符的数量
关于ulimit 的更多内容,参考:
通过 ulimit 改善系统性能
用vi在/etc/security/limits.conf 文件里添加:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
创建安装Oracle的目标目录
创建Oracle系统目录:mkdir /oracle
创建Oracle服务器主目录:mkdir /oracle/10g
将该目录的所有者设置为oracle:chown oracle /oracle -R
编辑 /etc/profile,在后面追加以下两行
export ORACLE_BASE=/oracle
export ORACLE_HOME=/oracle/10g
注:安装Oracle的目标目录可以任意指定,但是安装和运行Oracle的用户必须有完全修改该目录的权限。
下载安装32位JAVA所需的X环境的组件
如果你是在普通的32位的linux下安装oracle 10g,无需做此步骤。但在64位的linux上安装oracle 10g时,必须做此步骤,原因很简单,因为64位的oracle 10g安装包里内含的jdk1.4.2和jre1.4.2都是32位的,所以若不做此步骤便会在下面执行dbca的时候出现提示缺少了libXp.so.6包的错误。
下载安装安装xorg-x11-deprecated-libs-6.8.2-1.EL.13.20.i386.rpm包即可,据说在Oracle提供的ENTERPRISE Linux for X86-64 R4里有相应的包。不过可以在rpmbones.net上找到下载的。
rpm -ivh xorg-x11-deprecated-libs-6.8.2-1.EL.13.20.i386.rpm
rpm -ivh libXt-1.0.7-1.el6.i686.rpm
rpm -ivh libXi-1.3-3.el6.i686.rpm
rpm -ivh libXtst-1.0.99.2-3.el6.i686
然后,在/etc/ld.so.conf里添加:
/usr/X11R6/lib
执行:
#ldconfig
X86_64安装oracle 10g运行库安装
可以在下面的网址下载:http://oss.oracle.com/projects/compat-oracle/files/Enterprise_Linux/
File |
Last Modified |
MD5 Checksum |
binutils-2.17.50.0.6-6.0.1.el5.i386.rpm |
2008.07.30 |
b361e224b64110a90a2901d124819873 |
|
patched binutils 2.17 for Enterprise Linux 5 (EL5). Needed to link certain oracle software. | |
binutils-2.17.50.0.6-6.0.1.el5.x86_64.rpm |
2008.07.30 |
5abae24e77e02d74021a6e24172e07b9 |
|
patched binutils 2.17 for Enterprise Linux 5 (EL5). Needed to link certain oracle software. | |
binutils-2.17.50.0.6-9.0.1.el5.i386.rpm |
2009.07.30 |
6e7c6a89f54ee30709c44176a8a4d021 |
|
patched binutils 2.17 for Enterprise Linux 5 Update 3 (EL5U3). Needed to link certain oracle software. | |
binutils-2.17.50.0.6-9.0.1.el5.x86_64.rpm |
2009.07.30 |
c5d2f76dd3db549ead043bf5ff203891 |
|
patched binutils 2.17 for Enterprise Linux 5 Update 3 (EL5U3). Needed to link certain oracle software. | |
compat-binutils215-2.15.92.0.2-24.i386.rpm |
2008.05.21 |
01ffa95d708debbabb0ed33b190245f4 |
|
binutils 2.15 for Enterprise Linux 5 (EL5). Needed to link certain oracle software. | |
compat-libcwait-2.1-1.i386.rpm |
2008.05.21 |
2b735c3e51a8c0e1d7c624fbfedf3a3e |
|
compat-libcwait package for Enterprise Linux 5 (EL5). | |
compat-libstdc++-3.2-1.i386.rpm |
2008.08.13 |
f77f44a14cee79d7d9acdc454adf3dac |
|
libstdc++ compatibility package for EBS/Demantra | |
compat-libstdc++-egcs-1.1.2-1.i386.rpm |
2008.05.21 |
99775fcdfa60f6c609d4b5d51bd98a11 |
|
Older libstdc++ for Enterprise Linux 5 (EL5). | |
compat-oracle-el5-1.0-5.i386.rpm |
2008.05.23 |
ba5b78137935828e4ffe93959487ea17 |
|
compat-oracle package for Enterprise Linux 5 (EL5). | |
fonts-chinese-3.02-12.el5.noarch.rpm |
2009.02.19 |
c05922cc17c3cb412d8aac5cc11f4dcc |
|
fonts-chinese package for Oracle Enterprise linux 5. | |
openmotif21-2.1.30-11.EL5.i386.rpm |
2008.04.07 |
929781fe3ecd8c86a4aad4a3a514a780 |
|
OpenMotif 2.1 package built on and for Enterprise Linux 5 (EL5). This can also be used for RHEL5. | |
openmotif21-debuginfo-2.1.30-11.EL5.i386.rpm |
2008.04.07 |
728128be8b37578d91ce5d2ad0733f8a |
|
Debug information for OpenMotif 2.1 package for Enterprise Linux 5. You don't need to install this by default, only for debugging the openmotif library. | |
xorg-x11-libs-compat-6.8.2-1.EL.33.0.1.i386.rpm |
2008.04.07 |
b0edc3859334a60791cda6e24511d18b |
|
Compatibility libXtst.so needed to link certain oracle products. Built on and for Enterprise Linux5. Can also be used on RHEL5. |
我的系统中库与软件包依赖的安装顺序如文章顺序。
#rpm -ivh compat-binutils215-2.15.92.0.2-24.i386.rpm
安装上面的包后会报下面的错:
ERROR: ld.so: object '/lib/libcwait.so' from /etc/ld.so.preload cannot be preloaded: ignored.
解决办法:
#echo "" > /etc/ld.so.preload
#rpm -ivh compat-libcwait-2.1-1.i386.rpm
#rpm -ivh compat-libstdc++-3.2-1.i386.rpm
#rpm -ivh compat-libstdc++-egcs-1.1.2-1.i386.rpm
#rpm -ivh openmotif21-debuginfo-2.1.30-11.EL5.i386.rpm
#rpm -ivh compat-oracle-rhel4-1.0-5.i386.rpm
|
评论暂时关闭