Operating System - HP-UX
1748058 Members
5062 Online
108758 Solutions
New Discussion юеВ

Re: Application cannot connect to DB : ORA-12158

 
Beat BUCHER
Occasional Advisor

Application cannot connect to DB : ORA-12158

Hi all,
I upgraded an HP-UX 11.x system (L2000 ) to oracle 8.0.6.2 and applied several patches to the apps (recommandation ot EHPT). After the upgrade, the apps was no longer able to connect ot the DB. Oracle pmon and TNS listener are started...Bellow the informations that could be useful. TIA if anybody could help me out of that pb.

The Error message from the application :

-------------------------------------------------------------------------------
Time: 2001/09/05 15:48:50, Category: DISASTER, Binary Name: bsrbin (5382)
- BMP Server encountered error and could not be prepared for start, will terminate. (68170728, 4, 1, 3, 1000)
- Unable to establish contact with the database. (51393517, 3, 1, 3, 1005)
- Was unable to log on to DB server bmpa. [SERVERERROR] Error from Server: ORA-12158: TNS:could not initialize parameter subsystem
(59790412, 3, 9, 5, 1100)
-------------------------------------------------------------------------------

Oracle TNS config files :

#
# Installation Generated Net8 Configuration
# Version Date: Jun-17-97
# Filename: Listener.ora
#
# the next line was inserted by lmcbebu @ sept 6th 2001
USE_PLUG_AND_PLAY_LISTENER = ON
#
LISTENER =
(ADDRESS_LIST =
(ADDRESS= (PROTOCOL= TCP)(Host= 127.0.0.1)(Port= 1521))
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME= localhost)
(ORACLE_HOME= /opt/app/oraclea)
(SID_NAME = bmpa)
(PRESPAWN_MAX = 10)
)
(SID_DESC =
(ORACLE_HOME= /opt/app/oraclea)
(SID_NAME = bmpa)
)
)
STARTUP_WAIT_TIME_LISTENER = 0
CONNECT_TIMEOUT_LISTENER = 10
TRACE_LEVEL_LISTENER = ON


#
# Installation Generated Net8 Configuration
# Version Date: Oct-27-97
# Filename: Tnsnames.ora
#
extproc_connection_data =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = bmpa ))
(CONNECT_DATA = (SID = extproc))
)

bmpa =
(DESCRIPTION =
(ADDRESS = (PROTOCOL= TCP)(Host= localhost)(Port= 1521))
(CONNECT_DATA = (SID = bmpa))
)
6 REPLIES 6
Volker Borowski
Honored Contributor

Re: Application cannot connect to DB : ORA-12158

Hi Beat,

I assume your application runs on the database server ?!?

As the OS-User, that starts the application, try "tnsping bpma", and let us have the output.

"lsnrctl status" as oracle user should give you a path to log and tracefiles. Any errors in there ?

What was your oracle starting release for the upgrade ?

Volker
Beat BUCHER
Occasional Advisor

Re: Application cannot connect to DB : ORA-12158

Hi Volker,
I installed the Oracle 806 from scratch (cd image on disk) through the orainst proc. As you requested, here the ouput of the tnsping "bmpa" and the lsnrctl status :

oraclea@zurich - /opt/app/oraclea -> tnsping bmpa

TNS Ping Utility for HPUX: Version 8.0.6.2.0 - Production on 06-SEP-2001 12:27:39

(c) Copyright 1997 Oracle Corporation. All rights reserved.

Attempting to contact (ADDRESS=(PROTOCOL=TCP)(Host=localhost)(Port=1521))
OK (90 msec)
oraclea@zurich - /opt/app/oraclea ->
oraclea@zurich - /opt/app/oraclea -> lsnrctl status

LSNRCTL for HPUX: Version 8.0.6.2.0 - Production on 06-SEP-2001 12:28:44

(c) Copyright 1999 Oracle Corporation. All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=TCP)(Host=127.0.0.1)(Port=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for HPUX: Version 8.0.6.2.0 - Production
Start Date 06-SEP-2001 12:28:42
Uptime 0 days 0 hr. 0 min. 2 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /opt/app/oraclea/network/admin/listener.ora
Listener Log File /opt/app/oraclea/network/log/listener.log
Services Summary...
bmpa has 2 service handler(s)
The command completed successfully
oraclea@zurich - /opt/app/oraclea ->
Volker Borowski
Honored Contributor

Re: Application cannot connect to DB : ORA-12158

Hi Beat,

that looks OK, but you tried it as oracle user.

The application runs obviously with a diffrent user. Now this user tries to connect to the database with the application. But it can not connect, because it can not find the SQL-NET-Configuration.

This is from DOC-CD:

TNS-12158 TNS:could not initialize parameter subsystem
Cause: Unable to locate parameter file.
Action: Verify that a valid parameter file exists, and is readable.

Now oraclea is the owner of the oracle SW and has all the environment settings to locate the files, this is why tnsping works.

The other user might need some environment variables set to locate these files.
like
ORACLE_HOME
ORACLE_SID
and may be
TNS_ADMIN

Check the environment of the application user.
Hope this helps
Volker
Beat BUCHER
Occasional Advisor

Re: Application cannot connect to DB : ORA-12158

Hi Volker,
Thanks for the tip, but still doen't help. I've tested the tnsping and the lsnrctl status both with the apps-user account. Output is exactly the same as with Oracle account... Any other hint ? In my quest for a solution, I'm on the way to fire the tnslistener from the system. The reason is that the apps and the DB-server are on the same system, and therefore we don't need the TNS-listener... but the application should listen on it's own tcp-port to find connection to the Database. So actually, I've several ports defined in the /etc/services file for the apps core, but the system seems not listening on these ports .... (see output ot netstat -an):
/etc/services
[...]
#
# Ports used by BMP
#
bmpsrva 5001/tcp
filsrva 5002/tcp
interbmpa 5003/tcp
bmppps 5007/tcp
mtpinta 5014/tcp
#
# Ports used by Initiator
#
bmpsrvb 5101/tcp
filsrvb 5102/tcp
interbmpb 5103/tcp
mtpintb 5114/tcp
bmpwebagent 5015/tcp
listener 1521/tcp
[..]

The output for the port 5001 should be the same as for 5001 :
root@zurich - / -> netstat -an | grep 5101
tcp 0 0 142.133.4.93.50215 142.133.4.93.5101 ESTABLISHED
tcp 0 0 *.5101 *.* LISTEN
tcp 0 0 142.133.4.93.5101 142.133.4.93.50215 ESTABLISHED
root@zurich - / -> netstat -an | grep 5001
root@zurich - / ->
ajax13
Frequent Advisor

Re: Application cannot connect to DB : ORA-12158

Hi,
Can you connect to the database using sqlplus?
If not check the sqlnet.ora file, should be in the same directory as listenr.ora file, I doubt this is the problem. My guess is the application is using some type of driver to connect to the db (such as ODBC), maybe this broken or need to make sure it is pointing to this databse.

Thanks
Beat BUCHER
Occasional Advisor

Re: Application cannot connect to DB : ORA-12158

Thanks all for your help,

I've found out finally where the problem. Although the application tends to return everytime the error message ORA-12158, it has nothing related to the TNS-listener. In fact the problem resides in outdated binaries of the application that where not able to access the new Database engine ORA 806 (since the was ugraded from 805).