| Installing Oracle 10g On Ubuntu Karmic 64 Bit or Otherwise |
|
|
|
| Written by Josh B |
| Thursday, 07 January 2010 18:31 |
Updated for Natty Narwhal (Ubuntu 11.04)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...! DownloadYou 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 Libssudo 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++5With 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.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-17ubuntu1_i386.deb" For 64 Bit UsersThis is the same apart from using the following first two steps: wget "http://de.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-17ubuntu1_amd64.deb" For Lucid: Need to install Java 6 for the installer: sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" For Natty: sudo ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib64/libgcc_s.so.1
Add user/groupssudo groupadd oinstall 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 Parameterssudo gedit /etc/sysctl.conf Add: kernel.shmall = 2097152 And reload with: sudo /sbin/sysctl -p
Change Limitssudo gedit /etc/security/limits.conf Add the following to the end * soft nproc 2047
Suse-ise the Environmentsudo ln -s /usr/bin/awk /bin/awk
Update default profilesudo gedit /etc/profile Add the following to the end: export ORACLE_BASE=/oracle Double check... su - oracle
Redhat-ise Ubuntusudo gedit /etc/redhat-release Add this : Red Hat Enterprise Linux AS release 3 (Taroon) Unpack the Downloaded FileGo to where you put the downloaded file and... mkdir oracle_install For 64 Bit Usersmkdir oracle_install The unzipping operation creates a subdirectory. Make this available to the Oracle user: cd .. At this point you are ready to start installing Oracle...!
Run the Graphical InstallerTo 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://excession.org.uk/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 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 DBIt'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 DatabaseFirst, 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 Friday, 22 July 2011 11:42 |





Comments
This also works for Oracle 11g on Karmic Koala.
For 11g note that the installer will report missing libraries, however if you set the libraries up as indicated in the guide, the subsequent linking step will indeed succeed.
Thanks again. Quote
To fix:
Option 1: Turn off Compiz
meta-city —replace
Option 2: Make Oracle use Java6 (tested and works with dbca, haven't tested with other tools)
cd $ORACLE_HOME/bin/jdk/jre/bin
mv ./java java.old
ln -s /usr/lib/jvm/java-6-sun/jre/bin/java java Quote
What happens when you try to start Oracle…? DBCA is just used to set-up a new database rather than to start Oracle. You will need to continue to the second part of the guide to actually start Oracle. Quote
What I mean is that I can't finish the dbca installer. After getting the confirmation window (database called orcl10 will be created - with the options that I selected displayed below) and clicking ok, the installer returns me to the main screen. Subsequently clicking on finish button again produces no results. We’ve installed oracle before, but always on Windows OS with no problems. My DBA says that I should get another window (progress bar?) but my X11 client doesn’t forward anything new and there is no activity. Quote
Got mad and installed entire GUI on server - it seems my xserver Windows client (Xming) didn't forward the final oracle installer screen progress bar.
Now I’m stuck with another problem (and Google seems to indicate that it’s quite common):
Failed to allocate port(s) in the specified range for the following process(es): JMS 5540-5559,RMI 5520-5539,Database Control 5500-5519,EM agent 1830-1849
These ports are not used, and /etc/sysctl.conf has the correct range. Quote
This is what I was going to suggest.
Quoting Emperor:
Have you made sure you reloaded with /sbin/sysctl -p…? (Obvious question, I know…) Quote
This is what I was going to suggest. Its usually the best way, although a hassle.
Quoting Emperor:
Have you made sure you reloaded with /sbin/sysctl -p…? (Obvious question, I know…) Quote
RSS feed for comments to this post.