安装了Ubuntu 12.04 64bit, 想在上面安装Oracle 11gr2,网上找了好多文档都没成功,最后完全参考了MordicusEtCubitus的文章。

成功安装的关键点:install additional packages, 在link过程中处理错误的方法。

原文:http://www.makina-corpus.org/blog/howto-install-oracle-11g-ubuntu-linux-1204-precise-pangolin-64bits

Before starting

Since release 11.10 it is more difficult to install Oracle 64bits on Ubuntu.
If you need to run Oracle on a production environment, please install a supported Linux distribution.
So why installing Oracle on Ubuntu ?

  • You may manage Ubuntu servers and cannot use other linux distributions
  • You may be a developper, and clearly, ubuntu is a good choice for the desktop environment so you want to continue developing on your favorite distribution
  • You may be a student learning Oracle, and clearly, ubuntu is a good choice for the desktop environment so you want to continue learning on your favorite distribution
  • Because you want to !

Clearly, Oracle should officially support ubuntu linux !

Since version 11.10 of Ubuntu, installing Oracle as become much more complicated than already described in this previousOracle installation guide on Ubunto 64bits how to
This is due to, at least, the following points:

  • /dev/shm is a symbolic link to /run/shm and Oracle binaries do not properly support this, resulting inMEMORY TARGET errors
  • new configuration/compilation rules with gcc (indirect library linking) no more allow a library A referencing functions of library C linked with library B that is linked with library A. In this case, library A must be explicitly linked with library C too. So Oracle makefiles have to be updated for some libraries.

This how to is based on the following two others and many others contributions:

So, why writing my own ? 
Because they were not so easy to found, and I had started my own article before solving all the encountered issues.
Because they do not all describe or explain all errors I've encoutered and because I suggest others solutions to solve parts of encoutered as for /dev/shm.

Downloading Oracle 11g 64 bits for Linux

First, download Oracle 11gR2 Enterprise/Standard Edition for Linux x86-64 from Oracle website.

Then extract the downloaded file:

  1. unzip linux.x64_11gR2_database_1of2.zip
  2. unzip linux.x64_11gR2_database_2of2.zip

A new folder named database will be extracted.

Preparing the system

Second, read the HTML documentation of the quick install guide you can found in the extracted folder at this place:database/doc/install.112/e10860/toc.htm

For the rest of this howto, we suppose Oracle will be installed at /opt/oracle Root directory in a freshly newly installed Linux Ubuntu distribution.

We will have to:

  • Create required users and groups accounts
  • Set required system parameters in /etc/sysctl.conf
  • Installing complementary packages

Creating system accounts

Creating Oracle Inventory group:

  1. sudo groupadd oinstall

Creating Oracle DBA group:

  1. sudo groupadd dba

Creating Oracle user home and account:

  1. sudo mkdir -p /opt/oracle
  2. sudo useradd -g oinstall -G dba  -d /opt/oracle -s /bin/bash oracle
  3. sudo passwd oracle
  4. sudo chown -R oracle:oinstall /opt/oracle

For Oracle 10g, it was required to add nobody user group, this is no more required with 11g as it is no more described in11g quick installation guide.

Updating kernel parameters

This is one of the longest task of this installation. Because you will have to check your current config.
Check commands in Oracle documentation for this, section 6 Configuring Kernel Parameters.
Then, edit the file /etc/sysctl.conf as described below:

  1. sudo gedit /etc/sysctl.conf

Add the following lines to get minimal values required by Oracle, adjusting if required, depending of your configuration:

  1. #
  2. # Oracle 11g
  3. #
  4. kernel.sem = 250 32000 100 128
  5. kernel.shmall = 2097152
  6. kernel.shmmni = 4096
  7. # Replace kernel.shmmax with the half of your memory in bytes
  8. # if lower than 4Go minus 1
  9. # 1073741824 is 1 GigaBytes
  10. kernel.shmmax=1073741824
  11. # Try sysctl -a | grep ip_local_port_range to get real values
  12. net.ipv4.ip_local_port_range = 9000  65500
  13. net.core.rmem_default = 262144
  14. net.core.rmem_max = 4194304
  15. net.core.wmem_default = 262144
  16. net.core.wmem_max = 1048576
  17. # Max value allowed, should be set to avoid IO errors
  18. fs.aio-max-nr = 1048576
  19. # 512 * PROCESSES / what really means processes ?
  20. fs.file-max = 6815744
  21. # To allow dba to allocate hugetlbfs pages
  22. # 1001 is your oinstall group, id. grep oinstall /etc/group will give this value
  23. vm.hugetlb_shm_group = 1001

About HUGE TLB.
Since Ubuntu Karmic (it was not required on Ubuntu Jaunty) kernel parameters have changed and this was required for 10g.
Without these parameters your Oracle instance won't be able to create shared memory segment and will refuse to start.
Not tested on Ubuntu 12.04 but this is now described in 11g documentation.
You have to replace the value of 1001 with the group ID of the oinstall group.
Read this great howto install Oracle on debian to know more about huge tlb parameter.
Then, run the command below to set these kernel parameters:

  1. sudo sysctl -p

Now, update /etc/security/limits.conf:

  1. sudo gedit /etc/security/limits.conf

And add the following parameters:

# Oracle
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

Check that /etc/pam.d/login contains a line like this one:

	session    required   pam_limits.so

Now, update /etc/profile:

	sudo gedit /etc/profile

And add the following lines:

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

Installing additional packages

If not already done, update your distribution with the latest packages:

	sudo apt-get update
sudo apt-get dist-upgrade

Install the following additional packages:

sudo apt-get install alien
sudo apt-get install autoconf
sudo apt-get install automake
sudo apt-get install autotools-dev
sudo apt-get install binutils
sudo apt-get install bzip2
sudo apt-get install doxygen
sudo apt-get install elfutils
sudo apt-get install expat
sudo apt-get install gawk
sudo apt-get install gcc
sudo apt-get install gcc-multilib
sudo apt-get install g++-multilib # This will help preventing prevent from runInstaller terrific ./runInstaller: line 54: ./install/.oui: No such file or directory error message
sudo apt-get install ia32-libs sudo apt-get install ksh
sudo apt-get install less
sudo apt-get install lesstif2
sudo apt-get install lesstif2-dev
sudo apt-get install lib32z1
sudo apt-get install libaio1
sudo apt-get install libaio-dev
sudo apt-get install libc6-dev
sudo apt-get install libc6-dev-i386
sudo apt-get install libc6-i386
sudo apt-get install libelf-dev
sudo apt-get install libltdl-dev
sudo apt-get install libmotif4
sudo apt-get install libodbcinstq4-1 libodbcinstq4-1:i386
sudo apt-get install libpth-dev
sudo apt-get install libpthread-stubs0
sudo apt-get install libpthread-stubs0-dev
sudo apt-get install libstdc++5
sudo apt-get install lsb-cxx
sudo apt-get install make
sudo apt-get install openssh-server
sudo apt-get install pdksh
sudo apt-get install rlwrap
sudo apt-get install rpm
sudo apt-get install sysstat
sudo apt-get install unixodbc
sudo apt-get install unixodbc-dev
sudo apt-get install unzip
sudo apt-get install x11-utils
sudo apt-get install zlibc

Preventing from installation errors

To prevent from error genclntsh: Failed to link libclntsh.so.11.1 in make file for rdbms/lib/ins_rdbms.mk 
beacause of missing library: /usr/bin/ld: cannot find /usr/lib64/libpthread_nonshared.a inside 
we need to create a symlink for /usr/lib64:

sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64

To help preventing from error lib//libagtsh.so: undefined reference to `nnfyboot' in make: rdbms/lib/dg4odbc] Error 1

sudo ln -sf /bin/bash /bin/sh
sudo ln -s /usr/bin/awk /bin/awk
sudo ln -s /usr/bin/rpm /bin/rpm
sudo ln -s /usr/bin/basename /bin/basename
To prevent from # /lib64/libgcc_s.so.1: File or directory does not exists, while creating lib/liborasdkbase.so.11.1 in ins_rdbms.mk, execute the command:
cd /lib64
sudo ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 .

Oracle 11g also needs libstdc++5 in 32bits version that is not provided with Ubuntu Pangolin.

There are many ways to install it, I have followed this howto to install libstdc++5 on Ubuntu Karmic
Below is the summary of this HOWTO:
mkdir /tmp/libstdc++5
cd /tmp/libstdc++5
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3....
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.... sudo dpkg --force-architecture -i libstdc++5_3.3.6-17ubuntu1_i386.deb
sudo mv /usr/lib/libstdc++.so.5* /usr/lib32/ sudo dpkg -i libstdc++5_3.3.6-17ubuntu1_amd64.deb

Now reboot your system to be sure these parameters will be taken in account for the next part of the installation.

Others configurations

Connect as Oracle user and set some default startup file

	sudo su - oracle
cd
touch .bashrc
ln -s .bashrc .bash_profile

Edit .bashrc file:

	vi .bashrc

And add the following line:

	umask 022

Execute the .bashrc file or restart a bash shell

	source .bashrc

Installing Oracle

Now we can start the installation of the Oracle 10g archive.

Allow others users to connect to your X session, by entering in a bash shell:

	xhost +

Then, login as oracle user:

	su - oracle

Go in the extracted database folder and run the following commands:

	export DISPLAY=:0
./runInstaller

Then, Oracle installer should start in graphic mode.
For the rest of the installation, we suppose you will choose the following options:

  • Installing Oracle 11g Enterprise edition in advanced mode
  • Installing server class
  • Oracle base directory: /opt/oracle/Oracle11gee
  • Oracle home: /opt/oracle/Oracle11gee/product/11.2.0/dbhome_1
  • Oracle inventory: /opt/oracle/oraInventory
  • Oracle database global name and SID: orcl
  • Character set: Unicode AL32UTF8
  • Memory: Uncheck activate automatic memory management to prevent from ORA-00845: MEMORY_TARGET not supported on this system. Antoher solution could be to remove /de/shm symbolic link and mount it as a bind to /run/shm: mount --bind /run/shm /dev/shm. But this no more seems to be an issue on 12.04, was ok as automatic with my last installation.
  • Oradata directory: /opt/oracle/Oracle11gee/oradata

Once you will reach the "pre-reqs" screen, check "Ignore all" to continue the installation.

Then, you will encounter issues.

Solving compilation/link errors

Some issues should appear during installation.

If you have not created the symbolic links above, you will have to solve error lib//libagtsh.so: undefined reference to `nnfyboot' in make: rdbms/lib/dg4odbc] Error 1. For this, create the symbolic links and execute the commands:

export ORACLE_HOME=/opt/oracle/Oracle11gee/product/11.2.0/dbhome_1
cd $ORACLE_HOME/lib
ln -s libclient11.a libagtsh.a
$ORACLE_HOME/bin/genagtsh $ORACLE_HOME/lib/libagtsh.so 1.0

Now we will encounter many errors due to indirect library linking:

To solve error # libnnz11.so: could not read symbols: Invalid operation /sysman/lib/ins_emagent.mk, enter the command:

export ORACLE_HOME=/opt/oracle/Oracle11gee/product/11.2.0/dbhome_1
sed -i 's/^\(\s*\$(MK_EMAGENT_NMECTL)\)\s*$/\1 -lnnz11/g' $ORACLE_HOME/sysman/lib/ins_emagent.mk

To solve error # nsglsn.c:(.text+0xc29): undefined reference to `ons_subscriber_close' /network/lib/ins_net_server.mk, enter the command:

