Home » Developer & Programmer » Forms » TNS problem & TNS admin method (merged)
TNS problem & TNS admin method (merged) [message #341856] Wed, 20 August 2008 10:40 Go to next message
Apps11i
Messages: 14
Registered: August 2008
Junior Member
Hi, I am new to forms and creating a new form for the first time.
when i try connecting to the data base it is giving me the below error message.

ORA-12154: TNS Could not resolve service name.

for the same database i am able to connect using sqlplus, toad and other sql tools.

can anyone please guide me to resolve this. litl urgent it is.

thank you in advance,
Kiran
Re: TNS problem [message #341869 is a reply to message #341856] Wed, 20 August 2008 11:40 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
most likely you now have two different ORACLE_HOME directories.
copy the tnsnames.ora file from the tree which hold Oracle s/w to the tree which supports Forms.
Re: TNS problem [message #341944 is a reply to message #341869] Wed, 20 August 2008 16:13 Go to previous messageGo to next message
Apps11i
Messages: 14
Registered: August 2008
Junior Member
TNS Names there in both the oracle_home and still having the same issue. let me know is there any other way to resolve this issue.

thanx,
Kiran
Re: TNS problem [message #342007 is a reply to message #341869] Thu, 21 August 2008 01:12 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
NO!! NO!! NO!! NO!! NO!!

Will you weenies use the 'tns_admin' method and stop maintaining two copies of the bloody file!

Daivd
Re: TNS problem [message #342514 is a reply to message #342007] Fri, 22 August 2008 10:34 Go to previous messageGo to next message
Apps11i
Messages: 14
Registered: August 2008
Junior Member
Hello David,

Even i tried with the same possibility, but no luck.
can you guide me to resolve this issue please.
Re: TNS problem [message #343325 is a reply to message #342514] Tue, 26 August 2008 23:42 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
How many Oracle Homes do you have on your PC? Look in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES and HOME_COUNTER.

David
Re: TNS problem [message #343532 is a reply to message #343325] Wed, 27 August 2008 08:29 Go to previous messageGo to next message
Apps11i
Messages: 14
Registered: August 2008
Junior Member
i have two oracle homes and the home_counter is set to 2.
Re: TNS problem [message #344707 is a reply to message #343532] Mon, 01 September 2008 01:33 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
In TOAD look at the 'Connect using' panel which appears when press 'Open a new Oracle connection'. I expect that it is pointing to 'Home1', the location of the first Oracle product you installed, probably the database. Well, use 'tns_admin' and point it at this copy of 'tns_names.ora'. Then reboot your PC and Forms should work.

David
Re: TNS problem [message #376444 is a reply to message #344707] Wed, 17 December 2008 06:28 Go to previous messageGo to next message
jaccyboy
Messages: 19
Registered: December 2008
Junior Member
I'm having the same problems and I can't find the tns admin method on this forum.

Does anyone have a link or could explain it to me?

I'd be really grateful.

Thank you

Jack Silvestro
TNS admin method [message #376454 is a reply to message #341856] Wed, 17 December 2008 07:02 Go to previous messageGo to next message
jaccyboy
Messages: 19
Registered: December 2008
Junior Member
I've seen this mentioned in a few posts here.

Anyone have a link to this?

Or could anyone please explain it to me?

Thank you

Jack
Re: TNS admin method [message #376457 is a reply to message #376454] Wed, 17 December 2008 07:13 Go to previous messageGo to next message
Frank Naude
Messages: 4502
Registered: April 1998
Senior Member
See TNS_ADMIN on the Wiki.
Re: TNS admin method [message #376486 is a reply to message #376457] Wed, 17 December 2008 09:44 Go to previous messageGo to next message
jaccyboy
Messages: 19
Registered: December 2008
Junior Member
where do i do this?

type it in sql*plus?

sorry for my lack of knowledge


jack
Re: TNS admin method [message #376523 is a reply to message #376486] Wed, 17 December 2008 12:45 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It is the (operating system) environment variable. Therefore, you don't set it in SQL*Plus but at the operating system command line prompt.

Why do we use it?

There may be different Oracle products installed on the same computer. For example, Oracle database 9i, Oracle database 10g, Oracle Express Edition 10g, Oracle Developer Suite 6i, Oracle Developer Suite 10g. Each of these products contains its own "Oracle_Home\network\admin" directory which is the location of the TNSNAMES.ORA file. In this example, there would be 5 (five!) different TNSNAMES.ORA files, which contain aliases to databases you use.

So, every time you have a need to connect to a new database, you have to edit the TNSNAMES.ORA file. Not one, but all five of them! Otherwise, the product whose TNSNAMES.ORA file remained unmodified will not be able to connect to this database.

Therefore, a logical question is: why would you want to do that? It's pure suffering! Why wouldn't you, instead, maintain only one TNSNAMES.ORA file copy?!?

TNS_ADMIN environment variable enables you to do that - take any of the TNSNAMES.ORA files and put it into a directory which is easily accessible. I, for example, chose "c:\0_library" and let the TNS_ADMIN environment variable point to this directory.

The rest is easy ... you don't have to worry and browse through the directory tree, but simply maintain a single TNSNAMES.ORA file.

Finally, an example: on MS Windows, you'd do that as following:
c:\temp>set tns_admin=c:\0_library

c:\temp>
In order to check its value, issue
c:\temp>set tns_admin
tns_admin=c:\0_library

c:\temp>
Finally, if you want to delete it, here's the how to:
c:\temp>set tns_admin=

c:\temp>set tns_admin
Environment variable tns_admin not defined

c:\temp>

Other operating systems most probably use different commands (but that's the question which doesn't have much to do with Oracle itself).

Lengthy answer, but I hope you got the picture. If not, Google is (still) your friend.
Re: TNS admin method [message #380302 is a reply to message #376523] Sat, 10 January 2009 08:05 Go to previous messageGo to next message
ktcit
Messages: 24
Registered: August 2006
Location: OMAN
Junior Member

Still no luck we have copied the tns infortion to all the tnsnames.ora file and i set you said in your post but still no luck

Thanks
Re: TNS admin method [message #380444 is a reply to message #380302] Sun, 11 January 2009 23:36 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Please refer to my previous entries in this thread. Use only a single copy of the 'tnsnames.ora' file and use the environment variable 'tns_admin' to point to it. rename ALL other copies of 'tnsnames.ora' to another name or extension.

David
Re: TNS problem & TNS admin method (merged) [message #380520 is a reply to message #341856] Mon, 12 January 2009 03:14 Go to previous messageGo to next message
ktcit
Messages: 24
Registered: August 2006
Location: OMAN
Junior Member

Thanks for the help its working fine.
Re: TNS problem & TNS admin method (merged) [message #381015 is a reply to message #341856] Wed, 14 January 2009 18:15 Go to previous messageGo to next message
jaccyboy
Messages: 19
Registered: December 2008
Junior Member
sorry to ask again.

i changed what i had to at the command prompt and it worked ok.

what should i do then with both the tnsora files in both the database and the dev suite?

i renamed the one in dev suite and it wouldnt work at all for me.

thanks
Re: TNS problem & TNS admin method (merged) [message #381030 is a reply to message #381015] Wed, 14 January 2009 22:55 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
At which 'tnsnames.ora' file have you pointed your environment variable 'tns_admin'? Do you have the spelling of the file name correct?

David
Re: TNS problem & TNS admin method (merged) [message #381068 is a reply to message #341856] Thu, 15 January 2009 02:40 Go to previous messageGo to next message
jaccyboy
Messages: 19
Registered: December 2008
Junior Member
hello,

I just put this into the command prompt:

c:\temp>set tns_admin=c:\0_library

c:\temp>

and checked it.

I dont really know how to point it to a tnsnames file.

my database one it here:

C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN

and the dev suite one is here:

C:\DevSuiteHome_1\NETWORK\ADMIN


what should I do?

thanks once again
Re: TNS problem & TNS admin method (merged) [message #381076 is a reply to message #381068] Thu, 15 January 2009 03:06 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
./fa/3518/0/

To make it simpler, I'll keep to the previous notation.

  • First, you have to create a directory whose name is "0_library", which is on a "C" disk.
  • Then you'll have to copy one of TNSNAMES.ORA files into that directory
  • Now it makes sense to point the TNS_ADMIN environment variable to the "c:\0_library" directory because, if it doesn't exist or if it is empty, the whole TNS_ADMIN story doesn't make any sense
  • When necessary, maintain this TNSNAMES.ORA file; the rest of them (which are in their \network\admin directories) should be renamed into, for example, TNSNAMES_OLD.ORA.
Re: TNS problem & TNS admin method (merged) [message #381089 is a reply to message #341856] Thu, 15 January 2009 03:42 Go to previous messageGo to next message
jaccyboy
Messages: 19
Registered: December 2008
Junior Member
thanks again.

did all that like you said.

now whenever i try to run a form my internet explorer always says it has a problem before it opens the form and has to shut down.

a total nightmare is what i'm having with oracle.
Re: TNS problem & TNS admin method (merged) [message #381100 is a reply to message #341856] Thu, 15 January 2009 04:23 Go to previous messageGo to next message
jaccyboy
Messages: 19
Registered: December 2008
Junior Member
finally got a page to open but still doesnt work for me.

thanks for your help everyone but im just gonna give up on oracle.

why dont they make the whole database and developer come as one package so there wouldnt be any problem with 2 tnsnames files in seperate places?
Re: TNS problem & TNS admin method (merged) [message #381219 is a reply to message #381100] Thu, 15 January 2009 20:46 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Because when you add three or four other Oracle products or versions you would have even more copies of the 'tnsnames.ora' and they (Oracle) can't cater to all combinations of products. You just have to learn to handle them.

I suggest deleting ALL the Oracle products on your PC by deleting the Oracle directory. Go into the registry and delete the Oracle branch there as well. (Search this forum for the location.) Then install the database, prove that is works by using SQL*Plus, create the 'tns_admin' environment variable, then install oracle Developer IN A NEW HOME.

David
Previous Topic: Export Forms data to XML and Import XML data into Forms
Next Topic: difference between onetime_where and default_where?
Goto Forum:
  


Current Time: Sat Dec 10 07:00:28 CST 2016

Total time taken to generate the page: 0.11220 seconds