Command to determine path used to find tnsnames.ora

How can know (with command or similar) the path that uses Oracle client to find tnsnames.ora file?
We need a command because not always we have administrator permissions on a workstation to make a regedit or to see environment variables, but we have to determine causes of problem connections.
If I’m working with client on UNIX, ‘tnsping name’ command shows a path of sqlnet.ora, usually the same that tnsnames.ora is allocated. Under windows doesn’t display information about this.
For example:
On UNIX:
tnsping ####
TNS Ping Utility for IBM/AIX RISC System/6000: Version 9.2.0.4.0 - Production on 03-MAY-2007 13:55:58
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
/software/oracle/product/9.2.0/network/admin/sqlnet.ora
On WINDOWS:
C:\>tnsping ####
TNS Ping Utility for 32-bit Windows: Version 8.1.7.0.0 - Production on 03-MAY-20
07 13:58:51
(c) Copyright 1997 Oracle Corporation. All rights reserved.
TNS-03505: Message 3505 not found; No message file for product=NETWORK, facility
=TNS
Exists any command to do it or any command that shows this information?
Thank you very much!!!
Marc.

Hi!
In windows you also get the message what sqlnet.ora was used.
The error message you get
TNS-03505: Message 3505 not found; No message file for product=NETWORK, facility=TNSlooks like there is something wrong with your client installation, it can't find it's message file so you don't get your sqlnet.ora path. I suppose in your case knowing the location of tnsnames.ora wouldn't help since your client isn't installed correctly.
Regards,
PP

