本文将为您介绍如何在Fedora17 64bit系统上安装OracleDatabase 11g Release 2 64bit数据库,本文假设您已经安装了Fedora17 64bit操作系统,交换分区为2G,Linux安全已经禁止,并安装了以下软件组:
- Gnome Desktop Environment
- Editors
- Graphical Internet
- Development Libraries
- Development Tools
- Legacy Software Development
- Server Configuration Tools
- Administration Tools
- Base
- Fonts
- Legacy Fonts
- Hardware Support
- Input Methods
- Legacy Software Support
- System Tools
- X Windows System
按以下步聚安装:
- 下载数据库软件压缩包
- 解压压缩包
- 修改Hosts文件
- 设置内核参数
- 配置
- 安装
- 完成安装
1. 下载数据库软件压缩包:
· OracleDatabase 11g Release 2 (11.2) Software
解压压缩包:
unziplinux.x64_11gR2_database_1of2.zip
unziplinux.x64_11gR2_database_2of2.zip
两个压缩包会解压到同一个目录:database
2. 修改Hosts文件
打开/etc/hosts文件,加入服务器名称,如下:
例如:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.0.191 fedora17.localdomain fedora17
3. 设置内核参数:
Oracle推荐最低参数设置如下:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
可通过如下命令查看当前系统内核参数:
/sbin/sysctl -a | grep
打开”/etc/sysctl.conf”配置文件,增加或修改已有内核参数,详细如下:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
如果您不想重启系统,可通过下面命令修改当前系统内核参数:
/sbin/sysctl –p
增加如下信息到”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
禁止linux安全需修改”/etc/selinux/config”文件,修改如下:
SELINUX=disabled.
如果在安装之后修改Linux安全,需要重启系统,建议在安装之前修改。
4. 配置
安装如下包:
#yum install binutils
#yum install compat-libstdc++-33
yum install compat-libstdc++-33.i686
#yum install elfutils-libelf
yum install elfutils-libelf-devel
#yum install gcc
#yum install gcc-c++
#yum install glibc
#yum install glibc.i686
#yum install glibc-common
#yum install glibc-devel
#yum install glibc-headers
yum install glibc-devel.i686
yum install ksh
yum install libaio
yum install libaio.i686
yum install libaio-devel
yum install libaio-devel.i686
#yum install libgcc
#yum install libgcc.i686
#yum install libstdc++
yum install libstdc++.i686
#yum install libstdc++-devel
#yum install make
#yum install numactl
yum install numactl-devel
yum install sysstat
yum install unixODBC
yum install unixODBC.i686
yum install unixODBC-devel
yum install unixODBC-devel.i686
创建新的用户组和用户,以供数据库安装。
groupadd oinstall
groupadd dba
groupadd oper
groupadd asmadmin #此用户将不会用到
useradd -g oinstall -G dba,oper,asmadmin oracle
passwd oracle
根据情况创建安装目录:
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
用root登录,并执行下面命令:
xhost +
修改系统发行信息,Oracle只识别一些商业linux系统,以下改为RedHat5, 修改”/etc/redhat-release”文件,并替换”Fedora17…”等信息为:
redhat release 5
使用oracle用户登录,并在.bash_profile中增加如下:
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=fedora17.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi