分享

在ubuntu下安装oracle x86_64

 zhyiwww 2010-01-28
Installing Oracle 10g On Ubuntu Karmic 64 Bit or Otherwise PDF Print E-mail
Written by Josh B   
Thursday, 07 January 2010 18:31

Tags: oracle | ubuntu

Why Oracle 10g on Ubuntu...?

Oracle doesn't officially currently support its database on Ubuntu. However, I think that Ubuntu, especially the current release (09.10 : Karmic) is a great development platform. At my place of work there is a small development dept all busily developing and all using Ubuntu as the development platform of choice. The system we support uses Oracle 10g as its database. It followed that if we are to work productively then we needed some way of installing Oracle on Ubuntu. This guide is the result of lots of trial, error and spending time figuring out the best way to install Oracle 10g on Ubuntu.

Since Oracle doesn't support Ubuntu, installing Oracle in this way on a Production machine is very unwise. Its also even more unwise if you notice that I leave many of the defaults alone and use easily guessable passwords. However, when we deploy onto Production systems these defaults are close enough that we can deliver meaningful work without having to get a Sun server for the office. It also means we can all have our our installation of Oracle on our machines. Since its local the response time is very fast. And since no-one else is using the same Oracle install we can restart as many times as we want to...

Obviously if you think differently and install Oracle based Ubuntu into a production environment and it all goes horribly wrong you have only yourself to blame. I will not accept liability for your company going out of business because of this guide...! NB: If you are running 64-bit Ubuntu then you will need to follow the sections marked out for 64-bit Users.

Disclaimer: This has been adapted from many blogs, forums and other websites. If you see a bit of text that you think has been lifted from your blog entry, forum post or other waffling it probably might of. Please let me know and I will change. However no stealing of copyright is meant...!

This guide will take about two hours to complete, not including the time to download the file from Oracle. To fully install Oracle budget at least a morning or afternoon. The install is usually straight forward, but can throw up unexpected problems...!


Download

You will first need to download the installation file from Oracle. For 32-bit Ubuntu use "10g Release 2 Enteprise Edition for the Linux x86 architecture" and for 64-bit Ubuntu use "Oracle Database 10g Release 2 (10.2.0.1.0) for Linux x86-64". You will then either get 10201_database_linux32.zip or 10201_database_linux_x86_64.cpio.gz depending on your choice. Put this somewhere handy...

 

Install Libs

sudo apt-get install gcc libaio1 lesstif2 lesstif2-dev make rpm libc6 sun-java6-jre

For 64 Bit Ubuntu...

sudo apt-get install gcc-multilib libc6-dev-i386 libc6-dev-i386 libc6-i386 ia32-libs

(This avoids an compilation error because Oracle has mixed and matched 32-bit and 64-bit libraries. The Exception is "Error in invoking target 'install' of makefile '/oracle/10g/ctx/lib/ins_ctx.mk" and the compiler will have the following error :

/usr/bin/ld: skipping incompatible /lib/libpthread.so.0 when searching for /lib/libpthread.so.0
/usr/bin/ld: cannot find /lib/libpthread.so.0

Installing gcc-multilib, etc appears to avoid this)

 

Install libstdc++5

With Ubuntu 09.10 this is no longer included in the Packages. (If you are not on Karmic, install it via Synaptic.) Install as follows:

wget "http://mirrors./ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-17ubuntu1_i386.deb"
ar vx libstdc++5_3.3.6-17ubuntu1_i386.deb
tar zxvf data.tar.gz
file usr/lib/libstdc++.so.5.0.7
sudo install usr/lib/libstdc++.so.5.0.7 /usr/lib32/
cd /usr/lib32
sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5
cd /usr/lib
sudo ln -s /usr/lib32/libstdc++.so.5

For 64 Bit Users

This is the same apart from using the following first two steps:

wget "http://de.archive./ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-17ubuntu1_amd64.deb"
ar vx libstdc++5_3.3.6-17ubuntu1_amd64.deb

 

Add user/groups

sudo groupadd oinstall
sudo groupadd dba
sudo groupadd nobody
sudo useradd -m oracle -g oinstall -G dba
sudo passwd oracle

Set the password to oracle... Remember to change this to something else afterwards and never leave it like this on a public facing server. (And why are you letting an Oracle Server be public facing...?). If you will be running this on your own machine don't forget to add yourself to the oinstall group. This will allow you to use sqlldr and sqlplus from the same install for development and debugging...!

 

Update Kernel Parameters

sudo gedit /etc/sysctl.conf

Add:

kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

And reload with:

sudo /sbin/sysctl -p

 

Change Limits

sudo gedit /etc/security/limits.conf

Add the following to the end

* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536

 

Suse-ise the Environment

sudo ln -s /usr/bin/awk /bin/awk
sudo ln -s /usr/bin/rpm /bin/rpm
sudo ln -s /lib/libgcc_s.so.1 /lib/libgcc_s.so
sudo ln -s /usr/bin/basename /bin/basename
sudo mkdir /oracle
sudo mkdir /oracle/10g
sudo chown -R oracle:oinstall /oracle
sudo chmod -R 775 /oracle

 

