|
|
|
|
|
|
|
|
Re: SQL*Plus on machine Oracle server is installed - TCP/IP or some sort of socket conection? [message #623273 is a reply to message #623266] |
Sun, 07 September 2014 12:38   |
 |
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
rc3d wrote on Sun, 07 September 2014 11:27thank you guys.
Is that correct, that I should use only this:
for scripts located on the Oracle server? Because if Listener down, scripts still running and better performance (no TCP/IP overhead)?
Let's get back to basics.
When you enter a command - any command - the command processor delimits the command line by spaces. The first string of text is taken as the name of some executable. The command processor will attempt to locate and load said executable. Everything on the command line after the first space is taken to be parameters used by the executable for whatever purpose the executable sees fit.
So when you enter 'sqlplus user/pass @sid', the command processor will attempt to locate an executable named 'sqlplus', load it, and pass process control to it, along with pointers to "user/pass" and "@sid". sqlplus assumes the first parameter (in this case "user/pass" is username and password for a connection request. Since that particular parameter (delimited by the space) did not include an "@", the connection will be to a local database identified by the environment variable ORACLE_SID. In parsing out the rest of the parameters (in this case, the only additional parameter is "@sid") it will see the "@" and take what follows ("sid") as the name of a sql script (in the case "sid.sql"). That script must be located on a file system accessible to the same machine from which sqlplus is executing. With no further qualifications, it will look for "sid.sql" in the "current" directory that was in effect when sqlplus was started.
Back to the initial command line. Remember, spaces are used to delimit the command from its parameters, and delimit the various parameters. So if you enter "sqlplus user/pass@sid" (no space before the "@"), then the "@sid" is part of the first parameter and so is part of the connection specification. In this case the @ is the delimiter denoting that what follows is the net service name to be resolved to locate the database via tns.
Suppose we enter "sqlplus user/pass@sid @sid"?
As for your assumption about performance, in theory yes a bequeath connection should involve less overhead than a network connection. But I defy you to demonstrate a meaningful difference.
I'd also strongly recommend you spend some time in the SQL Plus User Guide and Reference, esp. "SQLPLUS Program Syntax" http://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_three.htm#i1169374
|
|
|
|