Oracle environment variable tns_admin instead tnsnames.ora

Hi, I have a big trouble with the tns_name file. First of all I am working oracle with visual studio .net. I have the file tns_name in the following route C:\oracle\ora92\network\ADMIN\tnsnames.ora. If I delete this file, visual studio .net can still work properly. Then I figured out that it is taking the tnsnames from tns_admin in environment variables. It means visual studio .net is taking the tnsnames from tns_admin instead of C:\oracle\ora92\network\ADMIN\tnsnames.ora.
Can someone explain me why and how is the way to configure which file is used? Where can I configure it?
Thanks in advance.

it throws the following error: ora-12154 tns could not resolveORA-12154 ALWAYS only occurs on SQL Client & no SQL*Net packets ever leave client system
ORA-12154 occurs when client requests a connection to some DB server system using some connection string.
The lookup operation fails because the name provided can NOT be resolved to any remote DB.
The analogous operation would be when you wanted to call somebody, but could not find their name in any phonebook.
The most frequent cause for the ORA-12154 error is when the connection alias can not be found in tnsnames.ora.
The lookup operation of the alias can be impacted by the contents of the sqlnet.ora file; specifically DOMAIN entry.

Similar Messages

  • Oracle environment variable setting for mulit instances

    Dear experts,
    I am doing CRM_ABAP, CRM_JAVA,ERP installation based on Oracle in a laptop for SAP Best Practise.
    The CRM_ABAP installation have done, and start to install CRM_JAVA named CRJ.
    In CRM_ABAP installation, I set Oracle environment variable as below:(/etc/profile.d/oracle.sh)
    ・CRACLE_SID=u201DCRMu201D
    ・CRACLE_HOME=u201Doracle/CRMu201D
    ・PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/bin/oPatch:$PATH:
    ・export CRACLE_SID CRACLE_HOME PATH
    My question is that how do I set environment variable for CRM_JAVA(CRJ) in oracle.sh,?
    I tried e.g. CRACLE_SID=u201DCRMu201D:u201DCRJu201D, CRACLE_HOME=u201Doracle/CRMu201D:u201Doracle/CRJ/102_64u201D
    or CRACLE_SID=u201DCRJu201D CRACLE_HOME=oracle/CRJ/102_64u201D export CRACLE_SID CRACLE_HOME
    in addition
    but got an error message in SAPinst (Task Progress: configure Oracle server network)
    said u201CAssertion failed:lsnrctl:Parameter dbHOME has to be a valid ORACLE_HOME).u201D
    kindly help me to reslove the issue.
    Thanks.
    regards.
    Li.etsuhin

    Setting a Linux environment variable like ORACLE_SID to multiple values will not work.
    Use another oracle.sh, and maybe also another Linux user.
    I am not familiar with the details, but what does your installation guide say?
    Or you may have to use the same values for Java. The installation guide will tell you.

  • How to read a non-oracle environment variable?

    I have been trying to read a non-oracle environment variable using TOOL_ENV.GETVAR, and have come to understand that it doesn't work. Is there another function that can do what I want? I don't want to hardcode the directory the forms and reports must reside in, but can't find anyway to make this value flexible.
    can anyone help ?
    thx
    adam

    I figured out a way. I put a String in the registry in the oracle home area, and can read it with TOOL_ENV.GETVAR now. It appears that it reads from the registry, not the environment variables. Except for unix apparently, where it reads environment variables.
    adam

  • Oracle Environment Variable Problem - OCIEnvNlsCreate() failed

    We are using PHP 5.2.3 with oci8 version 1.2.3 in CentOS 5.0.
    We have installed Oracle 10g in the same machine where Apache (2.2.3) is running.
    First we tried to set the Oracle environment variable in httpd.conf as
    SetEnv ORACLE_HOME u01/app/..../db_1
    SetEnv ORACLE_SID oratest.
    But we were unable to connect and got the message 'OCIEnvNlsCreate() failed'.
    Then we tried to set the environment variables in root's bash profile.
    Then it did work in PHP command line interface. But it didn't work in browser. Interestingly, getenv function shows the environment variables correctly (even in the browser).
    We also given the read and execute permissions for all users in all directories of oracle. But still it gives the same error.
    Please help.

    While trying to get new oci8 php extension to work I remember trying to set parameters using SetEnv inside apache httpd.conf or inside .htaccess file. However this is not recommended and I remember seeing some suggestions as not to use SetEnv for Oracle environment variables. I also had issues with that before. I went and added bash
    export ORACLE_HOME=... to the Apache startup script in /etc/init.d and this has resolved the problem for me.
    I hope this helps.
    Gena01

  • Getting oracle environment variables using plsql code

    Hi Geeks,
    Can anyone tell me how to get an Oracle environment variable (eg db_cache_size) from inside a plsql block of code or through a sql query?
    Thanks,
    Prabhu

    Is it possible to update the values via SQL?That's indicated by:
    ISSES_MODIFIABLE VARCHAR2(5) Indicates whether the parameter can be changed with ALTER SESSION (TRUE) or not (FALSE)
    ISSYS_MODIFIABLE VARCHAR2(9) Indicates whether the parameter can be changed with ALTER SYSTEM and when the change takes effect:
    See the docs:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2012.htm#REFRN30176

  • Connecting to Oracle database in Java using TNSNAMES.ora

    I have a program that can connect to both MSSQL and Oracle databases. It works fine when a user has defined an odbc connection, however if the user only has a tnsnames.ora, I don't know how to code the program in Java to connect to the database. I can't hard-code the server name because I don't know the database up front - I need to be able to read tnsnames.ora to get the information instead. How can I get this information? So far, the object OracleDataSource seems to be getting me the closest, however I am still failing to connect.

    In 10.2, JDBC-Thin supports TNSNAMES entries lookup in tnsnames.ora, resulting in a much simplified and driver type independent Oracle Net descriptor. You must set the system property oracle.net.tns_admin to the directory that contains your tnsnames.ora file.
    See the Oracle JDBC 10.2 doc.
    Here is a code fragment from my book (see my blog below)
    java -Doracle.net.tns_admin=$ORACLE_HOME/network/admin
    or:
    System.setProperty("oracle.net.tns_admin", "c:\oracle\net\admin");
    OracleDataSource ods = new OracleDataSource();
    ods.setTNSEntryName("tns_alias");
    ods.setUser("scott");
    ods.setPassword("tiger");
    ods.setDriverType("thin");
    Connection conn = ods.getConnection();
    Kuassi - blog http://db360.blogspot.com/

  • Setting Oracle environment variable using batch (.bat) file in windows

    Hi,
    Oracle 9i db
    Windows OS
    I am in process to create the database (Considered that Oracle9i software is already installed) by running one batch file which consist of all the scripts for the database creation.
    But i also want to set the environment variables at MyComputer(right click)>properties>advance>environment, permenently by running the batch (.bat) file
    ORACLE_HOME
    ORACLE_BASE
    ORACLE_SID
    So, how can it be done ?
    With Regards

    Hi,
    *@echo off*
    set ORACLE_SID=iprsdb
    set ORACLE_BASE=C:\oracle
    set ORACLE_HOME=C:\oracle\ora92     
    call C:\install_bkp\test_env_var.bat
    echo Test Successfull.
    Above mentioned is the code written in the batch (.bat) file
    In that i have also called another .bat file which test the env. variable values which is as below:
    c:\>test_env.bat
    ===================
    Testing oracle sid
    ===================
    iprsdb
    =====================
    Testing oracle base
    ===================
    C:\oracle
    =====================
    Testing oracle home
    =====================
    C:\oracle\ora92
    Test Successfull.
    But when i checked at MyComputer(right click)>properties>advance>environment variables
    there, I saw none of the entries from the above, why so ?
    how to set env. variables permanently using the DOS commands. ?
    With Regards

  • 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.

  • Oracle Environment Variables on Linux

    Hi,
    First, I'll admit that I'm very, very new to Linux.  I'm running Oracle Database XE 11g R2 on a virtual machine (Virtualbox) that is running Oracle Enterprise Linux 6.  Whenever I open a terminal window and set ORACLE_HOME, PATH, and ORACLE_SID, I can easily access SQLPlus, simply by typing "SQLPlus".  However, if I close that window and then open another terminal window, I cannot access SQLPlus, simply by typing "SQLPlus".  I have to re-specify the environment variables first.
    I'm sure that this is something simple but my lack of Linux experience is keeping me from finding the issue.  Also, I've not found any documentation that helps but please point me to it if I've missed it.
    Thanks,
    Brian

    You can also set your environment by using a shell script that comes with the XE default installation:
    # source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
    There's also a backup script.
    # /u01/app/oracle/product/11.2.0/xe/config/scripts/backup.sh
    assuming that you've installed the XE instance in the default path /u01
    C.

  • 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

  • Linked Servers - Sql server 2005 to connect to Oracle 11g using ldap.ora instead of tnsnames.ora

    We have a SQL Server 2005 64bit box that needs a linked server created to Oracle 11g 64bit box. I have all the Oracle client software installed and can successfully connect to the Oracle database using SQL+ on the SQL Server 2005 64bit box. When I create
    the linked server and select the OraOledb.Oracle provider, I get the TNSNames error. The Oracle server does not use tnsnames.ora it uses OLAP.ora to resolve. How do I get Linked server to stop trying to connect via TNSNames and use the OLAP.ora file instead?
    I can't find any articles for this specific issues. All Oracle examples tell you to use TNSNAMES. The Oracle server is not under my companies control so I can not force the vendor to use tnsnames instead of OLAP.

    Hi,
    Have you got a resolution?
    Thank you.

  • Location of tnsnames.ora for Tora and Oracle XE Client

    I Googled far and wide and did not see a CLEAR answer to my question, hopefully this will help others.
    I have installed the debian oracle-xe-client and tora packages (tora rebuilt for oracle) on Ubuntu 8.04.
    However, I did not know where I was supposed to place the tnsnames.ora file for my databases. I have tried running Tora with the environment variable of TNS_ADMIN set to the file where I placed my tnsnames.ora, however that did not work as Tora did not 'see' the file or its entries apparently. I know this works because I copied it from a Debian Etch box with the client and server installed.
    I had even added a 'network/admin' directory structure to the //usr/lib/oracle/xe/app/oracle/product/10.2.0/client (ORACLE_HOME) with the tnsnames.ora but also with no success.
    Now for the solution:
    Simply remember that TNS_ADMIN points to the directory where the tnsnames.ora is and it will work. :)
    I do have a suggestion that both Tora and sqlplus use a config file to set these directory(s) in addition to the overriding ability of the environment variable, TNS_ADMIN as is usually the case with UNIX apps (and thus expected).
    Thank you,
    Jason

    The ODBC Instant Client Readme that is included in the install also indicates that %ORACLE_HOME%/network/admin/tnsnames.ora is the correct default location. What about OCI?

  • Complete checklist for oracle 11.2.0.4 environment variables on AIX 6

    Hi,
    Can anyone give me the Doc ID for complete checklist for oracle environment variable 11.2.0.4 on IBM AIX 6 platform (64 bit).
    Because we get the following from IBM website, we wonder if any other oracle variable need to make a change, or will impact upgrade correctly on AIX.
    “AIX 5.1 uses an environment variable LIBPATH when loading shared libraries. AIX 5.3 uses LD_LIBRARY_PATH
    instead. For backward compatibility, AIX5.3 still uses LIBPATH if it is defined.”
    URL: http://www-01.ibm.com/support/docview.wss?uid=isg3T1015835
    So we can actually define both -
    LIBPATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LIBPATH
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; /usr/local/lib export LD_LIBRARY_PATH
    there are less companies use AIX to run oracle database than those use Unix/Linux; we are planning upgrade oracle database 11.2.0.3 to 11.2.0.4 on IBM AIX (64bit) os level 6, so we need to double-confirm this.  FYI.
    thank you very much!

    Hi Abhi: the Doc URL you give me (<e48740>) it doesn't help much. It doesn't tell much about environment variables for oracle.  I have the following sample for oracle .profile at IBM AIX 6.1, is it Ok enough for us as basic setting?
    vi /home/oracle/.profile
    # Oracle variables
    umask 022
    TMP=/tmp; export TMP
    TMPDIR=$TMP; export TMPDIR
    ORACLE_SID=meps; export ORACLE_SID
    ORACLE_BASE=/ora_bin01/u01/app/oracle; export ORACLE_BASE
    ORACLE_HOME=$ORACLE_BASE/product/11.2.0; export ORACLE_HOME
    TNS_ADMIN=$ORACLE_HOME/network/admin  export TNS_ADMIN
    PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/usr/sbin:/usr/ccs/bin; export PATH
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32:$ORACLE_HOME/rdbms/lib:/lib:/usr/lib;/usr/local/lib export LD_LIBRARY_PATH
    LIBPATH=$LD_LIBRARY_PATH export LIBPATH
    CLASSPATH=$CLASSPATH:$ORACLE_HOME/jdbc/lib:$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/network/jlib:$ORACLE_HOME/oui/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
    Note:
    there are optional environment variables: TNS_ADMIN(optional), NLS_LANG (optional), TWO_TASK (optional)
    thank you!

  • TNS_ADMIN Environment Variable

    Hi,
    I am trying to install Oracle AS 10g Standard Edition one on my system.The problem is
    1. That when I try to install Oracle Portal with Metadata Repository 3.4GB option, I get the error that the environment variable TNS_ADMIN is set to a directory which does not exist.I have checked the environment variables but there is no such variable named TNS_ADMIN.
    2. After this the system asks to provide 3 more files
    3. Abnormal installation termination errors appear and I have to cancel the installation.
    Help will be greatly appreciated,
    Daya

    Hi,
    Yes, the Oracle Installer also looks for TNS_ADMIN in the registry - it's usually in HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEID.
    Howevern the environment overrides the registry - so if TNS_ADMIN is set in the environment, then that takes precedence over the TNS_ADMIN setting in the registry.
    As mentioned by deltondm, depending on the Platform, you can set the TNS_ADMIN environment variable & try to proceed with the installation.
    Regards,
    Sandeep

  • SQL Developer can't see tnsnames.ora

    Hiya. I hope someone can help with this. I installed Oracle instant client (basic lite) on my new Windows 7 machine (32 bit) - yeah, I know Windows 7 is not supported, but my gut feeling is that this isn't the issue I'm having.
    I've put my tnsnames.ora file in the same folder as instant client (C:\program files\oracle\instantclient), have created a system environment variable TNS_ADMIN which points to that folder, and have added that folder to the system "path" environment variable. That should do it, right?
    When I try to create a new connection in SQL Developer 2.1.0.63, and change my connection type to "tns", I don't see any database connections.
    Troubleshooting ideas? Other ways to test that the needed Oracle files are installed properly?
    Thanks!

    Here's how to debug where it's looking:
    http://krisrice.blogspot.com/2008/04/it-seems-to-come-up-often-that-some.html
    -kris