Similar Messages

  • Cannot find tnsnames.ora error message

    We are using oracle 10.2.0.1 via Toad. I get a cannot find tnsnames.ora file error message and see only a tnsnames.ora file in the sample file under the c:\ORACLE\product\10.2.0.1\NETWORK\ADMIN\ directory.
    Do I need to create this file, and if so how do I do this?
    Thanks in advance for your help
    regards,
    user12943453

    Do I need to use the TNSNames Editor? No need for tnsnames.ora or SQL*net to access local DB
    Can I just use direct connect and the sqlnet editor?YES!

  • Can't find tnsnames.ora

    Hi,
    I install Instant Client on Linux using rpm. I need to edit the tnsnames.ora, but I can't find it.
    Can I copy one instance of tnsnames.ora and set TNS_ADMIN=<the path of tnsname.ora directory> as and enviornment variable on your client machine?
    Thank you

    No tnsnames.ora is included with Instant Client, you have to create (or copy, as you do) your own.
    You did the right thing, TNS_ADMIN must point to the directory containing tnsnames.ora.
    If you have an sqlnet.ora file, it must be in the same directory.
    Yours,
    Laurenz Albe

  • DBD::Oracle & Instant client - don't find tnsnames.ora

    Hello,
    I'm trying to use tns names in Perl scripts to connect with Instant client. I always get the ORA-12154 error when connecting with Perl :
    ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach).
    The perl command that raise the error is :
    +$dbh = DBI->connect("dbi:Oracle:MYDB","user","password") or die $DBI::errstr."\n";+
    I checked my Oracle installation and everything seems fine. Connection with sqlplus work without problem using the same connection string (sqlplus user/passowrd@MYDB).
    I stat'ed my tnsnames.ora file to check if it's accessed : it is with sqlplus, but not with my perl script.
    Instant Client has been installed with the zip files made available by Oracle (not RPM). ORACLE_HOME points to the installation directory and tnsnames.ora is located in $ORACLE_HOME//network/admin/. Server is a Red Hat Entreprise 5.
    In my knowledge DBD::Oracle use OCI so there should not have difference between sqlplus and DBD::Oracle. Am I wrong ? Anyone have had this problem before ?
    Thanks for your help
    Florent

    Hi,
    Environment variables was correctly defined, but your comment put me on the right track.
    I printed the %ENV content to check ORACLE_HOME which was OK.
    I check the directory and remind I put a sqlnet.ora file in the same directory than tnsnames.ora with the followin content :
    AUTOMATIC_IPC = OFF
    TRACE_LEVEL_CLIENT = OFF
    names.directory_path = (TNSNAMES)
    names.default_domain = world
    name.default_zone = world
    I removed this file and everything is ok now. I don't really know what this file is used for, but if I keep it online and change MYDB in the connection name to MYDB.world, it worked. I think I have to learn more about names...
    Thanks for your help anyway !
    Regards,
    Florent

  • Connect to Oracle DB using DBCP and tnsnames.ora

    I have a Spring-based web app that is running on Tomcat and uses DBCP to connect to Oracle.
    The problem:
    Need to pull database connection information from tnsnames.ora file. There is Oracle Client installed on a server, so tnsnames file is available.
    According to JDBC documentation, the following url should do the trick: jdbc:datadirect:oracle:TNSNamesFile=c:\\oracle\\product\\10.2.0\\NETWORK\\ADMIN\\tnsnames.ora;TNSServerName=FITZGERALD.SALES
    This leads to the following declaration in dataAccessContext-local.xml file:
    +<bean id="dataSource" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">+
    +<property name="driverClassName" value="oracle.jdbc.OracleDriver"/>+
    +<property name="url" value="jdbc:datadirect:oracle:TNSNamesFile=C:\\oracle\\product\\10.2.0\\db_1\\network\\admin\\tnsnames.ora;TNSServerName=TESTDB"/>+
    +<property name="username" value="${jdbc.username}"/>+
    +<property name="password" value="${jdbc.password}"/>+
    +</bean>+
    This doesn&rsquo;t work for me saying that database url is invalid.
    Can anyone provide instructions on how to set up DBCP with tnsnames.ora?
    Any help greatly appreciated.

    You are right, the I got that url may not be correct. I got it from datadirect documentation.
    I couldn�t find any good information or examples on this, but I think using TNS keyword-value pairs and tnsnames.ora is supported by type4 Oracle 10g JDBC.
    Some info I found in section �Connecting to the Database through the Applet� in JDBC Reference http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/jdbcthin.htm#CACCHECD
    I guess there is something off in that documentation though. I couldn't get it working.

  • Still using an old tnsnames.ora even though it was erased

    I downloaded and unzipped 1.2.1-32.13. But it is not reading my new tnsnames.ora.
    My operating system is XP pro.
    Initially I had just the oracle client installed with it's own tnsnames.ora and added sqldeveloper 1.0.0 and then later 1.2.1. I couldn't get my connections to work at all in either one. Unfortunately this was a corporate install that had some "wrapper" on it, not just the Oracle install tool and I removed it by running Oracle install tool and then removing oracle_home from the registry - something initially fishy here because Oracle couldn't completely get rid of it.
    I then installed a full oracle 10g and put a good tnsnames.ora there. Now sqlplus and the database work fine, but sql-developer 1.2.1 still has the old (bad) tnsnames even though the file no longer exists. I did a full search of both C and D drives including system and hidden files for a file with a string that existed only in the old tnsnames file that sqldeveloper still shows and it came up with no matching files. I also can't find it in the registry (didn't expect to tho).
    My previous version of sqldeveloper (1.0.0.15.57) finds the new tnsnames.ora just fine and works well, but the new one is stuck with the old entries and I can't figure out how to tell it to get the new file.
    Thanks for any help.

    I have no defined connections in my sql-developer 1.2.1.No defined connections is consistent with not being able to find a connections.xml.
    ... tried, for example, adding the environment variable TNS_ADMIN to point to my tnsnames.adminI assume that you set %TNS_ADMIN% to the directory rather than the tnsnames.ora file itself.
    I have only one tnsnames.ora and no other files named even remotely like tnsnames and no files containing the string "P902.oracledb" which is the first tns connection shown in sql-developer 1.2.1 list of tns connections. As I said I verified this by doing a Windows search of all files on both drives including system and hidden files.A Windows search for file contents only searches contents for certain file types - I can search a directory containing a tnsnames.ora file for something that is in my tnsnames.ora file but it is not found by the Windows search.
    I suspect there is a registry entry that is pointing to somewhere, so I deleted sqldeveloper ...The TNS stuff for SQL Developer is not based on the SQL Developer install but the Oracle Client install, so reinstalling the same version of SQL Developer will not change the TNS issue.
    There has got to be some other place where this information is stored, but where?Have you checked %USERPROFILE%? This the Win XP version of the $HOME and a tnsnames.ora file in %USERPROFILE% takes precedence over one in %TNS_ADMIN% (it did for me at least).
    ##################### #############P902.oracledb.xxx.com I have not seen that and we have LOTS of comments in our tnsnames.ora file.

  • No TNSNAME.ORA or listener.ora

    I am new to oracle.(learner)
    I was using oracle 11g and using oracle sql developer.
    It was working fine.
    I had to use oracle form builder, which I installed but I could not connect to database from form builder.It was giving ORA-12154:TNS:could not resolve the connect identifier specified and then I tried copying oracles tnsname.ora to form builder’s tnsname.ora and then it was giving TNS error no listener descriptor found or so on
    I tried googling and I tried every possible way discussed online
    and not being able to resolve it I de-installed (completely following steps discussed online even deleting registry entries) both oracle and  form builder (WHICH WAS IN F drive )
    and then I reinstalled the oracle 11g and form builder 10g again in E drive (earlier one was in F drive)
    Now as earlier oracle is working fine
    But now strange thing is now there aren't  any tnsnames.ora and listener.ora files in oracle_home/network/admin (also not in form builder’s directory) But database is running fine
    Any help

    997069 wrote:
    I am new to oracle.(learner)
    I was using oracle 11g and using oracle sql developer.
    It was working fine.
    I had to use oracle form builder, which I installed but I could not connect to database from form builder.It was giving ORA-12154:TNS:could not resolve the connect identifier specified and then I tried copying oracles tnsname.ora to form builder’s tnsname.ora and then it was giving TNS error no listener descriptor found or so on
    I tried googling and I tried every possible way discussed online
    and not being able to resolve it I de-installed (completely following steps discussed online even deleting registry entries) both oracle and  form builder (WHICH WAS IN F drive )
    and then I reinstalled the oracle 11g and form builder 10g again in E drive (earlier one was in F drive)
    Now as earlier oracle is working fine
    I can see all the services running,I can connect database using sql plus and sql developer and also issue sql command.
    I am just using oraclass database created during installation process.
    But as usual form builder is NOT working giving TNS:could not resolve the connect identifier specified
    But now strange thing is now there aren't  any tnsnames.ora and listener.ora files in oracle_home/network/admin (also not in form builder’s directory) But database is running fine
    Database control shows the listener.ora path to F drive(earlier installed one which I deinstalled ) but there is not any app/…/oracle database folder in F drive at all(I deleted it completely when I deinstalled it) and its not hidden as well.
    So I am really confused what I can do next.
    I am not able to login into database from form builder
    It gives error
    ORA-12154:TNS:could not resolve the connect identifier specified
    WHERE CAN I FIND THE TNSNAMES.ORA AND LISTENER.ORA file(how to find it)
    Any helplistener.ora file is NOT required to start or use Oracle Listener.
    tnsnames.ora is a plain text file that can be a single line like below
    ORCL=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)))

  • DNS vs. Oracle Name Service vs. tnsnames.ora

    Can anyone shed some light on this?
    I heard that Oracle is going toward a DNS solution and going away from
    tnsnames.ora and the Oracle Naming Service. Is this true?
    We are looking to place a naming solution in our environment and I want to
    know which direction to head in. Also, if possible, I would like users to
    only see the databases they need to see, which is the main problem we have
    right now using a global tnsnames.ora file. Limiting users' views to only
    what they have a business need to see is an important step in many steps to
    secure the environment. I don't see how this would be accomplished using
    DNS.
    Comments?
    Thanks,
    Paul
    null

    Because of your sqlnet.ora (In the same directoty than the the tnsnames.ora).
    In this parameter file, you find the "NAMES.DEFAULT_DOMAIN" (Default value = world) wich is used by Oracle to complete your input.
    The default value "World" is also in the sample init/pfile as the default domain.

  • Tnsnames.ora General Question

    We are experiencing a problem that many different users seem to have many different versions of tnsnames.ora. We want to create our "gold" version and ensure that everyone uses the same one. Two questions:
    1. Is the "alias" that you give each connection case sensitive? For instance if I name one connection Prod is that the same as PROD?
    2. At another place I worked I was under the impression that most applications (PL/SQL Developer for sure) uses the Windows PATH environment variable to locate tnsnames.ora by going through all directories listed in the variable and using the first occurrence of tnsnames.ora that it found. Through a little testing and renaming and such I have found that this doesn't appear to be the case. We are using ADI, Discoverer, different development tools, etc and would like to avoid having more than one location where the file is stored. What is the best way around that or is there a way? I assume that it depends somewhat on each application.
    Thanks in advance for the help!

    PL/SQL Developer Help->Support Info TNS Names tab shows that C:\oracle\ora92\network\admin\tnsnames.ora is used as my tnsnames.ora for the application. I don't have an ORA_HOME environment variable. So where is it coming from? The path above is in my PATH variable.
    So it is different for every application?
    I don't have TNS_ADMIN environment variable either.
    Sorry for the dumb questions. I just want to be 100% clear.
    Message was edited by:
    mateoc15

  • Regular expressions for tnsnames.ora

    Hi;
    Does anyone have a regular expression that can be used to parse tnsnames.ora? I found:
                   const string pattern = @"(?<name>[A-Z\-_]+\.WORLD)|" +
                                            @"(PROTOCOL = (?<protocol>[A-Z]+))|" +
                                            @"(HOST = (?<host>[A-Z0-9._]+))|" +
                                            @"(PORT = (?<port>[0-9]+))|" +
                                            @"(SID = (?<sid>[A-Za-z0-9.\-_]+))|" +
                                            @"(SERVICE_NAME = (?<service>[A-Z\-._]+))";
    on the web but it does not return the name (the most critical part).
    ??? - thanks - dave

    @notivago
    In the meantime I also came up with a pattern to
    check the YELLOW case:
    String partly =
    "\\d{0,8},?|\\d{6,8},\\d{0,3},?|\\d{6,8},\\d{1,3},\\d{
    0,3},?|\\d{6,8},\\d{1,3},\\d{1,3},\\d{0,2}";Sounds good to me.
    It seems to work. But my actual goal is to do such
    color-coded syntax checking for other number types
    (other patterns) as well. And it should be easy to
    add or change number types.I cant figure how to do that for now.
    So it would be nice to have a generic way to generate
    the YELLOW-pattern from the other one. Is it
    possible? Probably, but I cannot come up with any idea now.
    Is there a better solution than my one
    ("String partly" above)? Something I can just append
    to the original pattern for example?There are others, but it is hard to say what would be better or worse.

  • TNS_ADMIN (path to tnsnames.ora) using Instant Client IGNORED

    Hi,
    I developed a simple utility which uses OCCI LIB from 10g release. I'm deploying it with Oracle Instant Client lite libraries.
    Everything works fine when tnsnames.ora is present in the same dir. When I move it somewhere else and set TNS_ADMIN to that directory, it doesn't work anymore:
    C:\uplob>set TNS_ADMIN=c:\tns;
    C:\uplob>echo %tns_admin%
    c:\tns;
    C:\uplob>uplob u/p@xe 15 input.dat
    Exception:12154 ORA-12154: TNS:could not resolve the connect identifier specif
    ied
    This seems very simple, but I still cannot determine why TNS_ADMIN is not being taken into account.
    Thank you for any help with this issue,
    david

    I think for Windows ,
    You may have to set this in MY-COMPUTER-->Advanced-Env-Variables
    and reboot to take effect.
    rgds

  • When my most front window is a safari one and I use the shortcut key "Command N", it opens a new finder window and a new safari window at the same time. Why does it happen?

    When my most front window is a safari one and I use the shortcut key "Command N", it opens a new finder window and a new safari window at the same time. Why does it happen?

    I just found the solution!
    Niel
    Re: Why is my Finder window popping up when I open my Safari window? 
    Jan 20, 2008 7:58 PM (in response to alak)
    Open the General tab of the Safari preferences and correct the home page; the default page is this one. If it has become set to a folder on an FTP server or a local drive, that request will be sent to the Finder. (28252) 
    iMac Late 2007 Core 2 Duo, Mac OS X (10.5.1)

  • LR V1.2 Having problems using the find Command

    Have just recently started using lightroom and so far managing most applications imported a series of photos and after import added keywords to them using the find function I cannot get images to appear. What seems to happen is that in the keyword tag and the folders any of the headings that contain the keyword become active the remainder show a zero no in number of images held in that folder but no images on screen
    can anyone assist me
    Peter

    thanks for the reply
    have switched of global filters, made sure that using the Find command have set keywords in "text box" and in the "rule box "contains". When I then enter a key word as soon as a type the first two or three letters
    a message appears on the screen no "No photos in the selected keyword Tag" Also when you look at the folders which have a series of numbers indicating the photos in the directory the first number in each set turns to 0 with the exception of the folder and sub folder were the images are
    So have not managed to make any progress
    Peter

  • Hi when i open Photoshop i get this message in a little box  (could not complete the command because Photoshop was unable to find the JavaScript  plug-in.)  Im using the trial version of Photoshop

    im wondering if anyone can help with this
    I get this message when i open PhotoShop
    (could not complete the command because Photoshop was unable to find the JavaScript)

    Photoshop installer should have installed a ScriptingSupport Plugin in each version of Photoshop you installed. Scan your system for ScriptingSupport I found six on my windows system. Here where I found them:

  • Can't srvctl command write tnsnames.ora file?

    Hi,
    I use srvctl to create a new service correctly, but I find the information of this service isn't written into tnsnames.ora file, it means, user can't connect database by directly using this service name, it's very stranger, who can tell me how to use srvctl to create a service and ensuer the information about this service can be correctly written into tnsnames.ora file?
    #srvctl add service -d mm -s mx -r node1 -a node2.

    Did you check tnsnames.ora for any new entries?
    Yes,There are not any new entries for the new service I just created.
    Check the command reference again, there is a flag to display "sample tns entries"
    http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/srvctladmin.htm#i1008779
    I check that documentation, and I can use that command to run in my RAC environment, the returned result is
    Example client-side TNS entry for service mx:
    mx = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db_vip)(PORT=dedicated_port
    ))(CONNECT_DATA=(SERVICE_NAME=mx)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC
    How to use this service in client or our application, must we manullay configure tnsnames.ora file?
    BRs./Vinson

Maybe you are looking for