Hey josh, Sorry I didn't get back to you sooner (I know you emailed me, I
just braincramped yesterday)

Here are the notes I gave out at Devcon about oracle connectivity, as well
as some other notes:

Slide 23:

ColdFusion won't start, or my database drivers won't work!
Library Files
Most of the time, a lot of these problems are library related. You can check
to see you have the needed libraries for 'x' by going into the directory
containing 'x' and typing:

[root@noller2 bin]# ldd cfexec
        libcfdataaccess.so => /usr/lib/coldfusion/libcfdataaccess.so
(0x40018000)
        libporting.so => /usr/lib/coldfusion/libporting.so (0x400a5000)
        libdl.so.2 => /lib/libdl.so.2 (0x40133000)
        libpthread.so.0 => /lib/i686/libpthread.so.0 (0x40137000)
        libstdc++-libc6.1-1.so.2 => /usr/lib/libstdc++-libc6.1-1.so.2
(0x4014c000)
        libm.so.6 => /lib/i686/libm.so.6 (0x4018e000)
        libc.so.6 => /lib/i686/libc.so.6 (0x401b2000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

LDD will display the library files required for the binary, library or file
to operate. If you are missing any of them, generally, things will not work.
Please check the LDD manpage, and email [EMAIL PROTECTED] with
questions.


Slide 26:

Configuring Database Drivers - Oracle
Oracle Native/ODBC Drivers
In order to configure the Native and ODBC Oracle drivers on Linux, you will
need to download the Oracle Client version 8.1.6.1 or higher.
NOTE: The catch is that you MUST make sure that the
$PATH/oracledir/network/admin/tnsnames.ora file is configured properly. This
must be configured using the Oracle configuration utility. 
        An example tnsnames.ora file:

# TNSNAMES.ORA Configuration File:/u01/app/oracle/network/admin/tnsnames.ora
# Generated by Oracle Net8 Assistant

e450 =
  (DESCRIPTION =
    (ADDRESS_LIST =
        (ADDRESS = 
          (PROTOCOL = TCP)
          (Host = 10.1.1.50)
          (Port = 1521)
        )
    )
    (CONNECT_DATA = (SID = E450)
    )
  )



>From the Manual:

ODBC Info:

To build a version of libclntsh.so for Oracle 8.0.4 and 8.0.5: 
>From the shell, set ORACLE_HOME, CFHOME, and LD_LIBRARY_PATH as set in the
start script: 
Set ORACLE_HOME to the location of the Oracle client libraries. 
Set CFHOME to the location of your ColdFusion application server. 
Set LD_LIBRARY_PATH the same as in your start script. 
For example:

CFHOME=/opt/coldfusion;export CFHOME

ORACLE_HOME=/opt/oracle8;export ORACLE_HOME

LD_LIBRARY_PATH=/lib:/usr/dt/lib:/usr/openwin/lib:$CFHOME/lib:$ORACLE_HOME/l
ib;export LD_LIBRARY_PATH 

>From $CFHOME/odbc/src/oracle run the script./genclntsh8. 
The script generates a new libclntsh.so in CFHOME; move it to $CFHome/lib. 


Note

Oracle 8 users have the original libclntsh.so library in the
$ORACLE_HOME/lib directory. Therefore when creating the LD_LIBRAY_PATH in
the $CFHOME/bin/start script, the $CFHOME/lib directory, containing the
correct library, must be on the LD_LIBRARY_PATH before $ORACLE_HOME/lib.
Otherwise, the original Oracle version loads, resulting in an error.
 

The HOW-TO:

Connecting to Oracle 7.3.4 and 8.0.x databases (UNIX) 
Before ColdFusion applications can connect to Oracle 7.3.4 and 8.0.x
databases, you must install the Oracle client software. 

You need to modify the /opt/coldfusion/bin/start script to include the
ORACLE_HOME environment variable and add the $ORACLE_HOME/lib directory to
the LD_LIBRARY_PATH. For an example, see "The /opt/coldfusion/bin/start
script" on page 132. You must edit the $CFHOME/bin/start script for all
versions. The environment variable LD_LIBRARY_PATH must point to the
directory containing the libclntsh.so file, which ColdFusion uses. 

If the libclntsh.so file was built in the $CFHOME/lib using a script that
you downloaded from http://www.coldfusion.com, then the LD_LIBRARY_PATH
variable should contain an entry for $CFHOME/lib prior to the entry for
$ORACLE_HOME/lib, for example: 

LD_LIBRARY_PATH =
$CFHOME/lib:$ORACLE_HOME/lib:other_database_library_paths...
If the libclntsh.so file is in $ORACLE_HOME/lib, then you need just the
single entry for this directory, for example: 

LD_LIBRARY_PATH = $ORACLE_HOME/lib:other_database_library_paths...

Note

The readme.ora file in $CFHOME/odbc/src/oracle incorrectly refers to $CFHOME
as $ODBC_HOME. 
 


Verify the following: 

You can connect to the Oracle server from Solaris with sql*plus before you
try to connect from ColdFusion. 
You are running the Oracle listener. 
You have set up a tnsnames.ora file. For Oracle 7.3.4, it is in the
/var/opt/oracle directory. 
Example 
This is an example of a tnsnames.ora file: 

scup=
  (DESCRIPTION=
    (ADDRESS=
      (PROTOCOL=TCP)
      (HOST=scup)
      (PORT=1521))
    (CONNECT_DATA=(SID=WG73)))

The following table describes the code:  Code Description 
scup=
 Setting for the connect string name in the ColdFusion Administrator.
 
HOST=scup 
 The IP address, as in HOST=205.185.22.33.
 
PORT=1521
 Port that the tcp listener is assigned to. You can look at the
/etc/services file of the UNIX machine where the Oracle server resides to
identify it.
 
SID=WG73
 Database identifier. See your Oracle administrator. These settings are
configured when you install the database.
 


When you complete all the steps in this section, you must stop and restart
ColdFusion services to reload the odbc.ini file. 

The /opt/coldfusion/bin/start script 
#!/bin/sh
# start - setup environment and run ColdFusion servers
# This script should be run as root.
# Set during install 
CFHOME=/opt/coldfusion
# Sybase Open Client directory
SYBASE=/work/sybclient11.1
# Oracle SQL *Net RDBMS directory
# See CFHOME/odbc/src/oracle for script to build library
ORACLE_HOME=/opt/oracle7
# Set library search path
#
# NOTE: Add your database client library directory to the FRONT of this list
#
# Example: 
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$SYBASE/lib:/usr/dt/lib:/lib:/usr/openwin/l
ib:$CFHOME/lib
# This is the list of variables that ColdFusion will see
# Add any special Database environment varaibles here
VAR_LIST="LD_LIBRARY_PATH CFHOME SYBASE ORACLE_HOME INFORMIXDIR
INFORMIXSERVER II_SYSTEM"

#==========================================================
# You should not need to touch anything below this point
#==========================================================

The environment variables CFHOME and ORACLE_HOME are assumed to point to the
ColdFusion installation directory (usually /opt/coldfusion) and the Oracle
Client Software installation directory (for example, /opt/oracle8). 

Use the genclntsh script provided by Oracle in the $ORACLE_HOME/rdbms/lib
directory and follow the Oracle instructions to build the libclntsh.so
library in the $ORACLE_HOME/lib directory. 

Oracle troubleshooting 
If ColdFusion cannot establish a connection to the Oracle 7.3.4 driver, try
the following workarounds: 

Move the location of the ORACLE_HOME/lib to the end of the LD_LIBRARY_PATH
in the start script. 
Make sure that the listener port number is the same one that you are
pointing to in the tnsnames.ora file. 
Check in the $ORACLE_HOME/lib directory for the libclntsh.so file. If it
does not exist, you must reinstall the Oracle client software. 
If the basic information that you entered in the Oracle Net8 Easy Config is
correct, but the connection test fails, then seek assistance from your
Oracle 8 database administrator (DBA). You should first check the basic
connection information: hostname, SID, username, and password. You can do
this using the Net8 Easy Config utility or by directly inspecting the
tnsnames.ora file. 

In addition, on UNIX, make sure that you defined the Oracle client library
and ORACLE_HOME in the coldfusion/bin/start script. 

========================
Jesse Noller
Linux Fiend
Macromedia Server Development
[EMAIL PROTECTED]

"Information may want to be free, but fiber
optic cable wants to be a million US dollars per mile."  --Shawn McMahon

> -----Original Message-----
> From: Josh Freeman [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 31, 2001 9:29 AM
> To: CF-Linux
> Subject: Howto for ColdFusion and Oracle on Linux?
> 
> 
> Greetings,
>       Is anyone aware of a howto on connecting Coldfusion to 
> Oracle in Linux? 
> I'm running Oracle 8.1.7  client and Coldfusion 5 on a SuSE 7.1 box. 
> I've got the environment set up so that I am able to connect to the 
> database from the command line, but I cannot make the connection from 
> Coldfusion. I'm thinking it possibly has something to do with not 
> knowing where to set the ORACLE_HOME environment variable so that the 
> ColdFusion process can find it. I tried setting it in the coldfusion 
> start script, but that didn't work for some reason. Any help would be 
> appreciated.
> 
> 
> Thanks,
> 
> Josh Freeman
> 
>       
> -- 
> Josh Freeman
> Technical Manager
> Center for Assistive Technology and Environmental Access
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-linux%40houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_linux or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to