Applications, CFML, Oracle

Installing ColdFusion and Oracle database 10g on CentOS

Actually there are some installation instructions out there that explain very well how to install ColdFusion 7.x on Linux as well for Oracle on Linux. What prompt me to write this post is that, after following all instructions very elaborately, there are still some issues that remained unsolved.

ColdFusion post installation
Installing ColdFusion 7.0.2 is quite forward. Go to Adobe’s website and download the trial version. Once downloaded you can install the application with

./coldfusion-702-lin.bin

After ColdFusion is installed you should be able to login to the Administration “http://127.0.0.1:8500/CFIDE/administrator”. So far so good, but what I have seen in my latest installation is that when I restarted the machine and when it came to load the “coldfusionmx7″ startup script CentOS just stopped processing. All what was left to do was to restart the machine.
Google comes to the rescue here and after searching for some time I found this blog entry from Steven Erat over at talkingtree.com. After using the runuser entry all worked out fine.

Installing Oracle database 10g R2
Of course, Oracle provides a perfect documentation on installing the 10g R2 release on Linux which you can find it here. So, what is there to write about?
To my surprise, even that the above documentation is very well written, it does not help with installing a Oracle startup script, so you can have the database be up and running the next time you boot, and Oracle does not comment on some important issues to get your database up and running.

Setting permanent Oracle variables
Like I mentioned the Oracle database runs fine right after the installation, but after rebooting there are quite some error messages if you try to start the Oracle database. Most of the problems come from not having the needed Oracle variables set in the shell environment. So what we need to do is to make the variables “stick” during restarts.

Login to your terminal as root and edit the profile file:

vi /etc/profile

There are already some code lines in there so you will need to find the different code fragments and add the following lines to it:

PATH=$PATH:/u01/app/oracle/product/10.2.0/db_1/bin
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1/
ORACLE_SID=orclexport PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTSRC ORACLE_HOME ORACLE_SID

Getting Oracle to automatically startup at startup time
There is another great document by Oracle how to automate the startup of the Oracle database at boot time. The problem I had was that I could not get it to run at all. So, as an alternative I am posting my code here which actually just creates a startup script.

Again in the terminal create a file called “dbora” within the “/etc/init.d/” directory. The content of the file is:

#! /bin/sh -x
#
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
ORACLE_HTTP=/u01/app/oracle/product/10.2.0/db
RUNTIME_USER=oracleexport ORACLE_HOME ORACLE_HTTP RUNTIME_USER

/sbin/runuser -s /bin/sh $RUNTIME_USER -c $ORACLE_HOME/bin/dbstart orcl
/sbin/runuser -s /bin/sh $RUNTIME_USER -c “$ORACLE_HTTP/opmn/bin/opmnctl startall”

#
exit

We assume that you are following the path’s that have been set in the installation instructions by Oracle. Also in the above startup script we automatically startup the Oracle HTTP server from the companion CD as well.

Once done you will have to enable this script during boot time. First of change the owner and permission of the script with:

chgrp dba dbora
chmod 750 dbora

Then create symbolic links in the respective runlevel directories with:

ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/K01dbora
ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/K01dbora
ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora

Known problem with the dbstart script
When you run the dbstart script you will see that there is an error message or the database does not run at all. According to some sources this is a known problem with the installer, in that the installer is using a hard coded path within the script. You have to change the line

ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle

to

ORACLE_HOME_LISTNER=$ORACLE_HOME

Running all of the above within a Parallels Virtual Disk on MacOS X
All of the above has been done on a MacOS X machine with Parallels for Mac installed. One word about Parallels and CentOS. We did the installation as a RedHat Linux distro and all worked out fine, but you need to chose to use the EL kernel and not the SMP one. If you chose to use the SMP kernel then CentOS will not even start within Parallels!

Share and Enjoy:
  • Facebook
  • Digg
  • TwitThis
  • Sphinn
  • del.icio.us
  • Mixx
  • Google
  • MisterWong
  • StumbleUpon

If you enjoyed this post, make sure you subscribe to the RSS feed!

Add Your Comment

speak up

Add your comment below, or trackback from your own site.

Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*Required Fields

nitai@sixsigns.com