1. Joan Rhoda
  2. PowerBuilder
  3. Wednesday, 2 March 2022 20:12 PM UTC

I am running PowerBuilder 2019 R2 Build 2353.  I cannot Connect to any of my databases, nor can I Connect to them when I click Run to run the application.  In both instances, I get the following database error:  ORA-12154 TNS could not resolve the connect identifier specified.  Here is the connection syntax:

// Profile MACDEVC
SQLCA.DBMS = "ORA Oracle"
SQLCA.LogPass = <********>
SQLCA.ServerName = "MACDEVC"
SQLCA.LogId = "myloginid"
SQLCA.AutoCommit = False
SQLCA.DBParm = ""

There are a few times when it connected, but most of the time it does not connect.  My network is stable when this happens so it does not appear to be network-related.

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 3 March 2022 06:35 AM UTC
  2. PowerBuilder
  3. # 1

Do you have more than one oracle client installed? (also: 32 bit / 64 bit or both?)

What's the value of the TNS_ADMIN environment variable (if that's been set)? If it's not been set, then do so. Set the path to the folder where your correct tnsnames.ora file is located. Make sure the "MACDEVC" tns name is present in that file.

Check you PATH and make sure the correct oracle client is being found before any other clients.

regards

Comment
There are no comments made yet.
Joan Rhoda Accepted Answer Pending Moderation
  1. Thursday, 3 March 2022 13:06 PM UTC
  2. PowerBuilder
  3. # 2

What exactly do you mean by Oracle Client?  I do have 2 folders on my C drive, Oracle and Oracle_32.  When I had my computer replaced, they installed Oracle_32 but left the Oracle folder which only has SQLDEVELOPER in it.  Could having 2 Oracle folders cause this problem?

Comment
  1. Miguel Leeuwe
  2. Thursday, 3 March 2022 13:41 PM UTC
The "Oracle client" is what you have to install to have native access to an Oracle database. It's the runtime.

SqlDeveloper will work without it because it'll probably use JDBC to connect. See: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/ntcli/install-oracle-database-client.html

regards
  1. Helpful
There are no comments made yet.
Joan Rhoda Accepted Answer Pending Moderation
  1. Thursday, 3 March 2022 14:12 PM UTC
  2. PowerBuilder
  3. # 3

I really appreciate your help!  Under the Start Menu I have 1 Oracle client.  There's a folder named OraClient12Home1_32 bit.

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 3 March 2022 20:53 PM UTC
  2. PowerBuilder
  3. # 4

Open a command shell (run: cmd) and try to see what happens if you type:

tnsping MACDEVC

Is it finding your database instance? Is it 32 or 64 bit? (that will show in the output when running the command).

And let me repeat my previous comment:

What's the value of the TNS_ADMIN environment variable (if that's been set)? If it's not been set, then do so. Set the path to the folder where your correct tnsnames.ora file is located. Make sure the "MACDEVC" tns name is present in that file.

Check you PATH and make sure the correct oracle client is being found before any other clients.

If you have any IT that could help you setup correctly, that would be the preferred way of going I think.

I cannot access your PC. Also what doesn't make any sense at all is that you say that it connects "sometimes" and that your network connection is fine.

regards.

 

Comment
There are no comments made yet.
Joan Rhoda Accepted Answer Pending Moderation
  1. Thursday, 3 March 2022 21:17 PM UTC
  2. PowerBuilder
  3. # 5

Here is a screenshot of running tnsping MACDEVC:

I do not know how to determine the TNS_ADMIN variable.  Can you provide instructions?

Where do I set the path to the tnsnames.ora file?  And where would I find this tnsnames.ora file?

I know it doesn't make sense that I said it connects sometimes, but my network is fine.  What I meant was that even when I get this TNS unable to resolve connect identifier error in PowerBuilder, I can still access MACDEVC with PL/SQL Developer.  Thanks so much for your help!  

 

 

Comment
  1. Miguel Leeuwe
  2. Thursday, 3 March 2022 21:24 PM UTC
in the same command shell you type:

set tns_admin

That should show you the path that's set (IF it's been set).

So this looks promising, at least you have a 32 bit client for Oracle installed and it's finding your tns name of "macdevc".

I don't know if anybody else can see anything in these results what looks wrong?

