HOWTO install Oracle 11g on Ubuntu Linux 12.04 (precise pangolin) 64bits

Source: Internet
Author: User
Tags documentation oracle documentation



Installed Ubuntu 12.04 64bit, want to install Oracle 11GR2 on the above, find a lot of documents on the Internet did not succeed, and finally fully reference the Mordicusetcubitus article.



Key points for a successful installation: Install additional packages, which handles the wrong method during link.



Original: 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 the Oracle 64bits on Ubuntu.
If you need to run Oracle on a production environment, install a supported Linux distribution.
Why installing Oracle on Ubuntu?


    • Manage Ubuntu servers and cannot use other Linux distributions
    • You could be a developper, and clearly, Ubuntu are a good choice for the desktop environment so your want to continue Developi Ng on your favorite distribution
    • Student learning Oracle, and clearly, Ubuntu is a good choice for the desktop environment so you want to cont Inue Learning on your favorite distribution
    • Because 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 previousor Acle Installation Guide in Ubunto 64bits how to.
This was due to, at least, the following points:


    • /DEV/SHM is a symbolic link to/run/shm and Oracle binaries don't properly support this, resulting InMEMORY TARGET errors
    • New configuration/compilation rules with GCC (Indirect library linking) No more allow a library a referencing function S of library C linked with library B which is linked with library A. In the case, library A must is explicitly linked with library C too. So Oracle makefiles has to be updated for some libraries.


This what to are based on the following the others and many others contributions:


    • Installing Oracle 11g on Ubuntu 11.10
    • Another howto on installing Oracle 11gR2 on Ubuntu 11.10
    • Installing Oracle 11g on Ubuntu 11.10 64bits from Ubuntu Forums
    • Installing Oracle 11g on Ubuntu 12.04 Server


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 par TS of encoutered as FOR/DEV/SHM.


Downloading Oracle 11g bits for Linux


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



Then extract the downloaded file:


[Plain]View Plaincopyprint?
    1. Unzip Linux.x64_11gR2_database_1of2.zip
    2. Unzip Linux.x64_11gR2_database_2of2.zip








A new folder named database would 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:databas E/doc/install.112/e10860/toc.htm



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



We'll have the 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:


[Plain]View Plaincopyprint?
    1. sudo groupadd oinstall



Creating Oracle DBA Group:





[HTML]View Plaincopyprint?
    1. sudo groupadd dba





Creating Oracle user Home and account:


[Plain]View Plaincopyprint?
    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's required to add nobody the user group, this is no further required with 11g as it's no more described in1 1g Quick Installation Guide.








Updating Kernel Parameters


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








[Plain]View Plaincopyprint?
    1. sudo gedit/etc/sysctl.conf



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








[Plain]View Plaincopyprint?


  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 BES set to avoid IO errors
  18. FS.AIO-MAX-NR = 1048576
  19. # Processes/what really means PROCESSES?
  20. Fs.file-max = 6815744
  21. # to allow DBAs to allocate HUGETLBFS pages
  22. # 1001 is your Oinstall group, ID. grep Oinstall/etc/group would give this value
  23. Vm.hugetlb_shm_group = 1001




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








[Plain]View Plaincopyprint?
    1. sudo sysctl-p



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








[Plain]View Plaincopyprint?
    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 do, update your distribution with the latest packages:


sudo apt-get updatesudo 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 on 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 the 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/lib64sudo ln-s/lib/x86_64-linux-gnu/libgcc_s.so.1.


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


There was many ways to install it, I had followed this howto-install libstdc++5 on Ubuntu Karmic Below was the Summ Ary 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 would 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-oraclecdtouch. bashrcln-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 the 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, the Oracle installer should start in graphic mode.
for the rest of the installation, we suppose you'll choose the following options:


    • Installing Oracle 11g Enterprise Edition in advanced mode
    • Installing server class
    • Oracle BAS E 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:un Icode Al32utf8
    • memory:uncheck activate automatic Memory management to prevent From ora-00845:memory_target not supported in this system. but This no further seems to be a issue on 12.04, is ok as automatic with my last Installat Ion.
    • oradata directory:/opt/oracle/oracle11gee/oradata


Once you'll reach the "pre-reqs" screen and check "Ignore all" to continue the installation.



Then, you'll encounter issues.


Solving Compilation/link Errors


Some issues should appear during installation.



If you had not created the symbolic links above, you would have had to solve error lib//libagtsh.so:undefined reference T O ' 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'll 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 COM Mand:


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/genorasdkshsed-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 would finally ask you to execute scripts as root user, just does so:


# sudo/opt/oracle/orainventory/orainstroot.shsudo/opt/oracle/oracle11gee/product/11.2.0/dbhome_1/root.sh


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



Now, add the following variable declaration in your Oracle user,. 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 is able to start Oracle database if you had choosed to create one during installation.
If you had not yet created any Oracle instance and database use the $ORACLE _HOME/BIN/DBCA Assistant to do.



Starting up the database



Once your server has been restarted, your database may not start. To solve this issue, first check in/etc/oratab that it had 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:


[Email protected]:~$ sqlplus [email protected]


Sql*plus:release 11.2.0.1.0 Production on Wed 8 11:18:50 2012



Copyright (c) 1982, 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-bits ' as Welcome from dual;



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



Sql>


Shutting down the database


Just entry The following commands with Oracle User:


Dbshut $ORACLE _home




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.