SQL*Plus looks for scripts in the current directory, and then in the directories specified by the SQLPATH registry entry. Set the SQLPATH registry entry to change the script search path.
The HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0 registry subkey contains the SQLPATH registry entry. You can concatenate directories with a semicolon. For example:
First make sure that <ORACLE_HOME>\bin is in your PATH,
and then just run SQL*Plus from your personal directory on C:\.
Because it is in the PATH, SQL*Plus will be found even though it is not in the current directory; and when it starts, the default directory will be the directory that you were in when you executed the program.
Or create a shortcut on the Desktop.
For "Target", you can enter the complete path to SQL*Plus.
For "Starts in", enter your personal directory on C:\.
I do not know of any way to change the default directory once SQL*Plus is running.
> I do not know of any way to change the default directory once SQL*Plus is running.
One very late response, but... I have been using the Windows GUI version of SQl Plus (SqlplusW.exe) for years and I change the default directory all the time. Here is how:
Use the File, Open pull-down menu dialog, and navigate to the folder you want. Then, select one of the files in that directory. I keep a file named 0~A.sql in each folder where I use SQL Plus for that purpose. It contains only comments, something like:
--SET ECHO ON
Once I open such a file, all the START commands run scripts in that folder.
Now... since the Windows version of SQL Plus has been deprecated, how in the world can I do the same thing in the DOS command window version of SQL Plus?
Why in the world doesn't Oracle provide such an obviously useful feature???
I also used the trick you described here to change the working directory of SQL*Plus, and I was also surprised that the command-line version of Window is not capable of doing so... Have you got any answer to this? Did you post a SR on this to Oracle? If so, what was their answer?
I tried running sqlplus from the directory i wished to use ..
The command prompt window comes up, but then i need to connect to oracle
and I get a ORA-TNS 12560: TNS Protocol Adaptor Error
How do I cure this error?
NB I am running Oracle 11 Express on Windows Vista; 3GB RAM