Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9167756
  • 博文数量: 1669
  • 博客积分: 16831
  • 博客等级: 上将
  • 技术积分: 12594
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-25 07:23
个人简介

柔中带刚,刚中带柔,淫荡中富含柔和,刚猛中荡漾风骚,无坚不摧,无孔不入!

文章分类

全部博文(1669)

文章存档

2023年(4)

2022年(1)

2021年(10)

2020年(24)

2019年(4)

2018年(19)

2017年(66)

2016年(60)

2015年(49)

2014年(201)

2013年(221)

2012年(638)

2011年(372)

分类: Oracle

2011-12-15 17:18:28

redhat linux fedora core 5 成功安装 Oracle 10g   

2010-07-23 13:05:26|  分类: 默认分类 |  标签: |字号 

  redhat linux fedora core 5 成功安装 Oracle 10g
redhat linux fedora core 5 成功安装 Oracle 10g

主机配置:
 Intel P4 CPU 3.0GHZ
 512M 内存
  80G 硬盘

一、准备主机和操作系统:

1、物理内存:512M
       
2、交换空间2G        
注意:在进行ORACL安装时,安装进程会提示教换空间最少要3068MB,与这里所说的2G有出入,没有关系,直接安装是不会有问题的,我在安装的时候实际所用的SWAP空间为1086MB,连2G都不到,但是最后成功了;

3、禁用secure Linux 
关于禁用secure Linux有很多办法,可以在安装LINUX的过程中禁用,也可以在系统里面进行禁用,通过编辑/etc/selinux/config 文件禁用secure linux,确认其中的SELINUX标记如下:SELINUX=disabled。也可以通过GUI工具(Applications > System Settings > Security Level),选择SELinux禁用该属性;

4、已经安装下列包:
  A、X Window System
  B、GNOME Desktop Environment
  C、Editors
  D、Graphical Internet
  E、Text-based Internet
  F、Server Configuration Tools
  G、Development Tools
  H、Administration Tools
  I、System Tools

二、安装前的准备工作
1、下载软件
Oracle Database 10g Release 2 (10.2.0.1) Software下载位置:

需要注意下载安装文件的版本号,不要搞错了(下载需要注册)
openmotif21-2.1.30-14.i386.rpm
ftp://fr.rpmfind.net/linux/fedora/core/4/i386/os/Fedora/RPMS/openmotif21-2.1.30-14.i386.rpm

2、解压软件
(1)、解压命令:
    unzip 10201_database_linux32.zip
(2)、解压后产生一个包含安装文件的目录database
   注:最好在根上建立一个文件夹,这个文件夹专门用来存放ORACLE的安装文件。但是需要注意的是,在安装ORACLE前,需要把这个文件夹的所有者修改成用户oracle,文件夹权限最好是修改成777,以免在安装过程中出现问题。

3、修改host文件
查看/etc/hosts文件中必须包含a fully qualified name for the server

4、设置内核参数
(1)、在/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

(2)、运行下列命令是参数配置生效:
 /sbin/sysctl –p

(3)、在/etc/security/limits.conf文件中加入下列行:
 *               soft    nproc   2047
 *               hard    nproc   16384
 *               soft    nofile  1024
 *               hard    nofile  65536

(4)、在/etc/pam.d/login文件中加入下列行,如果里面没有的话:
session    required     /lib/security/pam_limits.so

5、参数配置
(1)、检查下列包是否安装,若未安装则要先安装:
# From Fedora Core 5 DVD
cd /media/dvd/Fedora/RPMS
rpm -Uvh setarch-*
rpm -Uvh --force tcl-*
rpm -Uvh openmotif-2*
rpm -Uvh compat-db-*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh compat-libf2c-32-*
rpm -Uvh compat-gcc-32-*
rpm -Uvh libaio-*
rpm -Uvh compat-gcc-32-c++-*
rpm -Uvh compat-libstdc++-296*
rpm -Uvh compat-libgcc-296*
rpm -Uvh rsh-*

注:安装光盘内容的命令:
mkdir /mnt/cdrom
mount -t iso9660 /dev/cdrom /mnt/cdrom
查看 cd /mnt/cdrom

# From download
rpm -Uvh openmotif21-2.1.30-14.i386.rpm

(2)、创建下列组和用户
groupadd oinstall
groupadd dba
groupadd oper

useradd -g oinstall -G dba oracle
passwd oracle (在这个命令的执行过程中,会要求用户输入两次密码)

(3)、创建安装oracle的目录
mkdir -p /opt/oracle/product/10.2.0/db_1
chown -R oracle.oinstall /opt

(4)、用root登录,执行下列指令:
 xhost +

(5)、用oracle登录把下列行加在.bash_profile文件末尾,注意把其中ORACLE_SID换成自己的实例名: (.bash_profile文件的位置在/opt/oracle/.bash_profile)
命令:vi $HOME/.bash_profile

# Oracle Settings
TMP=/tmp;export TMP
TMPDIR=$TMP;export TMPDIR

ORACLE_BASE=/opt/oracle;export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1;export ORACLE_HOME
ORACLE_SID=orcl;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_LIBR
CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
umask 022
export LC_ALL=en.US (也可以在终端设置)

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


(也有以下的)

export ORACLE_BASE=/u/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.1.0/db_1
export ORACLE_SID=TEST
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

然后执行
$ source .bash_profile
使环境变量生效. /u/app/oracle 等目录应该建立好并做合适的授权.

 (6)、修改Oracle安装文件及其所在目录的所有于权限
        以我的做法为例,在/home下建立一个名字为software的文件夹,然后将oracle安装文件copy到这个文件夹,然后在终端里面修改文件夹software的归属及权限,具体办法如下:
