1. I have PB application that connects to oracle. it runs on windows 2000. i want to migrate to windows XP.
It has service name like "ISSWEB". How does the PB executable get teh connection infromation from oracle TNSNAMES.ORA file in the oracle home directory? is it hardcoded in libraries or does it read the connection info from the file every time.
2. I want to switch the file from under oracle home to a network drive i map to. If i change the TNS_ADMIN path would powerbuilder automatially look up that other directory for connection info or we have to recompile the application.
Editors IDEsOracle Database
Last Comment
mrjoltcola
8/22/2022 - Mon
mrjoltcola
The Oracle network library uses tnsnames.ora on the fly, every lookup. Its like a hosts file for DNS lookup equivalent to IP addresses. Changing it goes into effect immediately.
Yes, if you change TNS_ADMIN it should work from any location. Its been a while but I'm pretty sure we put it on a network share at one customer in the past.
sam15
ASKER
But how does the PB runtime communicate with oracle library. do you know the mechanics?
We did try set TNS_ADMIN = y:\ but it did not work.
mrjoltcola
First, use TNSPING to make sure you are getting Oracle client configured right.
From the command window that you set the TNS_ADMIN variable in...
Try: tnsping ISSWEB
If you get resolution, is it where you moved it to, or the old address?
If it seems to be using the old tnsnames.ora, try changing the IP address in the copy that you know Powerbuilder is accessing first, just to verify.
Are you sure that Powerbuilder is using the TNS alias? It could be setup to use a full TNS connect string, which includes the hostname, port, etc. Or it could be using an ODBC connection.
I thin powerbuilder is using TNS alias. How do you verify this from runtime? os you need the IDE for this.
when you do TNSPING ISSSWEB does it lookup TNS_ADMIN to see where the tnsnames.ora file is and resolve teh service name
mrjoltcola
Did you try tnsping as requested?
The purpose of using tnsping is to verify your services. Forget the PB application for now, just verify which service and which file is being used. When you run tnsping, it will print out which sqlnet.ora file it is using, which will also tell you which TNS_ADMIN directory it is using.
sam15
ASKER
yes i did.
it is using the one under oracle home. If i changed TNS_ADMIN then it wont find it.
If we copied TNSNAMES.ora to p:\ do we have to copy SQLNET.ora with it too.
I copied the TNSNAMES.ORA to c:\temp.
I did SET TNS_ADMIN=C:\TEMP
I took out the entries for ISSWEB from that file. I did TNSPING on the service name and it showed me that sqlnet.ora was still under oracle home but the service name was not found.
So the sqlnet.ora does not seem to tell you where it is looking for service name.
Then I ran sql*plus for that service name and it worked. I tried the PB application and it worked. How do you explain this. You can try that.
mrjoltcola
You should move all .ora to the TNS_ADMIN, just not tnsnames.ora
Then you need to set TNS_ADMIN permanently, go to My Computer -> Properties -> Advanced -> Environment Variables to set it.
sam15
ASKER
yes, i will try that.
but do you know the mechanics of how PB executable/runtime talks to oracle. The EXE refers to an oracle service name. I assume something in PB talks to oracle client which in turns searches for the file.
1. I have PB application that connects to oracle. it runs on windows 2000. i want to migrate to windows XP.
It has service name like "ISSWEB". How does the PB executable get teh connection infromation from oracle TNSNAMES.ORA file in the oracle home directory? is it hardcoded in libraries or does it read the connection info from the file every time.
> service name ISSWEB might be hardcoded in your application or may be somewhere stored in ini file of applicaiton or in registery. It depends on how code is written. If create an entry in your tnsname with the same name then there is no need to change PB code. Your code should be using Oracle Native Drivers for connection to oracle and hence it looks for the entry in tnsnames.ora.
2. I want to switch the file from under oracle home to a network drive i map to. If i change the TNS_ADMIN path would powerbuilder automatially look up that other directory for connection info or we have to recompile the application.
> As far as service name is available in tnsnames.ora there is no need to recompile the application. Now to place the tnsname in different folder you can try settings as mrjoltcola has explained or see below link
you can also google for 'how to place tnsnames.ora in network'
Hope this will give you idea.
Regards,
Sandeep
mrjoltcola
>but do you know the mechanics of how PB executable/runtime talks to oracle. The EXE refers to an oracle service name. I assume something in PB talks to oracle client which in turns searches for the file
Yes. The Oracle OCI client (libclntsh.so if I recall) is what looks in the TNSNAMES.ORA file for aliases, it is not the PB app that does this, but that is not the only way that database strings are managed. The client will also allow connecting in other ways, like directly with a full TNS string which will skip the TNSNAMES.ORA lookup, or it could be using an ODBC alias of the same name. You have to check for an ODBC config in the normal way, through the ODBC Administrator.
I think the difficulty here is you are asking several things at once, not only how the client lookup works but how to move the TNSNAMES.ORA (TNS_ADMIN). I would simply and just modify the TNSNAMES.ORA file that you already have in the location that works, and verify that the PB app is indeed using that file alias. Then proceed.
Yes, if you change TNS_ADMIN it should work from any location. Its been a while but I'm pretty sure we put it on a network share at one customer in the past.