Oracle安装


# Step 1: checking memory, swap space, disk space

grep MemTotal /proc/meminfo
#MemTotal:      4043368 kB
# >512MB
grep SwapTotal /proc/meminfo
#SwapTotal:     7365760 kB
# >1GB
df /tmp
# >400MB

# Step 2: checking packages

uname -mi
# x86_64 x86_64
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}  (%{ARCH})\n' \
              binutils compat-db control-center gcc gcc-c++ glibc glibc-common gnome-libs \
              libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio
#For 10g R2 (64-bit) on RHEL 4 x86_64, the document Oracle Database Installation Guide 10g Release 2 (10.2)
 for Linux x86-64 lists the following required package versions or higher:

#  binutils-2.15.92.0.2-10.EL4
#  compat-db-4.1.25-9
#  control-center-2.8.0-12
#  gcc-3.4.3-9.EL4
#  gcc-c++-3.4.3-9.EL4
#  glibc-2.3.4-2
#  glibc-common-2.3.4-2
#  gnome-libs-1.4.1.2.90-44.1
#  libstdc++-3.4.3-9.EL4
#  libstdc++-devel-3.4.3-9.EL4
#  make-3.80-5
#  pdksh-5.2.14-30
#  sysstat-5.0.5-1
#  xscreensaver-4.18-5.rhel4.2
yum -y install gcc gcc-c++ compat-db gnome-libs pdksh sysstat xscreensaver libXp-devel libXau-devel libXp glibc-devel glibc


# Step 3: checking the kernel parameters

#added the following lines to the /etc/sysctl.conf file and sysctl -p to use them immediately
#kernel.shmmax=2147483648 (for 4G RAM)
#kernel.sem=250 32000 100 128
#fs.file-max=65536

#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


# Step 4: user and dirs add

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -g oinstall -G dba oracle
passwd oracle
mkdir -p /data/app/oracle
mkdir -p /data/oradata
chown -R oracle:oinstall /data/app/oracle /data/oradata
chmod -R 777 /data/oradata

# Setting Shell Limits for the Oracle User
# add following lines into /etc/security/limits.conf
oracle          soft    nofile  4096
oracle          hard    nofile  63536
 

# Step 5: ~oracle/.bash_profile

export ORACLE_BASE=/data/app/oracle
export ORACLE_SID=dledu
#export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
#export PATH=.:${PATH}:$ORACLE_HOME/bin
#export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
#export LANG=zh_CN.GBK
export NLS_LANG="SIMPLIFIED CHINESE_CHINA".ZHS16GBK
#export LC_CTYPE=zh_CN.GB2312
#export LC_ALL=zh_CN
#umask 022


# Step 6: Install oracle

cpio -idvm<


# Step 7: Post-configuration
vi /etc/oratab

#
# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
dledu:/data/app/oracle/product/10.2.0/db_1:Y


cp oracled /etc/init.d/oracled
chkconfig add oracled
chkconfig oracled on


#X11Graphics...........
xhost local:oracle non-network local connections being added to access control list

#yum provides libXp.so.6

dbca
emctl start dbconsole


can not connect to xserver ":0.0"
su root
xhost +

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 1. 前言
    本文介绍在CentOS5.2下安装Oracle10g(10.2)的过程。本文参考了Oracle官方网站上提供的安装手册。Oracle提供的Linux版安装手册没有包括CentOS操作系统,所以参考其中有关Red Hat Enterprise Linux部分的内容进行安装和调试。大致过程相同,只需做略微改动,比如有些软件包的名字不一样等。
 
 2. 环境准备
 2.1. 操作系统的准备
 2.1.1. 操作系统的安装
    CentOS的安装比较简单,首先从[url]http://www.centos.org/[/url]上下载ISO文件。采用默认安装即可。
    为Oracle单独准备一个逻辑分区/oracle。
 2.1.2. 系统环境设置
  • 当CentOS操作系统安装完成后,需要将安装Oracle所必须的软件包逐一安装。
    参考Oracle安装文档关于Red Hat Enterprise Linux 4.0部分,所需的软件包如下,

