CentOS 5.6 安装Oracle 10g
1、安装环境需求
1.1-以root用户登陆
su -
1.2-RAM需求
On Linux X86:
至少1GB内存
grep MemTotal /proc/meminfo
Swap与RAM关系
On Linux X86-64
至少4GB内存
grep MemTotal /proc/meminfo
Swap与RAM关系
查看Swap大小
grep SwapTotal /proc/meminfo
1.3-磁盘空间需求
/tmp 不能少于1GB
df –h /tmp
查看磁盘空间
df -h
1.4-RPM包需求
On Linux X86:
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-common-2.5
glibc-devel-2.5
glibc-headers-2.5
kernel-headers-2.6.18
ksh-20060214
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.2
libgomp-4.1.2
libstdc++-4.1.2
libstdc++-devel-4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11(32 bit)
unixODBC-devel-2.2.11(32 bit)
pdksh-5.2.14
numactl-0.9.8
libXp-1.0.0
libXp-devel-1.0.0
libXau-devel-1.0.1
On Linux X86-64:
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3(32 bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
expat-1.95.8
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24(32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-headers-2.5
kernel-headers-2.6.18
ksh-20060214
libaio-0.3.106
libaio-0.3.106(32 bit)
libaio-devel-0.3.106
libaio-devel-0.3.106(32 bit)
libgcc-4.1.2
libgcc-4.1.2(32 bit)
libgomp-4.1.2
libstdc++-4.1.2
libstdc++-4.1.2(32 bit)
libstdc++-devel-4.1.2
make-3.81
sysstat-7.0.2
unixODBC-2.2.11(32 bit)
unixODBC-2.2.11(64 bit)
unixODBC-devel-2.2.11(64 bit)
pdksh-5.2.14
numactl-0.9.8(64 bit)
检测包是否安装
rpm –q package_name
在线下载安装包
yum –y install package_name
yum -y install binutils compat-libstdc++-33 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 pdksh numactl libXp libXp-devel libXau-devel
vi /etc/profile
按下i键进入编辑模式,修改之后,按ESC进入命令模式,输入”:wq”保存退出;
1.6-创建用户和用户组
创建用户组:oinstall,dba,oper,asmadmin,asmdba,asmoper
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
创建用户:Oracle,
/usr/sbin/useradd -g oinstall -G dba,asmdba,oper oracle
passwd oracle
1.7-修改oracle用户资源限制
修改/etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
在/etc/pam.d/login增加下列参数
session required pam_limits.so
在/etc/profile增加下列参数
if [ $USER = “oracle” ] ; then
if [$SHELL = “/bin/ksh” ]; then
ulimit –p 16384
ulimit –n 65536
else
ulimit –u 16384 –n 65536
fi
umask 022
fi
在/etc/csh.login增加下列参数
if ( $USER == “oracle” ) then
limit maxproc 16384
limit descriptors 65536
umask 022
endif
1.8-配置内核参数
修改/etc/sysctl.conf
kernel.core_uses_pid = 1
kernel.shmall = 2097152
kernel.shmmax = 536870912
fs.suid_dumpable = 1
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 1024 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
以上参数为最小值需求,如果实际值大于最小值,则以实际值为准。
运行命令使参数生效
/sbin/sysctl –p
运行命令,确认参数已生效
/sbin/sysctl –a
1.9-创建目录及分配权限
mkdir -p /oracle
chown -R oracle:oinstall /oracle
chmod -R 775 /oracle
1.10-配置用户环境变量
修改系统版本信息:/etc/RedHat-release
将CentOS release 5 (final)修改成
Red Hat Enterprise Linux AS release 3 (Taroon)
(oracle 10不支持5)
修改/etc/hosts参数,增加
192.168.56.101 localhost.localdomain localhost
192.168.56.101为机器的静态IP
关闭SELINUX模式
编辑/etc/selinux/config
修改SELINUX= disabled
切换到oracle用户
su – oracle
修改/home/oracle/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
ORACLE_BASE=/oracle
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_HOME
ORACLE_SID=vbora10g
export ORACLE_SID
NLS_LANG=american_america.UTF8
export NLS_LANG
LANG=en_US
export LANG
TNS_ADMIN=$ORACLE_HOME/network/admin
export TNS_ADMIN
PATH=$ORACLE_HOME/bin:$ORACLE_BASE/common/oracle/bin:$PATH:$HOME/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jdk/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export CLASSPATH
umask 022
保存退出。
载入环境变量:
source .bash_profile