databaseoracle-databasetoadtnsnames

Retrieve the Port to which TOAD for Oracle is connecting to a particular Database


I am using toad for Oracle, neither toad or oracle are my regular tools but inherit a system to give maintenance. The point is this, Toad connects to all the DB's that I need, but I need to get the information of each connection for documentation purpose. I saw the tnsnames.ora but not all the connections are there. I need, giving a connection made, to know to which port is connected. I already have the Host name and service, but I am unable to pull the database port number from sys_context for example.

I need this, because I cannot rely on a single machine properly configured. So, does anyone knows how to see the configuration of the current connection in Toad for Oracle??

@JustinCave I just check twice again, and it's weird. The connection is being made as a TNS name (without specifying the port) but I just checked at the TNSNames editor and the database that I'm referring to is not there. There are any other, network resource from it is taking the TNSName configuration besides the client's TNSNames.ora?? enter image description here


Solution

  • Go to a command line and type

    tnsping <<TNS alias from Toad>>
    

    Assuming that resolves correctly, the output will contain the sqlnet.ora file that was used. The sqlnet.ora file, in turn, will specify which TNS resolution method(s) are being used and might contain a pointer to some other tnsnames.ora file. I don't know how sophisticated Toad is at figuring out all the tnsnames.ora files that might be involved but I'd expect it is unaware of all the options in configuring TNS name resolution. It may also be that your client is configured to use an Oracle Names server or an LDAP server to resolve aliases instead of or in addition to one or more tnsnames.ora files.