采用OEL5.8 x64安装,安装过程,选反自定义选中图形界面,开发包,开发库,老的软件开发包等,一定要安装,否则在安装数据库过程中报缺包错误,便数据库的安装无法进行下去。
对于不明环境没有安装开发包与开发库的系统,可以采用如下方式安装,最全。
本文出自:http://koumm.blog.51cto.com
# yum groupinstall 'Development Tools'
# yum groupinstall 'Development Libraries'
# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils compat-libstdc++-33 compat-gcc-34-c++ elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel openmotif22 openmotif compat-db setarch libXp
binutils-2.17.50.0.6-20.el5 (x86_64)
compat-libstdc++-33-3.2.3-61 (x86_64)
compat-libstdc++-33-3.2.3-61 (i386)
compat-gcc-34-c++-3.4.6-4.1 (x86_64)
elfutils-libelf-0.137-3.el5 (x86_64)
elfutils-libelf-0.137-3.el5 (i386)
elfutils-libelf-devel-0.137-3.el5 (x86_64)
elfutils-libelf-devel-static-0.137-3.el5 (x86_64)
gcc-4.1.2-52.el5 (x86_64)
gcc-c++-4.1.2-52.el5 (x86_64)
glibc-2.5-81 (x86_64)
glibc-2.5-81 (i686)
glibc-common-2.5-81 (x86_64)
glibc-devel-2.5-81 (x86_64)
glibc-devel-2.5-81 (i386)
glibc-headers-2.5-81 (x86_64)
kernel-headers-2.6.18-308.el5 (x86_64)
ksh-20100621-5.el5 (x86_64)
libaio-0.3.106-5 (x86_64)
libaio-0.3.106-5 (i386)
package libaio-devel is not installed
libgcc-4.1.2-52.el5 (x86_64)
libgcc-4.1.2-52.el5 (i386)
libgomp-4.4.6-3.el5.1 (x86_64)
libgomp-4.4.6-3.el5.1 (i386)
libstdc++-4.1.2-52.el5 (x86_64)
libstdc++-4.1.2-52.el5 (i386)
libstdc++-devel-4.1.2-52.el5 (x86_64)
make-3.81-3.el5 (x86_64)
package sysstat is not installed
package unixODBC is not installed
package unixODBC-devel is not installed
package openmotif22 is not installed
package openmotif is not installed
package compat-db is not installed
setarch-2.0-1.1 (x86_64)
package libXp is not installed
# mount /dev/cdrom /mnt
# cd /mnt/Server
rpm -ivh compat-db-4.2.52-5.1.i386.rpm compat-db-4.2.52-5.1.x86_64.rpm
rpm -ivh libaio-devel-0.3.106-5.x86_64.rpm libaio-devel-0.3.106-5.i386.rpm
rpm -ivh sysstat-7.0.2-11.el5.x86_64.rpm numactl-devel-0.9.8-12.0.1.el5_6.x86_64.rpm
rpm -ivh unixODBC-2.2.11-10.el5.x86_64.rpm unixODBC-devel-2.2.11-10.el5.x86_64.rpm unixODBC-libs-2.2.11-10.el5.x86_64.rpm
rpm -ivh unixODBC-2.2.11-10.el5.i386.rpm unixODBC-devel-2.2.11-10.el5.i386.rpm unixODBC-libs-2.2.11-10.el5.i386.rpm
rpm -ivh libXp-1.0.0-8.1.el5.i386.rpm libXp-1.0.0-8.1.el5.x86_64.rpm
rpm -ivh openmotif22-2.2.3-20.x86_64.rpm openmotif-2.3.1-6.el5.x86_64.rpm
rpm -ivh compat-db-4.2.52-5.1.i386.rpm compat-db-4.2.52-5.1.x86_64.rpm
rpm -ivh libaio-devel-0.3.106-5.x86_64.rpm libaio-devel-0.3.106-5.i386.rpm
rpm -ivh sysstat-7.0.2-12.0.1.el5.x86_64.rpm numactl-devel-0.9.8-12.0.3.el5_6.x86_64.rpm
rpm -ivh unixODBC-2.2.11-10.el5.x86_64.rpm unixODBC-devel-2.2.11-10.el5.x86_64.rpm unixODBC-libs-2.2.11-10.el5.x86_64.rpm
rpm -ivh unixODBC-2.2.11-10.el5.i386.rpm unixODBC-devel-2.2.11-10.el5.i386.rpm unixODBC-libs-2.2.11-10.el5.i386.rpm
rpm -ivh libXp-1.0.0-8.1.el5.i386.rpm libXp-1.0.0-8.1.el5.x86_64.rpm
rpm -ivh rpm -ivh openmotif22-2.2.3-20.x86_64.rpm openmotif-2.3.1-7.2.el5.x86_64.rpm
# wget http://utopia.knoware.nl/~hlub/uck/rlwrap/rlwrap-0.37.tar.gz
# tar zxvf rlwrap-0.37.tar.gz
# cd rlwrap-0.37
# ./configure
# make && make install
注: 如安装rlwrap会提示这个错误信息,本例不会出现如下故障现像。
You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/ ) to build
this program!
这个时候,需要安装
libtermcap-devel-2.0.8-46.1.i386.rpm
readline-devel-5.1-3.el5.i386.rpm
创建oinstall,dba组和oracle用户.
创建用户组和用户的命令如下(用root身份):
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
mkdir -p /u01/app/oracle/product/10.2.0/db_1
chmod -R 775 /u01/app
chown -R oracle:oinstall /u01
# vi /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 359670
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
# sysctl -p
内核参数配置说明:
kernel.shmall = 2097152 # 系统可以使用的共享内存总页数,缺省值就是2097152。
kernel.shmmax = 2147483648 # 单个共享内存段的最大值,字节为单位, 此例为2GB。
kernel.shmmni = 4096 # 共享内存段的最大默认数量
# 最大共享内存空间 = kernel.shmall * kernel.shmmni = 2097152*4K = 8G
# 由此可以计算操作系统最大共享内存空间并由上面两个参数决定,例如一个共享内存为16G的系统,16G/kernel.shmmni(4K) = kernel.shmall 需要增大kernel.shmall
# 由于shmmax本例为2G大小,在分配共享内存段的时候会分配多个,例如 2G+2G+2G等这样分配,不会超过最大共享内存空间,建议分配小于共享内存最大值,可以避免过多的创建共享内存段。
# 对于Oracle数据库,SGA就是使用共享内存段空间,SGA的大小要小于最大共享内存空间,否则会报ORA-27102: out of memory,这时就需要查看以上参数是否合理。
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 /lib64/security/pam_limits.so
EOF
# vi /etc/hosts
192.168.14.180 node1
cat >> /etc/profile << EOF
if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
EOF
# su - oracle
cat >> /home/oracle/.bash_profile << EOF
export EDITOR=vi
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=\$ORACLE_HOME/bin:\$PATH
export NLS_LANG="Simplified Chinese_china.ZHS16GBK"
export LANG=en_US
export LC_ALL=en_US
export LD_LIBRARY_PATH=/lib:/usr/lib:\$ORACLE_HOME/lib
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
umask 022
EOF
source .bash_profile
# mv 10201_database_linux_x86_64.cpio.gz /u01/app/
# mv p8202632_10205_Linux-x86-64.zip /u01/app/
# gunzip 10201_database_linux_x86_64.cpio.gz
# cpio -idmv < 10201_database_linux_x86_64.cpio
# unzip p8202632_10205_Linux-x86-64.zip
# oracle安装包解压在/u01/app/database下
# oracle补丁包解压在/u01/app/Disk1下
# chown -R oracle:oinstall /u01/app/database
# 对于服务器在远程机房里的情况下的安装,以前运行过vncserver,配置过密码.
# vi /root/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
# vncserver :1
# vncserver -kill :1 关闭桌面号:1
# xhost +
access control disabled, clients can connect from any host
$ su - oracle
$ cd /u01/Oracle/database
$ ./runInstaller
# Redhat AS5下安装,可采用如下方式忽略OS版本检查。
$ ./runInstaller -ignoresysprereqs
最后要在root执行以下两条脚本
/u01/app/oracle/oraInventory/orainstRoot.sh
/u01/app/oracle/product/10.2.0/db_1/root.sh
$ cd /u01/app/Disk1
$ ./runInstaller
安装过程中提示root下执行如下脚本
/u01/app/oracle/product/10.2.0/db_1/root.sh
$ netca
# 参数一律默认即可
$ dbca
# 进行数据库的创建,下面列出的是一些注意事项
# 选择gernel purpose,在SID和全局名称中,选择你在.bash_profile中创建的SID.
# 数据库的字符集选项中选择ZHS16GBK, Session连接数调大,redolog调大。其它默认OK,完成.
#开机自启动采用rc.local启动方式,没有配置成服务方式,关闭数据库还是手动执行的好。
$ vi /etc/oratab
#把最后的N改成Y (默认是N)
orcl:/u01/app/oracle/product/10.2.0/db_1:Y
# sed -i 's/:N/:Y/g' /etc/oratab
cat >> /etc/rc.local << EOF
# Oracle service start
su - oracle -c "lsnrctl start"
su - oracle -c "dbstart"
EOF
oracle打补丁后EM不能启动的问题解决
Oracle 10.2.0.4(5)因为一个证书过期,导致2011.1.1日以后EM不能启动,解决方案是应用补丁p8350262_10204_Generic.zip或者p8350262_10205_Generic.zip
$ emctl stop dbconsole
$ unzip p8350262_10204_Generic.zip
$ cd 8350262
$ /u01/app/oracle/product/10.2.0/db_1/OPatch/opatch apply
经过测试,对于新安装的Oracle 10g数据库,必须要先打以上补丁,然后再删除EM,再重建EM就可以了。EM将正常启动。
说明: 必须按以下顺序进行。
# rpm -ivh ttfonts-zh_CN-2.14-6.noarch.rpm
常用以下两个命令,在系统空闲的时侯执行快:
$ emca -deconfig dbcontrol db -repos drop 删除Database Control并同时删除em资料库
$ emca -config dbcontrol db -repos create 创建em资料库并同时配制Database Control
https://192.168.14.180:1158/em/console/logon/logon
说明:该脚本需要在运行并登录之后才能执行。
/home/oracle/config.sh
#!/bin/bash
source /home/oracle/.bash_profile
cd $ORACLE_HOME/jdk/jre/lib/
mv font.properties font.properties.bak
cp font.properties.zh_CN.Redhat font.properties
cd $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs/
rm *.gif
cd $ORACLE_HOME/jre/1.4.2/lib/
mv font.properties font.properties.bak
cp font.properties.zh_CN.Redhat font.properties
cd $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs/
rm -rf *.gif
cd $ORACLE_HOME/javavm/lib/ojvmfonts/
mv font.properties font.properties.bak
cp font.properties.zh_CN.Redhat font.properties
$ emctl stop dbconsole
$ emctl start dbconsole
采用OEL5.X X64安装,安装过程中只选中图形界面,没有安装开发包,开发库,老的软件开发包等情况下的安装由于缺少相关包,安装过程会出错。
# yum groupinstall 'Development Tools'
# yum groupinstall 'Development Libraries'
# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils compat-libstdc++-33 compat-gcc-34-c++ elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel openmotif22 openmotif compat-db setarch libXp
binutils-2.17.50.0.6-14.el5 (x86_64)
compat-libstdc++-33-3.2.3-61 (x86_64)
compat-libstdc++-33-3.2.3-61 (i386)
compat-gcc-34-c++-3.4.6-4.1 (x86_64)
elfutilsos-libelf-0.137-3.el5 (x86_64)
elfutils-libelf-0.137-3.el5 (i386)
elfutils-libelf-devel-0.137-3.el5 (x86_64)
elfutils-libelf-devel-static-0.137-3.el5 (x86_64)
gcc-4.1.2-50.el5 (x86_64)
gcc-c++-4.1.2-50.el5 (x86_64)
glibc-2.5-58 (x86_64)
glibc-2.5-58 (i686)
glibc-common-2.5-58 (x86_64)
glibc-devel-2.5-58 (x86_64)
glibc-devel-2.5-58 (i386)
glibc-headers-2.5-58 (x86_64)
package kernel-headers is not installed
ksh-20100202-1.el5_5.1 (x86_64)
libaio-0.3.106-5 (x86_64)
libaio-0.3.106-5 (i386)r
libaio-devel-0.3.106-5 (x86_64)
libgcc-4.1.2-50.el5 (x86_64)
libgcc-4.1.2-50.el5 (i386)
libgomp-4.4.4-13.el5 (x86_64)
libgomp-4.4.4-13.el5 (i386)
libstdc++-4.1.2-50.el5 (x86_64)
libstdc++-4.1.2-50.el5 (i386)
libstdc++-devel-4.1.2-50.el5 (x86_64)
make-3.81-3.el5 (x86_64)
sysstat-7.0.2-3.el5_5.1 (x86_64)
unixODBC-2.2.11-7.1 (x86_64)
unixODBC-devel-2.2.11-7.1 (x86_64)
openmotif22-2.2.3-18 (x86_64)
openmotif-2.3.1-5.el5_5.1 (x86_64)
compat-db-4.2.52-5.1 (x86_64)
setarch-2.0-1.1 (x86_64)
libXp-1.0.0-8.1.el5 (x86_64)
libXp-1.0.0-8.1.el5 (i386)
由于操作系统没有安装开发包工具等,在安装oracle10g时会出现如下错误。
执行netca或dbca时, "UnsatisfiedLinkError exception loading native library: njni10" 错误解决。
glibc和glibc-devel包32bit版本、64bit版需要安装:
# rpm -Uvh glibc-*.i686.rpm glibc-devel-*.i386.rpm
# rpm -Uvh compat-libstdc++-33-3.2.3-61*.i386.rpm
安装完32bit的glibc和glibc-devel后, 再对Oracle进行relink:
$ $ORACLE_HOME/bin/relink all
本文转自 koumm 51CTO博客,原文链接:http://blog.51cto.com/koumm/1580315,如需转载请自行联系原作者