Maybe things could improve if you'd change some setting in the sqlnet.ora file, but I'm not sure. It seems like it should work, so I'm suspecting that in the end, maybe - even if your network connection is working fine - there'd be some connection problems on the server itself.

Please get your IT dept. involved (if you have one).

regards.
  1. Helpful
There are no comments made yet.
Joan Rhoda Accepted Answer Pending Moderation
  1. Friday, 4 March 2022 14:19 PM UTC
  2. PowerBuilder
  3. # 6

I'm working with a PowerBuilder expert on my Team, but your help has been much appreciated.  Apparently, we do not use TNS.  We use LDAP now.  I actually don't have a tnsnames.ora file in my network/admin folder.  Also, my sqlnet.ora file is outdated.  It references an older Oracle release.  I need to run as an Administrator to copy my co-worker's sqlnet.ora to my computer to bring it up-to-date. By the way, I ran TNS_ADMIN and it said "TNS_ADMIN not defined."  

Comment
  1. Miguel Leeuwe
  2. Friday, 4 March 2022 17:18 PM UTC
Hi,

The command that should have run was "SET tns_admin", but since you say you're not using tns, I guess that's no longer needed.

LDAP? I'm not very familiar, does that mean you use integrated login with Active Directory? With SQLServer it's easy, but I'm not sure about Oracle. Try not specifying any user nor password in your sqlca connection.

Maybe someone else knows more about this.

regards
  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 4 March 2022 17:20 PM UTC
Can you get a working connection from the PB IDE? If so, then go to the connection's Preview tab: there you'll see all the sqlca parameters you should / could use to connect.

  1. Helpful
There are no comments made yet.
Joan Rhoda Accepted Answer Pending Moderation
  1. Friday, 4 March 2022 17:47 PM UTC
  2. PowerBuilder
  3. # 7

With the help of the OIT Help Desk I was able to update my sqlnet.ora file which contained a reference to an older release of Oracle that was no longer on my computer:  

NAMES.DIRECTORY_PATH=(LDAP, TNSNAMES, EZCONNECT, ONAMES, HOSTNAME)

SQLNET.AUTHENTICATION_SERVICES=(NTS)

LOG_DIRECTORY_CLIENT=C:\oracle\product\11.2.0\client_1\network\log

LOG_FILE_CLIENT=sqlnet_log

SQLNET.EXPIRE_TIME=5

TRACE_DIRECTORY_CLIENT=C:\oracle\product\11.2.0\client_1\network\trace

At least now my version is the same as others on my team, although that may not be the cause of the TNS error.  My guess is that I have lots of blips in my network which causes the problem.  Restarting my machine and re-connecting through Pulse Secure and re-mapping my drives usually fixes the problem.  Your prompt responses were very much appreciated.  Thank you!

Comment
  1. Miguel Leeuwe
  2. Friday, 4 March 2022 17:51 PM UTC
Haha! Well ... although I'm not sure if any of the things I told you were that helpful, I'm really happy you got to solve the problem (hopefully) ! I mean, why is it lookng for TNS connection if it's not supposed to?



best regards,

MiguelL
  1. Helpful
There are no comments made yet.
Joan Rhoda Accepted Answer Pending Moderation
  1. Friday, 4 March 2022 17:57 PM UTC
  2. PowerBuilder
  3. # 8

That is the question of the hour!  Haha.  It would be nice if the error message was more user-friendly and gave a bit more information.

Comment
There are no comments made yet.
bharathi shetty Accepted Answer Pending Moderation
  1. Wednesday, 9 August 2023 07:40 AM UTC
  2. PowerBuilder
  3. # 9

// Profile data_changes
SQLCA.DBMS = "ORA Oracle"
SQLCA.LogPass = <***********>
SQLCA.ServerName = "CTL-SERVER"
SQLCA.LogId = "GLARP"
SQLCA.AutoCommit = False
SQLCA.DBParm = "PBCatalogOwner='GLARP'"

 

here it is connecting thru database profile. but not connecting thru powerbuilder script giving TNS connect error.

I tried putting connectstring also but still it not working givng the same error.

we have lot of client IPadress to connect to the same server. 

how to connect to the client ipadress aceesing to same server.

Comment
  1. Miguel Leeuwe
  2. Wednesday, 9 August 2023 08:04 AM UTC
I don't understand. Are you posting on the correct question?

Maybe you should make a new one for your case?

regards.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.