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

180 pts.
Tags:
TNSNAMES.ora
I have tried many solutions but dint work ? ? please help me out

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 17  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    The first things to check would be:

    1. The tnsnames.ora file exists in the correct path.
    2. The service name you are using is correctly included in the tnsnames.ora file.
    If after checking these points you still need help, please provide more details such as the database version, the operating system, and maybe the contents of your tnsnames.ora file.

    Also, it could be useful to know what you have already tried.

    69,175 pointsBadges:
    report
  • sumeetmalani29
    1) The tnsnames.ora file exists in the correct path
       /$ORACLE_HOME/dbs/network/admin.
    2)  how to know the service name that iam using
         is it ORCL name of service ? ?
    a)database version is 11g
    b) linux 5 os installed in vmware workstation

    180 pointsBadges:
    report
  • carlosdl
    You use the service name or the SID when you try to connect.  You can think of it as the name you have given to your database.

    What application are you trying to connect from?  Is it sql plus?

    Can you share the contents of your tnsnames.ora file?
    69,175 pointsBadges:
    report
  • sumeetmalani29
    i used the service name i.e ORCL
    sqlplus iam using to connect
    becoz when iam trying to connect ie sqlplus /as sysdba it is showing me to refer manual
    examples to connect:sqlplus oracle/oracle@Host/ORCL       ...

    180 pointsBadges:
    report
  • sumeetmalani29
    tnsnames.ora file contents

    <alias>= [ (DESCRIPTION_LIST =  # Optional depending on whether u have 
                                    # one or more descriptions
                                    # If there is just one description, unnecessary ]
              (DESCRIPTION=
                [ (SDU=2048) ]      # Optional, defaults to 2048
                                    # Can take values between 512 and 32K
                [ (ADDRESS_LIST=    # Optional depending on whether u have
                                    # one or more addresses
                                    # If there is just one address, unnecessary ]
                  (ADDRESS=
                    [ (COMMUNITY=<community_name>) ]
                    (PROTOCOL=tcp)
                    (HOST=<hostname>)
                    (PORT=<portnumber (1521 is a standard port used)>)
                  )
                  [ (ADDRESS=
                      (PROTOCOL=ipc)
                      (KEY=<ipckey (PNPKEY is a standard key used)>)
                    )
                  ]

    180 pointsBadges:
    report
  • carlosdl
    Your tnsnames.ora looks like a sample.  It does not have real information.

    It should include something like this:

    MYDATABASE =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = YOUR.SERVER.IP.ADDRESS)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = ORCL)
        )
      )

    Then, assuming that your username and password are both "oracle", you would connect like this:

    sqlplus oracle/oracle@MYDATABASE as sysdba


    69,175 pointsBadges:
    report
  • sumeetmalani29
    okay sir i will try !!!
    180 pointsBadges:
    report
  • sumeetmalani29
    sir i have tried the scenario !!!
    [oracle@localhost ~]$ sqlplus oracle/oracle@MYDATABASE as sysdba

    SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 10 22:22:38 2014

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

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


    Enter user-name: oracle
    Enter password: 
    ERROR:
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux Error: 2: No such file or directory
    Process ID: 0
    Session ID: 0 Serial number: 0

    180 pointsBadges:
    report
  • carlosdl
    That most likely means the database is not running.

    We are entering a field that is not very known to me, since I'm not a DBA, but I will try to help as much as I can.

    P.s.  Did you amend your tnsnames file to include an entry for "MYDATABASE"?
    69,175 pointsBadges:
    report
  • sumeetmalani29
    Yes i amended tnsnames file to include an entry for mydatabase
    180 pointsBadges:
    report
  • carlosdl
    Can you share the new contents of your tnsnames file?

    Also, to check if the oracle instance is running, you could issue this command from the terminal:

    $ ps -ef | grep pmon
    if it doesn't find the pmon process, then the instance is not running.



    69,175 pointsBadges:
    report
  • sumeetmalani29
     ps -ef | grep pmon
    oracle    8317  6076  0 22:51 pts/2    00:00:00 grep pmon

    180 pointsBadges:
    report
  • sumeetmalani29
    New Contents of my TNSNAMES.ora

    MYDATABASE = sam
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.65.130 )(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = ORCL)
        )
      )

    180 pointsBadges:
    report
  • carlosdl
    The database is not running.

    To start it, try the following:

    $ lsnrctl start
    $ dbstart

    You could also try to connect using operating system authentication, and once connected start the instance:

    $ sqlplus / as sysdba
    SQL> STARTUP
    

    As for the tnsnames file, you should remove "sam" from it.  Everything else looks correct.



    69,175 pointsBadges:
    report
  • sumeetmalani29
    But still iam getting the same problem sir. but thanks for yur help iam so thankful to you sir.i decided to uninstall the database and again i will install it !!
    180 pointsBadges:
    report
  • carlosdl
    Okay.

    Feel free to ask more questions if you need help.

    Good luck!
    69,175 pointsBadges:
    report
  • sumeetmalani29
    Thank you sir !!!
    it is my honor to ask help from you !!!
    in the future if i need help i definitely ask questions !!!
    180 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following