9 Replies Latest reply: Mar 18, 2013 3:39 PM by jgarry RSS

    Netca can't find tnsnames.ora file event though it exists.

    user564990
      Hi,

      I'm a newbie in Oracle and need some help of an experienced guy :)
      I've installed Oracle 11.2R3 on Linux and currently try to run netca assistant to create an alias.

      In the UI everything looks OK, but the tnsnames.ora is not created.
      Looking at the logs I saw that it is looking the file under : /network/admin without $ORACLE_HOME (which is well defined) at its beginning.

      Log output is below.
      Can somebody help me?

      Thank you all for your help :)



      Log output

      netcaXXXlog :

      Oracle Net Services Configuration:
      ServiceAliasException: Could not save Service Alias: TNS-04415: File i/o error
      caused by: java.io.FileNotFoundException: /network/admin/tnsnames.ora (No such file or directory)
      Default local naming configuration complete.
      Created net service name: db67
      Oracle Net Services configuration successful. The exit code is 0


      traceXXXlog
      [main] [ 2013-03-13 18:48:12.227 IST ] [NetCALogger.initTrace:203] Oracle Net Configuration Assistant: 1303136PM4811
      [main] [ 2013-03-13 18:48:12.227 IST ] [NetCALogger.initTrace:204] Oracle Home: /opt/oracle11/product/11.2.0.3/db_1
      [main] [ 2013-03-13 18:48:12.227 IST ] [NetCALogger.initTrace:205] Oracle Base: /opt/oracle11/product
      [main] [ 2013-03-13 18:48:12.228 IST ] [NetCALogger.initTrace:206] Oracle Home Name: OraDb11g_home2
      [main] [ 2013-03-13 18:48:12.264 IST ] [InventoryUtil.getOUIInvSession:347] setting OUI READ level to ACCESSLEVEL_READ_LOCKLESS
      [main] [ 2013-03-13 18:48:12.264 IST ] [HAUtils.<init>:239] oui location /opt/oracle11/oraInventory/ContentsXML
      [main] [ 2013-03-13 18:48:12.276 IST ] [Version.isPre:528] version to be checked 11.2.0.3.0 major version to check against10
      [main] [ 2013-03-13 18:48:12.276 IST ] [Version.isPre:539] isPre.java: Returning FALSE
      [main] [ 2013-03-13 18:48:12.280 IST ] [OCR.loadLibrary:312]
      Inside constructor of OCR
      [main] [ 2013-03-13 18:48:12.295 IST ] [OCR.loadLibrary:320] Going to load the ocr library
      [main] [ 2013-03-13 18:48:12.295 IST ] [Library.load:188] library.load
      [main] [ 2013-03-13 18:48:12.296 IST ] [sPlatform.isHybrid:66] osName=Linux osArch=amd64 JVM=64 rc=false
      [main] [ 2013-03-13 18:48:12.296 IST ] [sPlatform.isHybrid:66] osName=Linux osArch=amd64 JVM=64 rc=false
      [main] [ 2013-03-13 18:48:12.296 IST ] [Library.load:264] Loading library /opt/oracle11/product/11.2.0.3/db_1/lib/libsrvmocr11.so
      [main] [ 2013-03-13 18:48:12.298 IST ] [OCR.loadLibrary:322] loaded ocr libraries
      [main] [ 2013-03-13 18:48:12.298 IST ] [OCR.isCluster:952] Calling OCRNative for isCluster()
      [main] [ 2013-03-13 18:48:12.300 IST ] [OCR.isCluster:956] OCR Result status = true
      [main] [ 2013-03-13 18:48:12.301 IST ] [OCR.isCluster:968] Bolean result = false
      [main] [ 2013-03-13 18:48:12.303 IST ] [CmdlineArgs.<init>:114] Initializing variables array...
      [main] [ 2013-03-13 18:48:12.304 IST ] [CmdlineArgs.<init>:120] Initializing NetProperties...
      [main] [ 2013-03-13 18:48:12.304 IST ] [CmdlineArgs.initArgs:137] Initializing command line arguments...
      [main] [ 2013-03-13 18:48:12.305 IST ] [CmdlineArgs.setOraArgs:242] Setting Oracle arguments...
      [main] [ 2013-03-13 18:48:12.305 IST ] [CmdlineArgs.setOraArgs:246] Passed Oracle Home = NO_VALUE
      [main] [ 2013-03-13 18:48:12.305 IST ] [CmdlineArgs.setOraArgs:249] Read Oracle Home = /opt/oracle11/product/11.2.0.3/db_1
      [main] [ 2013-03-13 18:48:12.305 IST ] [CmdlineArgs.setOraArgs:252] Read Oracle Home ID =
      [main] [ 2013-03-13 18:48:12.306 IST ] [CmdlineArgs.setOraArgs:255] Read Oracle Home Name = null
      [main] [ 2013-03-13 18:48:12.306 IST ] [CmdlineArgs.setOraArgs:263] Setting Oracle Home = /opt/oracle11/product/11.2.0.3/db_1
      [main] [ 2013-03-13 18:48:12.306 IST ] [InitialSetup.configureOPS:4539] Cluster mode is OFF
      [main] [ 2013-03-13 18:48:12.307 IST ] [InitialSetup.<init>:4058] TNS_ADMIN is: /network/admin
      [main] [ 2013-03-13 18:48:12.310 IST ] [OPSUtil.getHomeVersion:446] Inside getHomeVersion...
      [main] [ 2013-03-13 18:48:12.310 IST ] [OPSUtil.getHomeVersion:447] oracleHome = /opt/oracle11/product/11.2.0.3/db_1
      [main] [ 2013-03-13 18:48:12.310 IST ] [OPSUtil.getHomeVersion:451] oracle.sysman.assistants.util.OracleHome Object = /opt/oracle11/product/11.2.0.3/db_1
      [main] [ 2013-03-13 18:48:12.310 IST ] [OracleHome.getVersion:889] OracleHome.getVersion called. Current Version: null
      [main] [ 2013-03-13 18:48:12.313 IST ] [InventoryUtil.getOUIInvSession:347] setting OUI READ level to ACCESSLEVEL_READ_LOCKLESS
      [main] [ 2013-03-13 18:48:12.313 IST ] [OracleHome.getVersion:908] Homeinfo /opt/oracle11/product/11.2.0.3/db_1,2
      [main] [ 2013-03-13 18:48:12.733 IST ] [OracleHome.getVersion:936] OracleHome.server.getVersion Version: 11.2.0.3.0
      [main] [ 2013-03-13 18:48:12.733 IST ] [OracleHome.getVersion:957] Current Version From Inventory: 11.2.0.3.0
      [main] [ 2013-03-13 18:48:12.733 IST ] [OPSUtil.getHomeVersion:452] returning oracleHome Version = 11.2.0.3.0
      [main] [ 2013-03-13 18:48:12.733 IST ] [OracleHome.getVersion:889] OracleHome.getVersion called. Current Version: 11.2.0.3.0
      [main] [ 2013-03-13 18:48:12.734 IST ] [OracleHome.getVersion:957] Current Version From Inventory: 11.2.0.3.0
      [main] [ 2013-03-13 18:48:12.734 IST ] [InitialSetup.<init>:4071] Admin location is: /network/admin
      [main] [ 2013-03-13 18:48:12.767 IST ] [ConfigureProfile.setProfileParam:136] Setting ADR_BASE: /opt/oracle11/product

      Edited by: user2366127 on Mar 14, 2013 12:26 AM
        • 1. Re: Netca can't find tnsnames.ora file event though it exists.
          EdStevens
          user2366127 wrote:
          Hi,

          I'm a newbie in Oracle and need some help of an experienced guy :)
          I've installed Oracle 11.2R3 on Linux and currently try to run netca assistant to create an alias.

          In the UI everything looks OK, but the tnsnames.ora is not created.
          Looking at the logs I saw that it is looking the file under : /network/admin without $ORACLE_HOME (which is well defined) at its beginning.

          Log output is below.
          Can somebody help me?

          Thank you all for your help :)



          Log output

          netcaXXXlog :

          Oracle Net Services Configuration:
          ServiceAliasException: Could not save Service Alias: TNS-04415: File i/o error
          caused by: java.io.FileNotFoundException: /network/admin/tnsnames.ora (No such file or directory)
          Default local naming configuration complete.
          Created net service name: db67
          Oracle Net Services configuration successful. The exit code is 0


          traceXXXlog
          [main] [ 2013-03-13 18:48:12.227 IST ] [NetCALogger.initTrace:203] Oracle Net Configuration Assistant: 1303136PM4811
          [main] [ 2013-03-13 18:48:12.227 IST ] [NetCALogger.initTrace:204] Oracle Home: /opt/oracle11/product/11.2.0.3/db_1
          [main] [ 2013-03-13 18:48:12.227 IST ] [NetCALogger.initTrace:205] Oracle Base: /opt/oracle11/product
          [main] [ 2013-03-13 18:48:12.228 IST ] [NetCALogger.initTrace:206] Oracle Home Name: OraDb11g_home2
          [main] [ 2013-03-13 18:48:12.264 IST ] [InventoryUtil.getOUIInvSession:347] setting OUI READ level to ACCESSLEVEL_READ_LOCKLESS
          [main] [ 2013-03-13 18:48:12.264 IST ] [HAUtils.<init>:239] oui location /opt/oracle11/oraInventory/ContentsXML
          [main] [ 2013-03-13 18:48:12.276 IST ] [Version.isPre:528] version to be checked 11.2.0.3.0 major version to check against10
          [main] [ 2013-03-13 18:48:12.276 IST ] [Version.isPre:539] isPre.java: Returning FALSE
          [main] [ 2013-03-13 18:48:12.280 IST ] [OCR.loadLibrary:312]
          Inside constructor of OCR
          [main] [ 2013-03-13 18:48:12.295 IST ] [OCR.loadLibrary:320] Going to load the ocr library
          [main] [ 2013-03-13 18:48:12.295 IST ] [Library.load:188] library.load
          [main] [ 2013-03-13 18:48:12.296 IST ] [sPlatform.isHybrid:66] osName=Linux osArch=amd64 JVM=64 rc=false
          [main] [ 2013-03-13 18:48:12.296 IST ] [sPlatform.isHybrid:66] osName=Linux osArch=amd64 JVM=64 rc=false
          [main] [ 2013-03-13 18:48:12.296 IST ] [Library.load:264] Loading library /opt/oracle11/product/11.2.0.3/db_1/lib/libsrvmocr11.so
          [main] [ 2013-03-13 18:48:12.298 IST ] [OCR.loadLibrary:322] loaded ocr libraries
          [main] [ 2013-03-13 18:48:12.298 IST ] [OCR.isCluster:952] Calling OCRNative for isCluster()
          [main] [ 2013-03-13 18:48:12.300 IST ] [OCR.isCluster:956] OCR Result status = true
          [main] [ 2013-03-13 18:48:12.301 IST ] [OCR.isCluster:968] Bolean result = false
          [main] [ 2013-03-13 18:48:12.303 IST ] [CmdlineArgs.<init>:114] Initializing variables array...
          [main] [ 2013-03-13 18:48:12.304 IST ] [CmdlineArgs.<init>:120] Initializing NetProperties...
          [main] [ 2013-03-13 18:48:12.304 IST ] [CmdlineArgs.initArgs:137] Initializing command line arguments...
          [main] [ 2013-03-13 18:48:12.305 IST ] [CmdlineArgs.setOraArgs:242] Setting Oracle arguments...
          [main] [ 2013-03-13 18:48:12.305 IST ] [CmdlineArgs.setOraArgs:246] Passed Oracle Home = NO_VALUE
          [main] [ 2013-03-13 18:48:12.305 IST ] [CmdlineArgs.setOraArgs:249] Read Oracle Home = /opt/oracle11/product/11.2.0.3/db_1
          [main] [ 2013-03-13 18:48:12.305 IST ] [CmdlineArgs.setOraArgs:252] Read Oracle Home ID =
          [main] [ 2013-03-13 18:48:12.306 IST ] [CmdlineArgs.setOraArgs:255] Read Oracle Home Name = null
          [main] [ 2013-03-13 18:48:12.306 IST ] [CmdlineArgs.setOraArgs:263] Setting Oracle Home = /opt/oracle11/product/11.2.0.3/db_1
          [main] [ 2013-03-13 18:48:12.306 IST ] [InitialSetup.configureOPS:4539] Cluster mode is OFF
          [main] [ 2013-03-13 18:48:12.307 IST ] [InitialSetup.<init>:4058] TNS_ADMIN is: /network/admin
          [main] [ 2013-03-13 18:48:12.310 IST ] [OPSUtil.getHomeVersion:446] Inside getHomeVersion...
          [main] [ 2013-03-13 18:48:12.310 IST ] [OPSUtil.getHomeVersion:447] oracleHome = /opt/oracle11/product/11.2.0.3/db_1
          [main] [ 2013-03-13 18:48:12.310 IST ] [OPSUtil.getHomeVersion:451] oracle.sysman.assistants.util.OracleHome Object = /opt/oracle11/product/11.2.0.3/db_1
          [main] [ 2013-03-13 18:48:12.310 IST ] [OracleHome.getVersion:889] OracleHome.getVersion called. Current Version: null
          [main] [ 2013-03-13 18:48:12.313 IST ] [InventoryUtil.getOUIInvSession:347] setting OUI READ level to ACCESSLEVEL_READ_LOCKLESS
          [main] [ 2013-03-13 18:48:12.313 IST ] [OracleHome.getVersion:908] Homeinfo /opt/oracle11/product/11.2.0.3/db_1,2
          [main] [ 2013-03-13 18:48:12.733 IST ] [OracleHome.getVersion:936] OracleHome.server.getVersion Version: 11.2.0.3.0
          [main] [ 2013-03-13 18:48:12.733 IST ] [OracleHome.getVersion:957] Current Version From Inventory: 11.2.0.3.0
          [main] [ 2013-03-13 18:48:12.733 IST ] [OPSUtil.getHomeVersion:452] returning oracleHome Version = 11.2.0.3.0
          [main] [ 2013-03-13 18:48:12.733 IST ] [OracleHome.getVersion:889] OracleHome.getVersion called. Current Version: 11.2.0.3.0
          [main] [ 2013-03-13 18:48:12.734 IST ] [OracleHome.getVersion:957] Current Version From Inventory: 11.2.0.3.0
          [main] [ 2013-03-13 18:48:12.734 IST ] [InitialSetup.<init>:4071] Admin location is: /network/admin
          [main] [ 2013-03-13 18:48:12.767 IST ] [ConfigureProfile.setProfileParam:136] Setting ADR_BASE: /opt/oracle11/product

          Edited by: user2366127 on Mar 14, 2013 12:26 AM
          Copy these commands and paste them at a command prompt:
          id
          env | egrep 'ORA|PATH' | sort
          cat /etc/oratab
          lsnrctl status
          tnsping orcl
          Copy the entire session - full commands and full results -- and paste them back here.
          • 2. Re: Netca can't find tnsnames.ora file event though it exists.
            moreajays
            Hi,

            Execute below from OS prompt of oracle owner/osuser , supply SID & ORACLE_HOME as /opt/oracle11/product/11.2.0.3/db_1/ (or whichever you have) then run netca
            . oraenv
            
            netca
            Thanks,
            Ajay More
            http://www.moreajays.com
            • 3. Re: Netca can't find tnsnames.ora file event though it exists.
              user564990
              Hi guys,

              thanks for your help.

              EdStevens, here's the output of what you asked:



              +[oracle11@MachineName ~]$ id+
              uid=10741(oracle11) gid=582(oinstall) groups=582(oinstall),583(dba)
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$ env | egrep 'ORA|PATH' | sort+
              CLASSPATH=:/network/jlib
              LD_LIBRARY_PATH=:/lib:/usr/lib:/usr/local/lib
              ORACLE_BASE=/opt/oracle11/product
              ORACLE_HOME=/opt/oracle11/product/11.2.0.3/db_1
              ORACLE_PATH=/common/oracle/sql:.:/rdbms/admin
              ORACLE_SID=MySid
              ORACLE_TERM=xterm
              ORACLE_UNQNAME=MySid
              ORA_NLS10=/opt/oracle11/product/11.2.0.3/db_1/nls/data
              PATH=/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/common/oracle/bin:/bin:/opt/oracle11/product/11.2.0.3/db_1/bin
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$ cat /etc/oratab+
              +#+



              +# This file is used by ORACLE utilities. It is created by root.sh+
              +# and updated by the Database Configuration Assistant when creating+
              +# a database.+

              +# A colon, ':', is used as the field terminator. A new line terminates+
              +# the entry. Lines beginning with a pound sign, '#', are comments.+
              +#+
              +# Entries are of the form:+
              +# $ORACLE_SID:$ORACLE_HOME:<N|Y>:+
              +#+
              +# The first and second fields are the system identifier and home+
              +# directory of the database respectively. The third filed indicates+
              +# to the dbstart utility that the database should , "Y", or should not,+
              +# "N", be brought up at system boot time.+
              +#+
              +# Multiple entries with the same $ORACLE_SID are not allowed.+
              +#+
              +#+

              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$+
              +[oracle11@MachineName ~]$ lsnrctl status+

              LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 17-MAR-2013 17:09:48

              Copyright (c) 1991, 2011, Oracle.  All rights reserved.

              Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
              STATUS of the LISTENER
              ------------------------
              Alias                     LISTENER
              Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
              Start Date                15-MAR-2013 13:03:42
              Uptime                    2 days 4 hr. 6 min. 5 sec
              Trace Level               off
              Security                  ON: Local OS Authentication
              SNMP                      OFF
              Listener Log File         /opt/oracle11/product/diag/tnslsnr/MachineName/listener/alert/log.xml
              Listening Endpoints Summary...
              +(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=MachineName.devlab.ad)(PORT=1521)))+
              Services Summary...
              Service "MySid" has 1 instance(s).
              Instance "MySid", status READY, has 1 handler(s) for this service...
              Service "MySidXDB" has 1 instance(s).
              Instance "MySid", status READY, has 1 handler(s) for this service...
              The command completed successfully

              Thanks for your help
              Daniel
              • 4. Re: Netca can't find tnsnames.ora file event though it exists.
                user564990
                Hi moreajays

                I tried to make it before, but it didn't help.
                Actually, I'm quite sure that env variables are properly set and i work with a user that is in DBA group

                Thanks anyway
                Daniel
                • 5. Re: Netca can't find tnsnames.ora file event though it exists.
                  sb92075
                  user2366127 wrote:
                  Hi moreajays

                  I tried to make it before, but it didn't help.
                  Actually, I'm quite sure that env variables are properly set and i work with a user that is in DBA group

                  Thanks anyway
                  Daniel
                  tnsnames.ora is simply a text file that can be created & modified by any text editor.

                  it should look & contain like same entry below

                  ORCL=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=V112)))

                  it should reside in $ORACLE_HOME/admin/network/ directory
                  • 6. Re: Netca can't find tnsnames.ora file event though it exists.
                    user564990
                    Hi sb92075,

                    thanks for your answer.
                    Actually, I did that to workaround the issue, but I would like very much to configure my machine so that netca works properly...

                    Daniel.
                    • 7. Re: Netca can't find tnsnames.ora file event though it exists.
                      sb92075
                      TNS_ADMIN is: /network/admin
                      IMO, above appears to be WRONG
                      • 8. Re: Netca can't find tnsnames.ora file event though it exists.
                        EdStevens
                        sb92075 wrote:
                        TNS_ADMIN is: /network/admin
                        IMO, above appears to be WRONG
                        Good catch!
                        • 9. Re: Netca can't find tnsnames.ora file event though it exists.
                          jgarry
                          The purpose of the /etc/oratab file is to enable the use of oraenv to condition your environment correctly. So, you do the command that Ajay suggested to condition your environment, then the netca can use the environment to find the tnsnames.ora without making the error sb noted.

                          Edit the oratab file following the instructions in the file.

                          You can figure out which netca is being executed by executing the command
                          which netca
                          You can look at that netca file to see what it is doing, it is just a script. You might discover it set up some things based on what was going on when the installer was run, and they may be wrong.