|Re: Can OCI Program avoid relink during different version of oracle on unix? [message #121421 is a reply to message #121324]
||Sat, 28 May 2005 15:26
Registered: December 2004
Location: West Yorkshire, United Ki...
set your Oracle Home to the 9i installation and link you application to the 9i Oracle libraries.
Edit $ORACLE_HOME/network/admin/tnsnames.ora and create an entry for the 8i database and an entry for the 9i database and an entry for the 10g database.
eg. create tns aliases db8i, db9i, db10g using the following tns entry as an example
then confirm you have correctly created the tns entries
providing you have been able to sqlplus onto each of your databases.
modify your application to read the connection details either from the command line or from a configuration file. I would recommend you read from a configuration file and any users on the Unix system can list the active processes and see your passwords. ( ps -ef | grep <yourappname> )
Within the application modify the connection details to include the dbname eg.
sword OCILogon ( OCIEnv *envhp,
CONST OraText *username,
CONST OraText *password,
CONST OraText *dbname,
ub4 dbname_len );
where you have loaded the username &username,
password in &password
and tns alias into &dbnamme.
Michael Hartley, http://www.openfieldsolutions.co.uk