chmod 777 /home/software/database
chown -R oracle.oinstall /home/software/database

三、安装oralce
安装前必须修改oralce10g的bug。
老外原文:
There are two problems preventing Oracle from installing on FC5: one is that the platform is not (yet) supported, the other that the installer (both server and client) will hang while linking ntcontab.
The first problem is easily dealt with by appending the following option when starting the installer
Code:

./runInstaller -ignoreSysPrereqs


The second one is trickier: there is a bug in the gennttab script that prevents the installer to execute a sed command; this bug is documented here (thanks to admjal). This is true for both the new version of the installer (10.2.0.1.0) as well as the previous one (10.2.0). See also here.

The following instructions can be used to prepare an Oracle installation CD which will work on FC5, in case you need one to perform multiple installations (this is for the client installation):
1) Download the server or client .zip file for your platform from Oracle
2) Unzip it in a directory of your choice, say "Oracle"
3) cd to Oracle/client/stage/Components/oracle.network.rsf/10.2.0.1.0/1/DataFiles
4) Extract the files contained in the filegroup6.jar archive
Code:

jar xf filegroup6.jar


change directory to bin and patch the gennttab script: change the lines
Code:

LIB=`$ECHO ${TtoLIB} | $SED 's/ /\\ /g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
INI=`$ECHO ${TtoINI} | $SED 's/ /\\ /g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
BAS=`$ECHO ${TtoBAS} | $SED 's/ /\\ /g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`


with the lines
Code:

LIB=`$ECHO ${TtoLIB} | $SED 's/ /\n/g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
INI=`$ECHO ${TtoINI} | $SED 's/ /\n/g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`
BAS=`$ECHO ${TtoBAS} | $SED 's/ /\n/g' | $GREP "^${T}:" | $AWK -F: '{print $2}'`


5) Recreate the archive with the patched file and delete the bin directory
Code:

cd ..
jar cMf filegroup6.jar bin/*
rm -rf bin


Now you're ready to create the ISO to burn your patched Oracle installation CD.

P.S. If you get a 'permission denied' when running runInstaller, create a new mountpoint for the cdrom, chmod it (777) and manually mount the cdrom.
1、用oracle用户登录。如果用的是X模式,要把DISPLAY设置如下:
DISPLAY=:0.0; export DISPLAY

2、因为oracle10g对linux的版本有要求,可用下面的参数跳过10g对支持系统的检查,在/software/database目录下用如下命令开始安装:
./runInstaller -IgnoreSysPreReqs
如果不写参数 ,必须修改etc/redhat-release 文件。即注释掉 #Fedora Core release 5 (Bordeaux),填写 Redhat 4

3、在安装过程中输入合适的ORACLE_HOME和实例名。详细过程就不说了,大家看着提示填写就好。完成后的画面中会有管理端入口地址和sqlplus入口地址。

4、安装过程中消耗时间很多,请耐心等待,另外,在安装过程中,所有的提示信息都是中文的。在安装即将完成的时候,会提示运行两个程序或者是脚本,然后就可以了。

四、安装后配置(参考老外原文)
编辑/etc/oratab文件设置每个实例的重启标志为“Y”:
oracle:/opt/oracle/product/10.2.0/db_1:Y

老外原文:
Edit the /etc/redhat-release file restoring the original release information:

    Fedora Core release 5 (Bordeaux)

Finally edit the /etc/oratab file setting the restart flag for each instance to 'Y':

    TSH1:/u01/app/oracle/product/10.2.0/db_1:Y

Create a file called /etc/init.d/dbora containing the following:

    #!/bin/sh
    # chkconfig: 345 99 10
    # description: Oracle auto start-stop script.
          #
    # Change the value of ORACLE_HOME to specify the correct Oracle home
    # directory for your installation.

    ORACLE_HOME=/opt/oracle/product/10.2.0/db_1
    #
    # Change the value of ORACLE to the login name of the
    # oracle owner at your site.
    #
    ORACLE=oracle

    PATH=${PATH}:$ORACLE_HOME/bin
    HOST=`hostname`
    PLATFORM=`uname`
    export ORACLE_HOME PATH
    #
    if [ ! "$2" = "ORA_DB" ] ; then
       if [ "$PLATFORM" = "HP-UX" ] ; then
          remsh $HOST -l $ORACLE -n "$0 $1 ORA_DB"
          exit
       else
          rsh $HOST -l $ORACLE  $0 $1 ORA_DB
          exit
       fi
    fi
    #
    case $1 in
    'start')
            $ORACLE_HOME/bin/dbstart $ORACLE_HOME &
            ;;
    'stop')
            $ORACLE_HOME/bin/dbshut $ORACLE_HOME &
            ;;
    *)
            echo "usage: $0 {start|stop}"
            exit
            ;;
    esac
    #
    exit

Set the appropriate group and access permissions:

    chgrp dba /etc/init.d/dbora
    chmod 750 /etc/init.d/dbora

Associate the dbora service with the appropriate run levels and set it to auto-start:

    chkconfig --level 345 dbora on

The relevant instances should now startup/shutdown automatically at system startup/shutdown.

五、安装检测
                安装完成后,可以在oracle用户下,打开终端,运行dbca命令,后有一个向导出现,说明安装成功。

 

发表于 @ 2006年11月01日 10:30:00 | | 举报|

北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号世纪乐知(北京)网络技术有限公司 提供技术支持Copyright © 1999-2010, CSDN.NET, All Rights Reserved

阅读(692) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~