Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    Join Date
    Oct 2012
    Posts
    42

    Unanswered: ORA-12154: TNS:could not resolve the connect identifier specified

    Hello,

    I just installed the Oracle Express Edition 10g on a Linux Lubuntu 12.10 and am now trying to set up a listener.

    The server and the client are on the same machine.

    When trying to access the LEARNINTOUCH database:
    sqlplus hr/hr@LEARNINTOUCH
    I get the following error message:
    ORA-12154: TNS:could not resolve the connect identifier specified

    Same thing for the XE database:
    sqlplus hr/hr@XE
    I also get the following error message:
    ORA-12154: TNS:could not resolve the connect identifier specified

    I can however log in as system user.

    I set the variable
    export TNS_ADMIN=$ORACLE_HOME/network/admin
    but it did not help.

    Here is the content of the oracle/xe/app/oracle/product/10.2.0/server/network/admin/listener.ora file:

    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server)
    (PROGRAM = extproc)
    )
    )

    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    (ADDRESS = (PROTOCOL = TCP)(HOST = stephane-ThinkPad-X61s)(PORT = 1521))
    )
    )

    DEFAULT_SERVICE_LISTENER = (XE)

    Here is the content of the oracle/xe/app/oracle/product/10.2.0/server/network/admin/sqlnet.ora file:

    NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, HOSTNAME)
    NAMES.DEFAULT_DOMAIN = WORLD
    TRACE_LEVEL_CLIENT = OFF
    SQLNET.EXPIRE_TIME = 30

    Here is the content of the oracle/xe/app/oracle/product/10.2.0/server/network/admin/tnsnames.ora file:

    LEARNINTOUCH =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = stephane-ThinkPad-X61s)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = learnintouch)
    )
    )

    XE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = stephane-ThinkPad-X61s)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    )
    )

    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    )
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    )
    )

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Try
    Code:
    sqlplus hr/hr@LEARNINTOUCH.world
    The default domain in the sqlnet.ora file is ".world".

  3. #3
    Join Date
    Oct 2012
    Posts
    42
    It gave me the same message:

    stephane@stephane-ThinkPad-X61s:~> sqlplus hr/hr@LEARNINTOUCH.world

    SQL*Plus: Release 10.2.0.1.0 - Production on Thu Oct 25 17:30:16 2012

    Copyright (c) 1982, 2005, Oracle. All rights reserved.

    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified

    Enter user-name:

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    make tnsnames.ora look like below


    LEARNINTOUCH,LEARNINGTOUCH.WORLD =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = stephane-ThinkPad-X61s)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = learnintouch)
    )
    )
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Oct 2012
    Posts
    42
    Still same error :-)

    stephane@stephane-ThinkPad-X61s:~> sqlplus hr/hr@LEARNINTOUCH.world

    SQL*Plus: Release 10.2.0.1.0 - Production on Thu Oct 25 17:50:12 2012

    Copyright (c) 1982, 2005, Oracle. All rights reserved.

    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified

    Enter user-name:

  6. #6
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    post proof Oracle is actually using the TNSNAMES.ORA file that you are changing.

    how many different copies of tnsnames.ora file exist on this system?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  7. #7
    Join Date
    Oct 2012
    Posts
    42
    I enabled the trace in the oracle/xe/app/oracle/product/10.2.0/server/network/admin/sqlnet.ora file with

    TRACE_LEVEL_CLIENT = admin
    TRACE_DIRECTORY_CLIENT = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/trace

    I could see two trace files being created when the server was restarted.

    But none of these files, nor a third one, was appended with any content when running the command

    sqlplus hr/hr@LEARNINTOUCH.world

    As for proof that my e/app/oracle/product/10.2.0/server/network/admin/tnsnames.ora file is being loaded, I could see only this thin one:

    When I start the server it shows the following
    root@stephane-ThinkPad-X61s:/home/stephane# /etc/init.d/oracle-xe start
    Starting Oracle Net Listener.
    Starting Oracle Database 10g Express Edition Instance.

    But if I put some dummy text in the tnsnames.ora
    ferjf oirefjoire
    LEARNINTOUCH,LEARNINGTOUCH.WORLD =
    then when starting the server only shows
    root@stephane-ThinkPad-X61s:/home/stephane# /etc/init.d/oracle-xe start
    Starting Oracle Database 10g Express Edition Instance.

    And I can repeat it and it's consistent.

    Not really much of a proof but it's all I have..

  8. #8
    Join Date
    Oct 2012
    Posts
    42
    There is a new trace file created on every stop and every start of the server.

    But none of these trace files contain the string tnsnames

  9. #9
    Join Date
    Oct 2012
    Posts
    42
    The trace file from the last server start.
    Attached Files Attached Files

  10. #10
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    issue the following OS command

    script capture.log

    above essentially "tees" the console output into capture.log file
    next issue following OS command

    strace sqlplus hr/hr@LEARNINTOUCH.world

    above reports every OS system call including file open (FOPEN)

    a CTRL-D terminates the script command.
    then you can search the capture.log to see which tnsnames.ora file actually gets opened
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  11. #11
    Join Date
    Oct 2012
    Posts
    42
    Okay, will do in a minute.

    In the meantime please note that I can run this command and log in fine:

    stephane@stephane-ThinkPad-X61sracle> sqlplus hr/hr
    SQL*Plus: Release 10.2.0.1.0 - Production on Thu Oct 25 18:50:27 2012
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL>

  12. #12
    Join Date
    Oct 2012
    Posts
    42
    stephane@stephane-ThinkPad-X61sracle> script capture.log
    Script started, file is capture.log

    I then ran your command and could see in the capture.log file which file was being accessed.

    It looks like it's the correct one.

    access("/home/stephane/.tnsnames.ora", F_OK) = -1 ENOENT (No such file or directory)^M
    access("/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/tnsnames.ora", F_OK) = 0^M
    gettimeofday({1351180351, 845698}, NULL) = 0^M
    stat64("/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/tnsnames.ora", {st_mode=S_IFREG|0644, st_size=658, ...}) = 0^M
    open("/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/tnsnames.ora", O_RDONLY|O_LARGEFILE) = 10^M
    Attached Files Attached Files

  13. #13
    Join Date
    Oct 2012
    Posts
    42
    As you can see I'm trying to connect to a listener.

    For example, the learnintouch listener.

    But I have not yet created any database schema.

    For example, the dbs directory only contains files related to the XE database for now.

    stephane@stephane-ThinkPad-X61sracle> ll /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/dbs/
    total 28
    -rw-rw---- 1 oracle dba 1544 Oct 25 19:17 hc_XE.dat
    -rwxr-xr-x 1 oracle dba 8385 Feb 24 2006 init.ora
    -rw-rw---- 1 oracle dba 24 Oct 24 19:06 lkXE
    -rw-r----- 1 oracle dba 1536 Oct 25 13:32 orapwXE
    -rw-r----- 1 oracle dba 2560 Oct 25 19:17 spfileXE.ora
    stephane@stephane-ThinkPad-X61sracle>

    I guess a listener can exist without an accompanying database.?

  14. #14
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    sqlplus hr/hr@XE
    exit

    COPY the results from above, then PASTE all back here

    modify tnsnames.ora to be like below


    XE, NEW_ALIAS =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = stephane-ThinkPad-X61s)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    )
    )

    issue the OS command below

    sqlplus hr/hr@NEW_ALIAS

    COPY the results from above, then PASTE all back here
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  15. #15
    Join Date
    Oct 2012
    Posts
    42
    Hi, so here is the first result:

    stephane@stephane-ThinkPad-X61s:~> sqlplus hr/hr@XE

    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Oct 26 06:55:24 2012

    Copyright (c) 1982, 2005, Oracle. All rights reserved.

    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified


    And after modification, of the file entry into

    XE,NEW_ALIAS =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = stephane-ThinkPad-X61s)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    )
    )

    the result of sqlplus hr/hr@NEW_ALIAS is

    stephane@stephane-ThinkPad-X61s:~> sqlplus hr/hr@NEW_ALIAS

    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Oct 26 06:58:37 2012

    Copyright (c) 1982, 2005, Oracle. All rights reserved.

    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •