Link to home
Start Free TrialLog in
Avatar of javi2
javi2

asked on

Pro*C/C++ Execution problem...

Hi,

I created a program with Pro*C/C++ to connect with ORACLE.. It's run OK as when i use oracle user to execute it...

I added the following enviroment variables to nobody user:
LD_LIBRARY_PATH=/usr/local/oracle/app/product/8.0.6/lib
ORACLE_BASE=/usr/local/oracle
ORACLE_HOME=/usr/local/oracle/app/product/8.0.6
ORACLE_SID=USADOS

But when i try to execute with other username  (nobody) i get the next error:
Can't find libclntsh.so.1.0 library...

I copied libclntsh.so.1.0 to /lib but i get a lot of errors like:
ORACLE error--
 Error while trying to retrieve text for error ORA-12547

nobody user can execute sqlplus and connect to oracle with next problems:

Error accessing PRODUCT_USER_PROFILE
Warning:  Product user profile information not loaded!
You may need to run PUPBLD.SQL as SYSTEM

Can anyone help me!
Regards...
Avatar of cadabra
cadabra

1. Which platform are you running your program on (OS / Oracle version)?
2. What error messages are you getting (interactively, and in sqlnet.log) ?
3. Can you connect to the "nobody" user with sql*plus ?
As cadabra commented please give us a clear picture where the
file resides and how your trying to fire it. Does the user  
(nobody) having acess to all the tables your using in the pro*c.

What are all the error messages u get when u run the exe.
Avatar of javi2

ASKER

Edited text of question.
===================================================================================
> nobody user can execute sqlplus and connect to oracle with next problems:

> Error accessing PRODUCT_USER_PROFILE
> Warning:  Product user profile information not loaded!
> You may need to run PUPBLD.SQL as SYSTEM

This is'nt a problem. If you run the pupbld.sql script as user system, this will go away ...

Which Unix are we talking about  ?

Can you post all the environment variables and their values as defined in the Oracle unix user account ?

Which shell is defined for the Oracle unix account, and which for the nobody unix account ?

Note: Please don't edit the text of the question, but rather post comments with additional information, so that everyone may follow the history of the discussion .
The problem is only with environment setup.
You will have to login in to oracle as system and run PUPBLD.SQL  .

And set the enviroment for the user  nobody. This should solve your problem.
Avatar of javi2

ASKER

Unix --> Solaris 6

My oracle user as next enviroment variables...
LD_LIBRARY_PATH=/usr/local/oracle/app/product/8.0.6/lib
ORACLE_BASE=/usr/local/oracle
ORACLE_HOME=/usr/local/oracle/app/product/8.0.6
ORACLE_SID=USADOS
TNS_ADMIN=/usr/local/oracle/app/product/8.0.6/network/admin
LD_LIBRARY_PATH=/usr/local/oracle/app/product/8.0.6/lib

and uses /bin/sh shell

nobody user uses tcsh shell and i added all enviroment variables to nobody user like oracle user...

When i execute a Pro*C/C++ program in nobody shell it works fine...
but when i use the program like a apache CGI i get next error from sql_error()

ORACLE error--
Error while trying to retrieve text for error ORA-12547

Manual says TNS connection is broken...
Run a CGI script in apache that displays all the environment variables it sees and their values, and post them as a comment.

Avatar of javi2

ASKER

Hi,,
This are server variables:

SERVER_SOFTWARE: Apache/1.3.3 (Unix) mod_perl/1.16
DOCUMENT_ROOT: /data/imail/httpd/htdocs
GATEWAY_INTERFACE: CGI-Perl/1.1
REMOTE_ADDR: 212.66.181.89
SERVER_PROTOCOL: HTTP/1.0
SERVER_SIGNATURE:
REQUEST_METHOD: GET
QUERY_STRING:
HTTP_USER_AGENT: Mozilla/4.7 [en] (WinNT; I)
PATH: /bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin
TZ: US/Eastern
HTTP_CONNECTION: Keep-Alive
HTTP_ACCEPT: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
REMOTE_PORT: 64257
LD_LIBRARY_PATH: /data/imail/lib:/data/imail/lib:/data/imail/lib
MOD_PERL: 1.16
HTTP_ACCEPT_LANGUAGE: en
SCRIPT_NAME: /cgi-bin/login/env.cgi
SCRIPT_FILENAME: /data/imail/httpd/cgi-bin/login/env.cgi
HTTP_ACCEPT_ENCODING: gzip
SERVER_NAME: sun00838.dn.net
REQUEST_URI: /cgi-bin/login/env.cgi
HTTP_ACCEPT_CHARSET: iso-8859-1,*,utf-8
NLSPATH: /data/imail/lib/nlslib/%L/%N.cat:/data/imail/lib/nlslib/%L/%N.cat
SERVER_PORT: 82
PERLHOME: /data/imail/perl
HTTP_HOST: 209.207.236.62:82

I don't have ORACLE environment variables, how can i had to user?!?
ASKER CERTIFIED SOLUTION
Avatar of cadabra
cadabra

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of javi2

ASKER

OK...

I'm using putenv at C programm, it's works fine...

Cadabra i want accept you the question...
You can use "accept comment as answer option" ...
kkooty changed the proposed answer to a comment