sed -i 's/^\(TNSLSNR_LINKLINE.*\$(TNSLSNR_OFILES)\) \(\$(LINKTTLIBS)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/network/lib/env_network.mk

To solve error # libocrutl11.so: undefined reference to `lfifcp' rdbms/lib/ins_rdbms.mk, enter the commands:

sed -i 's/^\(ORACLE_LINKLINE.*\$(ORACLE_LINKER)\) \(\$(PL_FLAGS)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/rdbms/lib/env_rdbms.mk

You also need to execute the following commands to prevent from later errors:

sed -i 's/^\(\$LD \$LD_RUNTIME\) \(\$LD_OPT\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/bin/genorasdksh
sed -i 's/^\(\s*\)\(\$(OCRLIBS_DEFAULT)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/srvm/lib/ins_srvm.mk

Finishing the installation

The install process will finally ask you to execute scripts as root user, just do so:

# sudo /opt/oracle/oraInventory/orainstRoot.sh
sudo /opt/oracle/Oracle11gee/product/11.2.0/dbhome_1/root.sh

You should be able to access database web interface through the URL https://localhost:1158/em

Now, add the following variable declaration in your oracle user .profile, .bashrc or .bash_profile scripts:

export ORACLE_HOME=/opt/oracle/Oracle11gee/product/11.2.0/dbhome_1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export PATH=$PATH:$ORACLE_HOME/bin

Then start a new shell or execute one of the updated files:

	source .bashrc

Starting and stopping Oracle

We should now be able to start Oracle database if you had choosed to create one during installation.
If you have not yet created any oracle instance and database use the $ORACLE_HOME/bin/dbca assistant to do so.

Starting up the database

Once your server have been restarted, your database may not start. To solve this issue, first check in /etc/oratab that it has the 'Y' flag, if not, set it.

	sudo gedit /etc/oratab

And replace N by Y

orcl:/opt/oracle/Oracle11gee/product/11.2.0/dbhome_1:Y

Finally, to manually start Oracle, run these commands as oracle user

dbstart $ORACLE_HOME

Connecting to the database

Now, just try to connect to the freshly started database:

oracle@makina-oracle:~$ sqlplus system@orcl

SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 8 11:18:50 2012

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select 'Oracle 11gee is running on Ubuntu 12.04 64 bits' as Welcome from dual;

WELCOME
-----------------------------------------------
Oracle 11gee is running on Ubuntu 12.04 64 bits

SQL>

Shutting down the database

Just entry the following commands with Oracle user:

	dbshut $ORACLE_HOME

HOWTO install Oracle 11g on Ubuntu Linux 12.04 (Precise Pangolin) 64bits的更多相关文章

  1. Ubuntu Linux 12.04 LTS amd64系统本地root提权

    URL:http://www.ichunqiu.com/section/173 由于fusermount二进制调用setuid的(geteuid())重置RUID时,它调用/bin/mount才能使用 ...

  2. Installing cmake 2.8.8 or higher on Ubuntu 12.04 (Precise Pangolin) (转载)

    转自:http://cameo54321.blogspot.com/2014/02/installing-cmake-288-or-higher-on.html Check the version o ...

  3. Install Oracle 11G Release 2 (11.2) on Centos Linux 7

    Install Oracle 11G Release 2 (11.2) on Centos Linux 7 This article presents how to install Oracle 11 ...

  4. Install Oracle 11G Release 2 (11.2) on Oracle Linux 7 (OEL7)

    Install Oracle 11G Release 2 (11.2) on Oracle Linux 7 (OEL7) This article presents how to install Or ...

  5. [Linux] Ubuntu Server 12.04 LTS 平台上搭建WordPress(Nginx+MySql+PHP) Part II

    接着上一节继续搭建我们的LNMP平台,接下来我们安装PHP相关的服务 sudo apt-get install php5-cli php5-cgi php5-fpm php5-mcrypt php5- ...

  6. [Linux] Ubuntu Server 12.04 LTS 平台上搭建WordPress(Nginx+MySQL+PHP) Part IV

    接下来我们去下载 WorePress 用最新的 3.7.1 下载地址是:http://cn.wordpress.org/wordpress-3.7.1-zh_CN.zip 我们先建立一个文件夹 /va ...

  7. Oracle 11g客户端在Linux系统上的配置步骤详解

    Oracle 11g客户端在Linux系统上的配置步骤详解 2011-07-26 10:47 newhappy2008 CSDN博客 字号:T | T 本文我们主要介绍了Oracle 11g客户端在L ...

  8. 阿里云的ubuntu server 12.04 下安装jdk和tomcat

    因为想自己在做个简单粗暴的小游戏,弄到朋友圈去,买了个阿里云服务,当时选的的ubuntu sever 12.04的os,恰巧朋友又委托一个小项目,所以先尝试搭建下环境. 首先,用putty或者SSH ...

  9. vagrant Ubuntu server 12.04 dpkg: dependency problems prevent configuration of python-gi

    Ubuntu server 12.04因为尝试安装过xfce,导致sudo apt-get install xxx 都会返回,如: vagrant@precise32:~$ sudo apt-get ...

