Oracle Connection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rsrinivasan
    New Member
    • Mar 2007
    • 221

    Oracle Connection

    Hi all,
    I need to connect local database from oracle. When i give username and password and service name, it throws error "TNS name could not be resolved".

    What should i change in tnsnames file?

    Thanks in advance
    Srinivas r.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    The following is a sample of typical entry in tnsnames.ora file.
    the first one is the name of database next host name or ipaddress and port number etc
    u need to change your file accordingly
    donot delete the old entries.
    add new eentries

    [CODE=ORACLE]
    DEBASIS =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = is-18)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = DEBASIS)
    )
    )

    EXTPROC_CONNECT ION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    )
    )

    MES =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.35.15.3)(POR T = 1521))
    )
    (CONNECT_DATA =
    (SID = MES)
    )
    )
    BDCORA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.35.12.16)(PO RT = 1521))
    )
    (CONNECT_DATA =
    (SERVICE_NAME = orcl1)
    )
    )

    MESTEST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.35.14.155)(P ORT = 1521))
    )
    (CONNECT_DATA =
    (SERVICE_NAME = MESTEST)
    )
    )
    [/CODE]

    Comment

    • rsrinivasan
      New Member
      • Mar 2007
      • 221

      #3
      Originally posted by debasisdas
      The following is a sample of typical entry in tnsnames.ora file.
      the first one is the name of database next host name or ipaddress and port number etc
      u need to change your file accordingly
      donot delete the old entries.
      add new eentries

      [CODE=ORACLE]
      DEBASIS =
      (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = is-18)(PORT = 1521))
      (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = DEBASIS)
      )
      )

      EXTPROC_CONNECT ION_DATA =
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      )
      (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
      )
      )

      MES =
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.35.15.3)(POR T = 1521))
      )
      (CONNECT_DATA =
      (SID = MES)
      )
      )
      BDCORA =
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.35.12.16)(PO RT = 1521))
      )
      (CONNECT_DATA =
      (SERVICE_NAME = orcl1)
      )
      )

      MESTEST =
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.35.14.155)(P ORT = 1521))
      )
      (CONNECT_DATA =
      (SERVICE_NAME = MESTEST)
      )
      )
      [/CODE]
      Hi,
      I changed my TNS file as

      Code:
      sri =
        (DESCRIPTION =
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
          )
          (CONNECT_DATA =
            (SERVICE_NAME = sri)
          )
        )
      Still I have the same error. What to do?
      Thanks,
      Srinivas r.

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        please reply to these

        1.yours is a standalone pc or network pc.

        2.do u have multiple databases in the same system.

        3.You are trying to connect from client machine or server machine.

        Comment

        • rsrinivasan
          New Member
          • Mar 2007
          • 221

          #5
          Originally posted by debasisdas
          please reply to these

          1.yours is a standalone pc or network pc.

          2.do u have multiple databases in the same system.

          3.You are trying to connect from client machine or server machine.

          1. My pc is network pc.
          2. Till now i did not create any database in my local PC. I want to create a database in my local system. Because my server has some problem.
          3.I want to connect my local machine to oracle.

          Thanks,
          Srinivas r.

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            Originally posted by rsrinivasan
            1. My pc is network pc.
            if your pc is in network how u are using 127.0.0.1 as your ip address

            either use the system IP address or system name

            Comment

            • mukta sarangpure
              New Member
              • Jun 2007
              • 1

              #7
              hi
              This is mukta answering to ur '?'...
              First check ur database services ,
              PLZ CKECK ur listener files...
              & also listener service.




              Originally posted by rsrinivasan
              Hi all,
              I need to connect local database from oracle. When i give username and password and service name, it throws error "TNS name could not be resolved".

              What should i change in tnsnames file?

              Thanks in advance
              Srinivas r.

              Comment

              Working...