Wednesday, February 17, 2010

Connecting to an Oracle Server...which way is faster...

I've never came across this question as such, because its sort of given that you connect to a server any-which way the administrators define the policy. The tuning perspectives came in only afterwards.

However, in a recent situation, I had to connect to a remote server from my client system and was wondering whether I should connect using tnsnames.ora or should I use the basic authentication mechanism, using the complete connect string.

I thought that the tnsnames.ora would incur some latency in connections. On the other hand, connecting directly without using any such files is like doing a telnet to the server on a given port.

Also, I have seen that if you attempt to connect using the complete connect string from the tnsnames.ora file, it also works.

Since I was not clear myself, I did post this question on oracle forums. And a gentleman, Billy Verreynne took out some time to help explain the concept. Many thanks to him.

As it stands, the basic methodology of connection is same in both cases. However, if you happen to have a huge tnsnames.ora file, it would be an overhead to parse the file and get the connect string for the service name you attempted to connect to. But it would only make a difference, if your client connection process go into hundreds then it might make any noticeable degradation. Basically, client would have to parse the huge tnsnames file few hundred times per second.. then it might make a difference.

Billy also suggested that if you switch the server mode from dedicated to shared, it would help.

So, for my conclusions, its the same if you connect through tnsnames or through a native connect string.

No comments:

Post a Comment