随机推荐

  1. Redrain个人维护并使用的DuiLib和UiLib库源码下载地址

    转载请说明原出处:http://blog.csdn.net/zhuhongshu/article/details/40740353,谢谢~~ 我把我自己使用的Duilib库和Uilib库都上传到了Gi ...

  2. <转>配置DNS辅助服务器:DNS系列之四

    配置DNS辅助服务器   在前面的博文中,我们介绍了如何在DNS服务器中创建常用的DNS记录,本文中我们要为大家介绍如何配置DNS的辅助服务器,同时也要介绍一下和辅助区域类似的存根区域. DNS辅助服 ...

  3. poj2396 Budget(有源汇上下界可行流)

    [题目链接] http://poj.org/problem?id=2396 [题意] 知道一个矩阵的行列和,且知道一些格子的限制条件,问一个可行的方案. [思路] 设行为X点,列为Y点,构图:连边(s ...

  4. struts2实现文件上传

    Struts2中实现简单的文件上传功能: 第一步:将如下文件引入到WEB_INF/lib目录下面,对应的jar文件可自行下载 第二步:在包test.struts2下建立类UploadFile pack ...

  5. find in linux

    find命令的作用是在目录中根据文件名搜索文件find 列出当前目录及其子目录的所有文件和文件夹的完整路径.find -name Help.java 在当前目录及其子目录中搜索文件名为Help.jav ...

  6. 用C语言实现ipv4地址字符串是否合法

    用程序实现ipv4地址字符串是否合法,主要考察的是C字符串的操作. 搜索了下,网上没有特别好的实现,自己实现了下,见笑于大家,请指正. #include <stdio.h> #includ ...

  7. Java IO (2) - OutputStream

    Java IO (2) - OutputStream 前言 JavaIO一共包括两种,一种是stream,一种是reader/writer,每种又包括in/out,所以一共是四种包.Java 流在处理 ...

  8. 自定义控件和XControl控件

    (1)LabVIEW的自定义控件,实际上就是对LabVIEW自带的控件的一种修改,但是这种修改只能改变它的外观,即大小.颜色.位置等等,但是功能是改变不了的.如你对一个按钮进行自定义控件,无论怎么改, ...

  9. Codeforces Round #352 (Div. 2) D. Robin Hood (二分答案)

    题目链接:http://codeforces.com/contest/672/problem/D 有n个人,k个操作,每个人有a[i]个物品,每次操作把最富的人那里拿一个物品给最穷的人,问你最后贫富差 ...

  10. Spring Data Solr教程(翻译)

    大多数应用都必须具有某种搜索功能,问题是搜索功能往往是巨大的资源消耗并且它们由于沉重的数据库加载而拖垮你的应用的性能 这就是为什么转移负载到一个外部的搜索服务器是一个不错的主意,Apache Solr ...