读书人

Redhat Linux5装配Oracle 11g 数据库

发布时间: 2012-07-08 17:43:43 作者: rapoo

Redhat Linux5安装Oracle 11g 数据库

Oracle目前最新的版本是11g R2版本,网上不少安装介绍都是9i或者10g的,我按照介绍RHEL5.5上安装Oracle 11gR2总是有问题,之后看官方文档介绍了,在光盘的doc目录下有。

Oracle 11g R2数据库安装硬件配置要求:

最小内存 1 GB of RAM

虚拟内存容量

硬盘空间要求

?

Installation TypeRequirement for Software Files (GB)Enterprise Edition3.95Standard Edition

3.88


Installation TypeRequirement for Data Files (GB)Enterprise Edition1.7Standard Edition1.5

Oracle 11g R2数据库支持的操作系统

Oracle Database 11g Release 2 (11.2) for Linux x86:

Asianux 2.0

Asianux 3.0

Oracle Enterprise Linux 4.0 Update 7 or later

Oracle Enterprise Linux 5.0

Red Hat Enterprise Linux 4.0 Update 7 or later

Red Hat Enterprise Linux 5.0

SUSE Linux Enterprise Server 10.0

SUSE Linux Enterprise Server 11.0

在VMware上安装Redhat,硬盘分的大一点,我的是30G.

看我的另一篇文章《VMware6.5下修改linux(Redhat5)的分辨率》

http://chuanheng.iteye.com/admin/blogs/1173835

直接把oracle的安装包复制(ctrl+c;ctrl+v)到虚拟机的redhat linux中。

?

需要的软件包支持:

这里只列出Asianux 3, Oracle Enterprise Linux 5.0, and Red Hat Enterprise Linux 5.0的要求,检查一下系统是否安装过这些包,没有的话在Redhat的光盘上都有。

按Ctrl+f在Redhat的安装光盘上搜索,双击安装,都试一试,避免以后的麻烦。

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
unixODBC-devel-2.2.11

创建Oracle用户

The Oracle Inventory group (typically, oinstall)

The OSDBA group (typically, dba)

The Oracle software owner (typically, oracle)

The OSOPER group (optional. Typically, oper)

# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
# /usr/sbin/useradd -g oinstall -G dba oracle
# passwd oracle

修改内核参数

修改?/etc/sysctl.conf 文件,加上如下参数

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 -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

修改用户配置文件

修改/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

安装目录配置

# mkdir -p /u01/
# chown -R oracle:oinstall /u01/
# chmod -R 775 /u01/

修改用户bash shell

$ vi .bash_profile

增加

这里要根据自己的安装目录而改变

export ORACLE_BASE=/u01/app
export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.1.0/db_1/
export ORACLE_SID=liusuping --新建的数据库名称
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin

startx启动图形界面进入安装目录

配置图形界面

$ xhost fully_qualified_remote_host_name

$ xhost localhost

切换安装用户

这里理由为关键,不能使用“su oracle'切换用户,而应该先注销,再用oracle用户名登录系统!!!

执行安装

将oracle的安装包解压,在得到的database目录中:

./runInstaller

安装完毕后用root用户执行两个脚本

[root@c app]# /u01/app/oraInventory/orainstRoot.sh
更改权限/u01/app/oraInventory.
添加组的读取和写入权限。
删除全局的读取, 写入和执行权限。

更改组名/u01/app/oraInventory 到 oinstall.
脚本的执行已完成。

[root@c app]# /u01/app/oracle/product/11.2.0/dbhome_2/root.sh?
Running Oracle 11g root.sh script...

The following environment variables are set as:
??? ORACLE_OWNER= oracle
??? ORACLE_HOME=? /u01/app/oracle/product/11.1.0/dbhome_2

Enter the full pathname of the local bin directory: [/usr/local/bin]:?
?? Copying dbhome to /usr/local/bin ...
?? Copying oraenv to /usr/local/bin ...
?? Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@c app]#

安装完毕

?

读书人网 >其他数据库

热点推荐