How to connect to Oracle DB using Process arguments?

603 views Asked by At

I am new on Oracle and stuck in a problem for almost a week, I am trying to connect to an oracle database through TOAD, i am able to direct login through SID and Service Name using toad Application itself .

But i have a requirement to use a custom launcher for toad which launches the application from command line which directly connects to OracleDB.

I am able to connect to Oracle DB using the following command through SID

C:\toad.exe -c Username/Passwd@host:port/SID (Works Perfectly) The above command launches the TOAD app and connects me to the Oracle DB through SID.

But when I try to pass the DB Servicename instead of SID it is giving me the following error I did a lot of R&D and no relevant solution.

ora-12505 tns listener does not currently know of SID"given in connect descriptor

Discussion with DB Team

I discussed with DB team according to them Toad.exe is not accepting the "ServiceName" as an argument and according to them the issue is not at their end as toad application itself connects to the database through both SID and Service Name.

Please Help.

2

There are 2 answers

0
Mohsin Ali On BEST ANSWER

The issue was resolved by launching the toad using the following parameter

C:\toad.exe -c user/password@service_name

2
Sam On

The syntax you have listed user/pass@host:port/service is for service connection only. For SID connections it is user/pass@host:port:SID

You are probably already connecting using service name. To be sure, you can ask you DBA to provide you the DB SID and listing of parameter services_names from the database.