Operating System - HP-UX
1752647 Members
5628 Online
108788 Solutions
New Discussion юеВ

Re: Database Connection Error in ProC Program

 
Curtis Deese
Frequent Advisor

Database Connection Error in ProC Program

I am using HP-UX 11.31 Itanium, cc, and the ProC precomipiler. When I run one of our programs, I get the error below when trying to connect to the database. The username, password, and database server are correct. When running a different one of our programs with the same username, password, and database server in the same environment, I do not have any connection problems with the exact same CONNECT command. Here is the CONNECT command in the code:

EXEC SQL CONNECT :user_id IDENTIFIED BY :password USING :server_name ;


Here is the error with logging messages:

19938-12:59:28.428-log DRM Server : Started

19938-12:59:28.429-log Database Username: drm_mich2

19938-12:59:28.429-log Database Password: drm_mich2

19938-12:59:28.429-log Database Server: db_mich2

19938-12:59:28.429-log Before call to TableCache in main
19938-12:59:28.429-log Before ConnectToDatabase_i call in TableCache
19938-12:59:28.429-log Entering ConnectToDatabase_i
19938-12:59:28.429-log user_id = 'drm_mich2'
19938-12:59:28.430-log password = 'drm_mich2'
19938-12:59:28.430-log server_name = 'db_mich2'
19938-12:59:28.953-log Unable to connect to SYBASE database (code = -12154; erro
r = Error while trying to retrieve text for error ORA-12154
)

19938-12:59:28.953-log User = drm_mich2, PWD = drm_mich2, SVR = db_mich2
19938-12:59:28.953-log After ConnectToDatabase_i call in TableCache
19938-12:59:28.954-log Unable to connect to database, shutdown the DRM server

19938-12:59:28.954-log Unable to connect to database, shutdown the DRM server.

Why am I getting this database connection error and how do I resolve it?
5 REPLIES 5
Steven Schweda
Honored Contributor

Re: Database Connection Error in ProC Program

I know nothing, but a Web search for, say,
ORA-12154
should find many things.

> [...] Error while trying to retrieve text
> for error ORA-12154 [...]

That sounds to me as if the Oracle stuff
wasn't installed (or configured, or used)
properly.
Hein van den Heuvel
Honored Contributor

Re: Database Connection Error in ProC Program



"Unable to connect to SYBASE "
"error ORA-12154"

Sybase, Oracle or sloppy programmer.

You wrote "When running a different one of our programs with the same username, password, and database server in the same environment,"

Exactly how much the same is that environment?
Exact same login on same box... one command works the other not? Or different login / shell perhaps?

as per my reply to your other topic... KISS.
Step away from the program as a variable factor.
Just try 'sqlplus' or tnsping.
Does that work?

If not, fix that!
If yes, check the Oracle Listener.log file server side.

As Steven remarks .... "Error while trying to retrieve text for error ORA-12154" that suggest that the oracle environment is not properly setup, notably NLS stuff
# env | grep NLS
# env | grep ORA
Compare broken environment with functional one.

Now if it is truly one and the same environment as suggested....

Hope this helps some,
Hein




Jean-Luc Oudart
Honored Contributor

Re: Database Connection Error in ProC Program

Hi

if you try :
sqlplus drm_mich2/drm_mich2@drm_mich2

do you connect to the remote database ?

if not, check listener up and from the client :
tnsping drm_mich2

any positive ?

Regards
Jean-Luc
fiat lux
Curtis Deese
Frequent Advisor

Re: Database Connection Error in ProC Program

I can connect using sqlplus. The 'Unable to connect to SYBASE database' was hardcoded and I changed it. I am using the exact same UNIX user login for both programs. The connection works in one program and not the other.
Curtis Deese
Frequent Advisor

Re: Database Connection Error in ProC Program

The program was being called from another program and starts in a new shell. ORACLE_HOME was not set at runtime. I resolved the problem by setting ORACLE_HOME in the code with the setenv() function.