Maybe you are looking for

  • Cannot sync iPod after hard drive crash

    Hard drive crashed last week so reinstalled new from Dell. Data all backed up. Since new drive in cannot sync iPod. USB cable OK, iTunes "sees" iPod name and can download to iTunes but no sync. Do not get any kind of error msg that iPod registered on

  • DVD - CDRW not speeding up

    T40 Type 2373 with a DVD - CDRW.  Need to reformat hard drive and reload WIN XP and new programs. DVD will not spin to full speed.  Light goes on and spins slowly in what sounds like a cyclic manner.  Tried several CD's.  Ejects properly. Solved! Go

  • Use of Class_Constructor in OOPS

    Hi All, Can i anyone tell me the exact use of class_constructor. Any situation where you can use class constructor other than initializing static attributes I want to know what's the purpose of class_constructor Thanks David

  • Problème export PDF depuis Indesign CS6

    Salut, j'ai un souci avec indesign CS6. il m'arrive de récupérer de vieux pdf d'Xpress (bouhhhhh) et de devoir les importer dans indesign. jusque la tout va bien. A l'exportation en PDF, inDesign plante systématiquement. Par contre, SI je n'ai pas un

  • Yoga tablet webpage response problem

    Hi, Our newish (9 months) yoga tablet links to the internet via our home wifi with no problem but when it accesses a website it soon tells me that 'this page has become unresponsive' and we cannot navigate the site further. It does this even after cl