Red Hat Enterprise Linux 4.0
CentOS5.2下对应的软件包
binutils-2.15.92.0.2-13.EL4
binutils-2.17.50.0.6-6.el5
compat-db-4.1.25-9
compat-db-4.2.52-5.1
compat-libstdc++-296-2.96-132.7.2
compat-libstdc++-33-3.2.3-61
control-center-2.8.0-12
control-center-2.16.0-16.el5
gcc-3.4.3-22.1.EL4
gcc-4.1.2-42.el5
gcc-c++-3.4.3-22.1.EL44
gcc-c++-4.1.2-42.el5
glibc-2.3.4-2.9
glibc-2.5-24
glibc-common-2.3.4-2.9
glibc-common-2.5-24
gnome-libs-1.4.1.2.90-44.1
libgnome-2.16.0-6.el5
libstdc++-3.4.3-22.1
libstdc++-4.1.2-42.el5
libstdc++-devel-3.4.3-22.1
libstdc++-devel-4.1.2-42.el5
make-3.80-5
make-3.81-3.el5
pdksh-5.2.14-30
ksh-20060214-1.7
sysstat-5.0.5-1
sysstat-7.0.2-1.el5
xscreensaver-4.18-5.rhel4.2
gnome-screensaver-2.16.1-8.el5
setarch-1.6-1
setarch-2.0-1.1
 
libXp-1.0.0-8.1.el5

 
    其中libXp-1.0.0-8.1.el5用于处理Oracle安装时Java的图形化界面,没有这个包安装的第一步就会报错,其余的包名字大致一致。  
    可以运行如下命令检查所需包是否都已安装。

# rpm -q binutils compat-db compat-libstdc++-33 control-center \
  gcc gcc-c++ glibc glibc-common libgnome libstdc++ \
  libstdc++-devel make ksh sysstat gnome-screensaver setarch libXp

    如果没有出现“not found”字样则表示已安装。

binutils-2.17.50.0.6-6.el5
compat-db-4.2.52-5.1
compat-libstdc++-33-3.2.3-61
control-center-2.16.0-16.el5
gcc-4.1.2-42.el5
gcc-c++-4.1.2-42.el5
glibc-2.5-24
glibc-common-2.5-24
libgnome-2.16.0-6.el5
libstdc++-4.1.2-42.el5
libstdc++-devel-4.1.2-42.el5
make-3.81-3.el5
ksh-20060214-1.7
sysstat-7.0.2-1.el5
gnome-screensaver-2.16.1-8.el5
setarch-2.0-1.1
libXp-1.0.0-8.1.el5

   
  • 修改系统内核参数。
    修改/etc/sysctl.conf文件,增加如下内容

# vi /etc/sysctl.conf
... ...
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
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

   

# chkconfig /etc/sysctl.conf

    修改/etc/security/limits.conf,增加如下内容。

# vi /etc/security/limits.conf
... ...
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

    修改/etc/pam.d/login文件,增加如下内容。

# vi /etc/pam.d/login
... ...
session required /lib/security/pam_limits.so
session required pam_limits.so

    修改vi /etc/profile文件,增加如下内容。

# vi /etc/profile
... ...
if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fi

   
 2.1.3. 用户设置、配置
  • 添加用户和用户组
    添加oinstall和dba用户组

# groupadd -g 501 oinstall
# groupadd -g 502 dba

    添加oracle用户

# useradd -g oinstall -G dba -u 501 -d /oracle oracle

    修改/oracle权限

# chown -R oracle:oinstall /oracle

    使用oracle用户登录,修改.profile文件。

# su – oracle
$ pwd
/oracle
$ vi ./.profile
 
# !/usr/bin/bash
 
umask 022
ORACLE_BASE=/oracle/app
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1
export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin
export PATH

    创建相应的目录

$ pwd
/oracle
$ mkdir app
$ mkdir data

   
 2.2. 数据库软件的准备
    从oracle官网上下载Oracle10g for linux版本。将其上传到服务器,并解压。修改其所有者和执行权限。
 
 3. 安装
    在解压后的目录database中,执行runInstaller命令即可进行安装。
    以oracle用户登录,如果是远程登录则需修改DISPLAY参数为你本机的IP。
    运行./runInstaller -ignoreSysPrereqs 进行安装。

$ ./runInstaller -ignoreSysPrereqs

    这里需要ignoreSysPrereqs选项,因为如果执行系统版本检查,CentOS是不被支持的,安装会自动停止。
    由于使用了ignoreSysPrereqs选项安装过程中的一些检查将不通过或不执行。可以不用理睬(因为该安装的软件包均已安装,内核参数均已修改)。
    安装过程采用默认安装即可,最后会提示用户以root身份执行两个脚本。
 

 

你可能感兴趣的:(Oracle安装)