Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2002
    Posts
    7

    Question Unanswered: connecting to a local oracle database

    I've got personal oracle 8i and personal web server installed on my computer. I have created a database instance by the name "sfly" and wish to connect to this database instance through an asp script.

    In my asp script I do something similar to
    Conn.open "Provider=MSDAORA.1;Data Source=testname;User ID=testuser;Password=testpass"

    I have understood that the data source "testname" need to specified in the tnsnames.ora file. The following is my (only) entry in tnsnames.ora

    TESTNAME.THE-X-FILES =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC))
    )
    (CONNECT_DATA =
    (SERVICE_NAME = sfly)
    )
    )

    Where the-x-files is my default_domain specified in sqlnet.ora and sfly as mentioned is my (only) database instance.

    Though my asp script when trying to connect to the database yields the error:

    "ORA-12560: TNSrotocol adapter error"

    Do I need to specify an listener (I have tried but don't really know how or what to specify, I suppose I might need a IPC listener).

    Any hints on how to go by setting things up so I can connect to the database would be greatly appreciated. There's lots of help on net8 and tnsnames.ora but I don't seem to get thing to work...

  2. #2
    Join Date
    Jun 2002
    Posts
    1
    What is the name of the host computer and the port that the listener is listening on ?

    tns entry address line needs to indicate hostname and port in addition to protocol.

    Also check to make sure listener has been started.

    from command line - type "lsnrctl status"

  3. #3
    Join Date
    Apr 2001
    Location
    Netherlands
    Posts
    191
    Hi,

    Make sure your tnsnames entry looks like this:
    Code:
    Databasename =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SID = databasename)
        )
      )
    In your listener.ora you should have this:
    Code:
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = TCP)(HOST = NL-ROT-L045787)(PORT = 1521))
          )
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
          )
        )
      )
    
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = RUUD)
          (ORACLE_HOME = C:\oracle\product\817)
        )
        (SID_DESC =
          (SID_NAME = RCAT)
          (ORACLE_HOME = C:\oracle\product\817)
        )
      )
    And maybe (i don't know asp) you need an ODBC setup for this database.

    Ruud
    Ruud Schilders
    -----------------
    Oracle DBA
    e-mail : ruud@schilders.it
    URL : www.schilders.it
    Twitter : www.twitter.com/ruudschilders

  4. #4
    Join Date
    Jun 2002
    Posts
    7
    Databasename =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SID = databasename)
    )
    )

    I need to specify TCP as protocol even though it is a local database I wish to connect to?

  5. #5
    Join Date
    Jun 2002
    Posts
    7
    ooh, now it works, thank you, thank you , thank you , thank you , thank you , thank you , thank you , thank you :-)

    In case someone has the same problem
    I inserted the following into tnsnames.ora

    TEST.THE-X-FILES =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SID = sfly)
    )
    )

    where TEST without the .domain (whatever that is for) then is the service name I need to specify when trying to connect to the database by use of i.e. oledb like:

    Conn.open "Provider=MSDAORA.1;Data Source=TEST;User ID=anccountuserid;Password=theaccountpassword"

    and the-x-file is my domain specified in sqlnet.ora as

    NAMES.DEFAULT_DOMAIN = the-x-files

    and into listener.ora I inserted

    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = LOCALHOST)(PORT = 1521))
    )
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
    )
    )

    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = SFLY)
    (ORACLE_HOME = E:\Oracle\Ora81)
    )
    )

    So I guess I'm using TCP instead of IPC (which at least works, don't know what I was doing wrong when trying to use IPC)!

Posting Permissions

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