Chinaunix首页 | 论坛 | 博客
  • 博客访问: 20407
  • 博文数量: 5
  • 博客积分: 336
  • 博客等级: 二等列兵
  • 技术积分: 60
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-17 15:31
文章分类
文章存档

2010年(5)

最近访客

分类: Oracle

2010-07-27 11:24:22

在linux平台下安装oracle11gR1数据库

本人声明,以下内容是参考网络资料编写的,在虚拟机下测试的,如果需要请参考网络资源。请尊重他人劳动结晶。

在虚拟机平台上安装oracle 11gR132位版本,虚拟机版本为:Vmare workstation 6.0.3 build版本。本文分为两个部分,第一部分为设置主机,第二部分为安装oracle 11gR1版本。

第一部分,设置主机即安装操作系统。主要安装Linux.Enterprise.Server.v10.SP2.x86(但是在实际应用中是64位的小型机,我只能用32位和32位的oracle11gR1来测试)。

1.新建一台虚拟机,主要是设置磁盘空间大小,本人在磁盘设置了30G大小,主要考虑在安装oracle 11gR1时有足够的空间。在安装过程设置的磁盘分区为如下表格:

分区类型

分区名

文件系统

Size

Start cylinder

Size End

主分区

Swap

Swap

0

 

+2G

 

/

Ext3

默认

 

+8G

 

/opt

Ext3

默认

 

+10G

扩展分区

-

Ext3

默认

默认

默认

 

/home

Ext3

默认

 

+5G

 

/tmp

Ext3

默认

 

+5G

这个表格可以根据实际情况去规划。

2.在安装系统时,最好选择英文的,本人在中文字符集下未做过测试,可以参考CU论坛上介绍的。

2.1.安装SUSE操作系统,并确保安装“C/C++Compiler and Tools”软件包。在开发栏目中,本人还设置的防火墙,和Ipv6为不可用。

2.2.安装所需软件包,安装orarun软件包,就是软件安装是的oracle 数据库包,省去很多设置。在数据库栏目中

2.3.Oracle用户设置

orarun软件包安装时,会自动建立名为oracle的用户,和一个oinstall组。我们只需要将该用户设置为enable,把shell/bin/false改为/bin/bash。而且orarun软件包将ORACLE_HOME文件夹自动生成,减少了很多麻烦。

2.22.3本人没按照此步骤来安装的,本人是安装安装SUSE时,在创建用户的时用图形界面来安装的)或者在系统安装之后用命令来添加oracle安装用户和用户组,命令方式为:这些都是用root用户去创建的。

创建dba/oinstall:

~# groupadd dba

~# groupadd oinstall

创建oracle用户

~#useradd -g oinstall -u 802 -md /home/oracle -s /bin/bash oracle

修改下oracle用户的密码。

3.安装好系统之后,请检查系统安装“C/C++Compiler and Tools”软件包各个组件。主要是下列组件:

binutils-2.17.50.0.6-2.el5
compat-libstdc++-33-3.2.3-61
elfutils-libelf-0.125-3.el5
elfutils-libelf-devel-0.125
glibc-2.5-12
glibc-common-2.5-12
glibc-devel-2.5-12
gcc-4.1.1-52
gcc-c++-4.1.1-52
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.1-52
libstdc++-4.1.1
libstdc++-devel-4.1.1-52.e15
make-3.81-1.1
sysstat-7.0.0
unixODBC-2.2.11
unixODBC-devel-2.2.11

可以用命令来查看各个软件包是否安装上,如:rpm –aq |grep make等等。

其实在安装“C/C++Compiler and Tools”软件包时候,并没有把下列组件安装好,

sysstat-7.0.0
unixODBC-2.2.11
unixODBC-devel-2.2.11

3个软件包需要我们手动添加。

4.root用户去创建oracle安装目录和设置系统各个环境。主要是配置下列5个文件

主要是创建oracle目录和oraInventory两个目录

~#mkdir /opt/oracle

~#mkdir /opt/oraInvertory

并要设置目录属主

~#chown –R oracle.oinstall /opt/oracle

~#chown –R oracle.oinstall /opt/oraInvertory

~#chmod –R 755 /opt/oracle

~#chmod –R 755 /opt/oraInvertory

如果不修改这些属性会造成安装oracle时没有权限写入。

4.1设置.profile//此文件是oracle的环境变量设置。

# Sample .profile for SuSE Linux

# rewritten by Christian Steinruecken

#

# This file is read each time a login shell is started.

# All other interactive shells will only read .bashrc; this is particularly

# important for language settings, see below.

 

test -z "$PROFILEREAD" && . /etc/profile

 

# Most applications support several languages for their output.

# To make use of this feature, simply uncomment one of the lines below or

# add your own one (see /usr/share/locale/locale.alias for more codes)

#

#export LANG=de_DE.UTF-8    # uncomment this line for German output

#export LANG=fr_FR.UTF-8    # uncomment this line for French output

#export LANG=es_ES.UTF-8    # uncomment this line for Spanish output

 

 

# Some people don't like fortune. If you uncomment the following lines,

# you will have a fortune each time you log in ;-)

 

#if [ -x /usr/bin/fortune ] ; then

#    echo

#    /usr/bin/fortune

#    echo

#fi

ORACLE_SID=ora

ORACLE_BASE=/opt/oracle

ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1

export ORACLE_SID ORACLE_BASE ORACLE_HOME

export TNS_ADMIN=$ORACLE_BASE/product/11.1.0/db_1

PATH=$PATH:/$ORACLE_HOME/bin:$HOME/bin

export PARH

添加红色部分。请根据实际情况更改。

4.2主要是设置/etc/security/limits.conf文件。

设置Shell Limits(系统资源限制),提高软件的运行效率

#                

#

 

#*               soft    core            0

#*               hard    rss             10000

#@student        hard    nproc           20

#@faculty        soft    nproc           20

#@faculty        hard    nproc           50

#ftp             hard    nproc           0

#@student        -       maxlogins       4

oracle                         soft           nofile                  1024

oracle                         hard          nofile                  65536

oracle                         soft          nproc                 2047

oracle                         hard          nproc                 16384

 

# End of file

添加红色部分。

4.3/etc/pam.d/login文件中加入下列行,如果里面没有的话:

session required /lib/security/pam_limits.so//百度上部分有些文档介绍加入此句,本人经过测试加入此句后造成Telnet无法方法,如果有开Telnet的话,最好不要添加。

session required pam_limits.so

4.4/etc/profile修改profile文件。

 

if [ $USER = "oracle" ]; then

         if [ $SHELL = "/bin/ksh" ]; then

                   ulimit -p 16384

                   ulimit -n 65536

         else

                   ulimit -u 16384 -n 65536

         fi

fi

4.5sysctl.conf文件中加入下列:
kernel.shmall = 2097152

kernel.shmmax = 2147483648 -- (以字节为单位,物理内存数量*1024*1024*2 为内存的2)

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

net.core.rmem_max=8388608

net.core.wmem_default=262144

net.core.wmem_max=262144 

保存退出

sysctl -p使其生效

~# sysctl -a | grep kernel

添加boot.sysctl服务,将boot.sysctl服务添加到系统启动时执行的组里。

~# insserv boot.sysctl

检查是否添加成功。

~# chkconfig | grep boot.sysctl

显示为:boot.sysctl               on

到此第一部分结束。

第二部分,安装oracle11gR1数据库

1.       在图形界面下切换为oracle用户,请勿在终端模式下直接用

~#su – oracle

这样会造成无法安装oracle数据库。

2.       oracle用户登录,并上传oacle11gR1软件包,如果用其他用户上传oracle软件包,请更改oracle软件包属性。上传到/opt/oracle目录。

用命令解压oracle数据库软件包。

~>cd /opt/oracle

~>unzip linux_11gR1_database.zip

之后可以在当前目录下database目录。进入database目录之后可以看到数据库解压之后各个文件。

3.       安装oracle数据库

~>./runInstaller可以看到如图界面:

之后就可以根据需求进行安装了。之后步骤请参考CU论坛

http://blog.chinaunix.net/u/27474/showart_209366.html

http://www.cnblogs.com/zhou__zhou/archive/2009/06/23/oracle_install.html

http://gohands.javaeye.com/blog/372428

本人学习之用。

 

阅读(1798) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:shell笔记(转载)

给主人留下些什么吧!~~