Home > Database > Mysql Tutorial > Ubuntu 10.10上安装Oracle 11g R2记录

Ubuntu 10.10上安装Oracle 11g R2记录

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:09:17
Original
1011 people have browsed it

Ubuntu 10.10上安装Oracle 11g R2记录

1.准备工作
    1.1 若是server版,需安装图形界面
        $ sudo apt-get install Ubuntu-desktop

    1.2 安装必要的库包
        $ sudo apt-get install build-essential libaio1 gawk ksh libmotif3 alien libtool lsb-rpm
        
    $sudo apt-get install libstdc++5 此步很重要,不安装的话会出现MakefileException error in invoking target 'install' of makefile ins_ctx.mk错误。原因为ubuntu10+默认使用libstdc++6作为默认版本。
    
    1.3  创建一些命令的软连接
        $ su -
        # ln -sf bash /bin/sh
        # ln -s /usr/bin/awk /bin/awk
        # ln -s /usr/bin/rpm /bin/rpm
        # ln -s /usr/bin/basename /bin/basename
        # mkdir /etc/rc.d
        # for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done

2. 创建Oracle相关用户及用户组,文件夹
    
    2.1 创建oinstall , dba用户组
        $ su -
        # addgroup oinstall
        # addgroup dba
 
    2.2 创建oracle用户,并指定至以上创建的用户组
 
        --创建oracle用户
        # useradd -g oinstall -G dba -d /home/oracle -s /bin/bash oracle
        --设置密码
        # passwd oracle

    2.3 创建文件夹
        -- 创建oracle用户主目录
        $ su -
        # mkdir /home/oracle
        # chown -R oracle:dba /home/oracle
 
        --创建ORACLE_BASE目录
        # mkdir -p /u01/oracle  此步注意 /u01默认占用“/“文件系统空间。此位置可更改,例如改为 /opt/oracle

        # chown -R oracle:dba /u01

3. 设置系统参数
 
    3.1 编辑/etc/sysctl.conf文件,添加以下参数到最后。注意:修改前应先备份此文件。
        $ su -
        # cp /etc/sysctl.conf /etc/sysctl.conf.bak
        ----------------------
        添加以下参数到sysctl.conf文件末尾。
    fs.file-max = 6815744
    fs.aio-max-nr = 1048576
    kernel.shmall = 2097152
    kernel.shmmax = 2147483648
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.core.rmem_default = 4194304
    net.core.rmem_max = 4194304
    net.core.wmem_default = 1048576
    net.core.wmem_max = 1048576
    net.ipv4.ip_local_port_range = 9000 65535

    3.2 编辑/etc/security/limits.conf , 添加以下参数到文件末尾。
        注:编辑前应先备份。
        -----------
    oracle soft nproc 2047
    oracle hard nproc 16383
    oracle soft nofile 1023
    oracle hard nofile 65535

    3.3 修改/etc/pam.d/login文件,添加以下两行参数:
      session required /lib/security/pam_limits.so
    session required pam_limits.so

    3.4 激活sysctl.conf中配置
        $ su -
        # sysctl -p

    3.5 修改/etc/profile,设置环境变量
    ORACLE_SID=orcl
    ORACLE_BASE=/u01/oracle
    ORACLE_HOME=/u01/oracle/product/11.0.2
    NLS_LANG=AMERICAN_AMERICA.UTF8
    PATH=$ORACLE_HOME/bin:$PATH
    export ORACLE_BASE ORACLE_SID ORACLE_HOME PATH NLS_LANG

4. 准备安装文件

   4.1 从官方网站下载安装文件,文件拷贝至/u01下

       $ unzip linux_11gR2_database_1of2.zip
       $ unzip linux_11gR2_database_2of2.zip

       总大小约2.2G,以上文件为32位。

   4.2 解压缩后会出现database文件夹,此为安装文件。为安装文件指定相应权限。
    
    $ sudo chmod 755 u01/oracle/database
    $ sudo chmod 755 u01/oracle/database/*.*
    $ sudo chmod 755 u01/oracle/database/install/.oui
    $ sudo chmod 755 u01/oracle/database/install/*.*
    $ sudo chmod 755 u01/oracle/database/install/unzip

        $ chown -R oracle:dba /u01/database/

5. 开始安装
   
   5.1 安装需要图形化界面,若出现 Could not initialize class sun.awt.X11.XToolkit 异常,应执行以下命令配置。
 
      $ su -
      # xhost +127.0.0.1
      或
      # export DISPLAY=:0.0

  5.2 开始安装
      $ su - oracle
      $ export LANG=en_US
      $ cd /u01/database
      $ ./runInstaller -jreLoc /opt/lib/jdk1.6.0_25 -ignoreSysPrereqs
        指定JRE目录,且忽略版本检查。

----------- 结束 -----------------

备注:
 
  1. 在安装至 “ Database Configuration Assist “ 时,,界面是空白的,这是正常现象。 此步需花费较长时间。此步成功后会弹出 实例名,服务名等信息提示窗口。

  2. 安装成功后,在oracle用户下执行sqlplus system/pwd 可成功登录,但切换为 日常用户 后会报错。 因为在 日常用户 的环境变量中未指定ORACLE_SID. 修改 ~/.bashrc 或 ~/.bash_profile文件,添加export ORACLE_SID=orcl 即可。
   
    若出现在 日常用户 下找不到sqlplus命令,则创建软连接至/bin下。
    $ sudo ln -s $ORACLE_HOME/bin/sqlplus /bin/sqlplus

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template