Forum Stats

  • 3,840,134 Users
  • 2,262,571 Discussions
  • 7,901,154 Comments

Discussions

Accessing Oracle from VS Code

User_NVMUJ
User_NVMUJ Member Posts: 13 Red Ribbon

I'm getting started with the Oracle extension for VS Code.  I'm not an Oracle specialist.  Up until now I've been using LINQPAD and use a setup like this:

pastedImage_0.png

pastedImage_0.png

Which is the correct connection type to use in the Oracle extension for VS Code?  The closest one I found looks like this:

pastedImage_1.png

but that fails with this error:

pastedImage_2.png

so I guess I'm doing this wrong. FWIW I'm not sure what the difference is between server name and service name since LINQPAD only has server name

What is the right connection type to use here?

Message was edited by: 2930302b Added linqpad advanced properties config

Best Answer

  • Christian.Shay -Oracle
    Christian.Shay -Oracle Posts: 2,169 Employee
    edited Apr 13, 2020 1:34PM Answer ✓

    If you are truly using LDAP, then you are unfortunately out of luck as these tools do not currently support LDAP (we hope to in a coming release).

    Try searching your whole hard drive for TNSNAMES.ORA in case you have a copy where you don't expect to see if you can get a service name there. Also try contacting your DBA to see if you can connect using a service name rather than LDAP.

«1

Answers

  • Christian.Shay -Oracle
    Christian.Shay -Oracle Posts: 2,169 Employee
    edited Apr 13, 2020 1:05PM

    (Moving your post to the VS Code forum)

    I don't know the first thing about LINQPad but I googled a bit and it appears there is a SERVICE NAME field in the Advanced tab.

    Once you have that you can use Basic connection and you have all the info you need to fill in the fields.

    If that doesn't work, show me the contents of your Advanced tab.

  • User_NVMUJ
    User_NVMUJ Member Posts: 13 Red Ribbon
    edited Apr 13, 2020 1:15PM

    I updated the original post.  Hope that helps.  Can you help me understand the relationship between servername and service name?

  • Christian.Shay -Oracle
    Christian.Shay -Oracle Posts: 2,169 Employee
    edited Apr 13, 2020 1:18PM

    Rather than updating the original post, please just reply with info. Otherwise it is hard to follow this thread later for others.

    Can you give me the connection string field in the advanced tab? (obfuscated as needed). That is likely where the needed info is.

    Server name is the machine name., Service name is the name of Oracle's endpoint, listening for a connection.

  • User_NVMUJ
    User_NVMUJ Member Posts: 13 Red Ribbon
    edited Apr 13, 2020 1:26PM

    Here;'s what I have there.  Just the server name and userid.  no service name

    pastedImage_0.png

    However, the vs code connection config needs a server name *and* a service name or i can't connect.

  • User_NVMUJ
    User_NVMUJ Member Posts: 13 Red Ribbon
    edited Apr 13, 2020 1:31PM

    If this helps. my sqlnet.ora has

    NAMES.DIRECTORY_PATH= (TNSNAMES,LDAP)

    and my ldap.ora has:

    DEFAULT_ADMIN_CONTEXT = "dc=bkng,dc=net"

    DIRECTORY_SERVERS = (bngoradir.bkng.net:389:636, bngoradir2.bkng.net:389:636, bngoradir3.bkng.net:389:636)

    DIRECTORY_SERVER_TYPE = OID

    I don;'t have a tsnames.ora file

  • Christian.Shay -Oracle
    Christian.Shay -Oracle Posts: 2,169 Employee
    edited Apr 13, 2020 1:31PM

    You are correct, that is not enough info.

    I suspect that LINQPad is getting the info elsewhere (config file?) but googling has failed me there.

    Here is one more thing you can try: Oracle Client has a file called TNSNAMES.ORA that it can use to store for aliases to connections.

    Search your whole disk drive for TNSNAMES.ORA and see if you can find one. When you do, look inside as see if you see a connect descriptor that connects to the machine you want. You should be able to find the service name there.

    If that does not exist on your machine, the next step is to email your DBA

  • Christian.Shay -Oracle
    Christian.Shay -Oracle Posts: 2,169 Employee
    edited Apr 13, 2020 1:34PM Answer ✓

    If you are truly using LDAP, then you are unfortunately out of luck as these tools do not currently support LDAP (we hope to in a coming release).

    Try searching your whole hard drive for TNSNAMES.ORA in case you have a copy where you don't expect to see if you can get a service name there. Also try contacting your DBA to see if you can connect using a service name rather than LDAP.

  • User_NVMUJ
    User_NVMUJ Member Posts: 13 Red Ribbon
    edited Apr 13, 2020 3:55PM

    Yeah I don't have a tsnames.ora. have to wait until you support ldap!  Thanks for helping me understand better

  • Christian.Shay -Oracle
    Christian.Shay -Oracle Posts: 2,169 Employee
    edited Dec 1, 2020 5:51PM

    Edit 12/1/2020:

    Hi,

    In version 19.3.3 we have a bug that is causing LDAP to continue to not work. For instructions on how to workaround this issue (which will be fixed in the next release), please view this page:

    https://www.oracle.com/database/technologies/appdev/dotnet/configure-ldap-windows.html


  • Christian.Shay -Oracle
    Christian.Shay -Oracle Posts: 2,169 Employee
    edited Dec 1, 2020 5:51PM