Update default profile

sudo gedit /etc/profile

Add the following to the end:

export ORACLE_BASE=/oracle
export ORACLE_HOME=/oracle/10g
export ORACLE_SID=orcl10
export PATH=$PATH:$ORACLE_HOME/bin

Double check...

su - oracle
echo $ORACLE_BASE
echo $ORACLE_HOME
exit

 

Redhat-ise Ubuntu

sudo gedit /etc/redhat-release

Add this :

Red Hat Enterprise Linux AS release 3 (Taroon) 

Unpack the Downloaded File

Go to where you put the downloaded file and...

mkdir oracle_install
cp 10201_database_linux32.zip oracle_install/
unzip 10201_database_linux32.zip

For 64 Bit Users

mkdir oracle_install
cp 10201_database_linux_x86_64.cpio.gz oracle_install/
gunzip 10201_database_linux_x86_64.cpio.gz
cpio -id < 10201_database_linux_x86_64.cpio

The unzipping operation creates a subdirectory. Make this available to the Oracle user:

cd ..
sudo chown -R oracle:oinstall oracle_install/

At this point you are ready to start installing Oracle...!

 

Run the Graphical Installer

To initiate the installation, you'll have to log right out of the system, and log in directly as the oracle user (alternatively, you can fiddle around with DISPLAY environment variables, but logging off and back on again is simpler and less prone to making mistakes!). See also http:///blog/setting-up-xdmcp-on-karmic-koala-ubuntu-0910.html

To do this try:

gdmflexiserver --xnest

(NB: if you get authority errors then you need to make sure you have a fresh terminal window, and can this can attach application to the local screen. If problems persist, then make sure that the Remote Login for is enabled under System -> Administration -> Login Window )

Log into this window, and then...

cd to the location of the zip file
/home/oracle/database/runInstaller

It may take a while for the install to come up...

Un-tick the "Create Starter Database option", and keep hitting next. The install takes about 10 mins on a typical machine and typical rest-load.

NB: You will get an error regarding the target "collector" of makefile '/oracle/10g/sysman/lib/ins_emdb.mk' . This can be ignored as we will not be using this function. (Its used by Oracle to check data on Oracle. Since Karmic isn't a supported o/s this can be ignored...)

This error is identified by "/usr/bin/ld: i386 architecture of input file `/oracle/10g/sysman/lib/snmccolm.o' is incompatible with i386:x86-64 output" in the make log.

You will then be asked to run at least one (usually two) scripts as root. Do so... These can be run by "sudo" if you prefer.

When all this finished Oracle has been installed. Woo...! Hoo...! But there's still a way to go...!

 

Creating A Listener For the New DB

It's not a requirement to create a Listener before you create a database, but it's a good idea to do so. A Listener is a process which listens on a well-known port for requests from remote users seeking to connect to the Oracle database. Without one, therefore, you'd only ever be able to connect to the database whilst directly logged onto the server itself, which is obviously a bit of a show-stopper!

To create a Listener, we use the Network Configuration Assistant. To invoke the Assistant, just issue the command netca (should be in path) as the oracle user in a new terminal session. Press "Next" to accept the defaults. After a bit you will get to "Finish" which is where you want to finish.

netca

 

Creating a Database

First, find out the id of the oinstall group. You can find this from looking in System -> Admin -> Users and Groups -> Manage Groups. Alternatively, use:

cat /etc/group | grep oinstall

NB: The oinstall Group Id should be 1002 or similar. If the User/Group Applet is giving "0" then try double checking the Properties of the group. I've noticed that the Users/Groups Applet can be unreliable...

Then, as root, perform the following command. (NB: This can't be performed by sudo, you must be root)

echo "<dba_group_gid>" > /proc/sys/vm/hugetlb_shm_group

This allows the oinstall group access to hugetlbpages. Without this you will get error "ORA-27125: unable to create shared memory segment" when setting up the database.

Run the Database Configuration Assistant, or DBCA for short. You will need to be the Oracle user you set up earlier.

dbca

This is not a difficult thing to do: mostly, in our case, it involves clicking "Next" to walk through the wizard, accepting all defaults. You will be prompted when you actually need to enter something.

Just be sure to specify the correct database name (it should match what is set as your ORACLE_SID, but with a proper domain extension. By default the ORACLE_SID is orcl10, and can be found out by running the oraenv command in the oracle bin directory...

Use the password "oracle" for the password and write down the values it spits out at the end...!

NB: If you get a "ORA-12547- Lost Contact" error, make sure you have libaio1installed (sudo apt-get install libaio1)...

Well Done...!

If it all went well you now have an Oracle Db on your machine. Pat yourself on the back for getting this far and sticking with it. You still have a way to go before its all installed but go and have some tea to celebrate...! And then go on to Part 2...

Last Updated on Saturday, 16 January 2010 12:09

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多