> 数据库 > Oracle >

Centos 5.5安装oracle 10G数据库

操作系统版本CentOS release 5.5 (Final) 64bit
数据库版本Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 64bit

一、依赖包
如果在安装操作系统时,没有安装以下的依赖包,可以用yum yum groupinstall命令再次安装
yum groupinstall “Administration Tools”
yum groupinstall “Base”
yum groupinstall “Development Libraries”
yum groupinstall “Development Tools”
yum groupinstall “Editors”
yum groupinstall “GNOME Desktop Environment”
yum groupinstall “Graphical Internet”
yum groupinstall “Legacy Software Development”
yum groupinstall “Legacy Software Support”
yum groupinstall “Network Server”
yum groupinstall “Server Configuration Tools”
yum groupinstall “System Tools”
yum groupinstall “Text-based Internet”
yum groupinstall “X Window System”

libXp.i386 图形依赖包,如果不安装会导致系统报错libawt.so libxp.so不能找到
yum install -y libXp.i386

二、修改系统配置文件
1、/etc/hosts
192.168.0.1 oracle10g.localdomain oracle10g

2、/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.wmem_max=262144

执行sysctl -p,使内核参数生效。

3、/etc/security/limits.conf

*               soft    nproc   2047
*               hard    nproc   16384
*               soft    nofile  1024
*               hard    nofile  65536

三、oracle用户、组、环境
groupadd oinstall
groupadd dba
groupadd oper

useradd -g oinstall -G dba oracle
passwd oracle

编辑oracle用户环境变量
vim /home/oracle/.bash_profile

# Oracle Settings
# Oracle Settings
export ORACLE_BASE=/home/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=orcl
export ORACLE_TERM=xterm
export TMP=/tmp
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
 
if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fi

四、修改标识
/etc/redhat-release
CentOS release 5.5 (Final) => redhat-4
为的是骗过oracle安装检查,安装完oracle别忘记改回来!

五、下载、解压
su – oracle
wget 10201_database_linux_x86_64.cpio.gz
gzip -dc 10201_database_linux_x86_64.cpio.gz | cpio -idmv

六、安装
1、GUI模式

su – oracle
cd /home/oracle/database
./runInstaller


2、silent模式

su – oracle
cd /home/oracle/database

安装数据库软件
./runInstaller -silent -responseFile /home/oracle/database/response/enterprise.rsp ORACLE_HOME=/home/oracle/product/10.2.0/db_1 ORACLE_HOME_NAME=orcl n_configurationOption=3

以root权限执行以下两条语句
/home/oracle/oraInventory/orainstRoot.sh
/home/oracle/product/10.2.0/db_1/root.sh

建立数据库实例orcl
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname ORCL -sid ORCL -responseFile NO_VALUE -sysPassword passwd -systemPassword passwd -characterSet AL32UTF8 -memoryPercentage 70

删除数据库实例orcl
dbca -silent -deleteDatabase -sourceDB ORCL

七、修改数据库运行脚本、建立自启动
sed -i “s/\/ade\/vikrkuma_new\/oracle/\$ORACLE_HOME/g” /home/oracle/product/10.2.0/db_1/bin/dbstart

vim /etc/oratab
ORCL:/home/oracle/product/10.2.0/db_1:N
=>
ORCL:/home/oracle/product/10.2.0/db_1:Y

echo “su – oracle -c dbstart” >> /etc/rc.local

dbstart




(责任编辑:IT)