This discussion is archived
7 Replies Latest reply: Sep 6, 2012 1:19 PM by 960254 RSS

How to connect to localhost having Oracle XE 11.2g

960254 Newbie
Currently Being Moderated
Hi all, I am just beginning to familiarize with the integration of Oracle and .Net apps.
I wanted to build a simple app that connects to a newly installed oracle db express 11g.
I do have a tnsnames.ora file configured containing the following

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

when I select the 'Run SQL*Plus Script' menu item from within the Tools main menu item in visual studio 2010, I am able to
see the 'localhost' in the 'Data source name' dropdown. However, when I try to test the connection using
the credentials that I used for the 'system' user name, I get an error saying:

ORA-12514: TNS:listener does not currently know of service
requested in connect descriptor

How can I configure the local listener.ora file to be able to connect successfully?

Thanks in advance
  • 1. Re: How to connect to localhost having Oracle XE 11.2g
    Christian.Shay - Oracle Pro
    Currently Being Moderated
    957251 wrote:
    Hi all, I am just beginning to familiarize with the integration of Oracle and .Net apps.
    I wanted to build a simple app that connects to a newly installed oracle db express 11g.
    I do have a tnsnames.ora file configured containing the following

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

    when I select the 'Run SQL*Plus Script' menu item from within the Tools main menu item in visual studio 2010, I am able to
    see the 'localhost' in the 'Data source name' dropdown. However, when I try to test the connection using
    the credentials that I used for the 'system' user name, I get an error saying:

    ORA-12514: TNS:listener does not currently know of service
    requested in connect descriptor

    How can I configure the local listener.ora file to be able to connect successfully?

    Thanks in advance
    Networking configuration can be one of the trickiest part of getting started with Oracle. My advice is to keep it as simple as you can.

    When you installed XE it should have created a TNSNAMES.ORA for you in the XE home. (<home>/NETWORK/ADMIN)

    Start by copying that TNSNAMES.ORA over to the <ODT home>/Network/Admin
  • 2. Re: How to connect to localhost having Oracle XE 11.2g
    960254 Newbie
    Currently Being Moderated
    Thanks for the quick response. Sure, I already did that, but now that the XE database is recognized, and I test the connection is telling me that the HR account is locked. I tried to unlock it in XE but I do not know how. Do I need to use SQL developer for that? Thanks again.
  • 3. Re: How to connect to localhost having Oracle XE 11.2g
    Christian.Shay - Oracle Pro
    Currently Being Moderated
    957251 wrote:
    Thanks for the quick response. Sure, I already did that, but now that the XE database is recognized, and I test the connection is telling me that the HR account is locked. I tried to unlock it in XE but I do not know how. Do I need to use SQL developer for that? Thanks again.
    First connect as SYS, as SYSDBA. Then issue:

    ALTER USER hr ACCOUNT UNLOCK

    You will find that Google is very helpful for a lot of the getting started type of issues....
  • 4. Re: How to connect to localhost having Oracle XE 11.2g
    960254 Newbie
    Currently Being Moderated
    Sure, Thanks so much again for the reply with the right answer, and I have searched in google already but I was just
    trying to follow the documentation that is provided, and the scenarios that I am finding were not documented.

    Now, even thought I have been able to unlock the connection, when I try to connect using the default HR user with the hr password, the error that I get is that it is an invalid set of credentials i.e. 'Invalid username/password. login denied'. I do not know if it is because I had to install the XE database with a different set of credentials (i.e. admin)which are different from my normal credentials under which I run Visual Studio as an application
    Can you suggest something for this? Thanks again
  • 5. Re: How to connect to localhost having Oracle XE 11.2g
    Christian.Shay - Oracle Pro
    Currently Being Moderated
    >
    Now, even thought I have been able to unlock the connection, when I try to connect using the default HR user with the hr password, the error that I get is that it is an invalid set of credentials i.e. 'Invalid username/password. login denied'. I do not know if it is because I had to install the XE database with a different set of credentials (i.e. admin)which are different from my normal credentials under which I run Visual Studio as an application
    Can you suggest something for this? Thanks again
    During the install, you must have set the password and then forgot it.

    Log in as SYS again, and issue

    ALTER USER HR IDENTIFIED BY YOURNEWPASSWORD
  • 6. Re: How to connect to localhost having Oracle XE 11.2g
    orafad Oracle ACE
    Currently Being Moderated
    957251 wrote:
    trying to follow the documentation that is provided, and the scenarios that I am finding were not documented.
    The Getting Started guide seem to cover "scenarios" mentioned in this thread (e.g. how to properly reset HR user).

    http://docs.oracle.com/cd/E17781_01/admin.112/e18585/toc.htm
  • 7. Re: How to connect to localhost having Oracle XE 11.2g
    960254 Newbie
    Currently Being Moderated
    Great! that worked. I also created a new workspace, and was able to connect to it successfully.
    I really appreciate your help. Thanks!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points