Changing The SQLPlus Working Directory

I tend to run sqlplus from the command line where it is really easy to set the working directory before each session. You just navigate to where you want the working directory to be and start sqplus from there. When you run “sqlplus” it uses the current directory as the working directory, easy!

This is how I do it in Windows, I assume it is the same in every other OS..

3 thoughts on “Changing The SQLPlus Working Directory

  1. sqlplusw does not have a CD (change dir) button, but if you set a spool file with the menus, it is easy to navigate to your directory, and this also changes the working directory. No need to use this window application throught the command-line.

  2. Hi James..

    Your knowledge on this seems wide enough. I have a query. I need to spool the output of a query into different file server locations depending on different environment. So basically need to query the path from a table, as per ‘name’ in database and then spool the output file there. I tried define dir = ” and then spool output locally assuming i am inside the folder specified in dir command. But this isnt working. Can you please suggest if any clue?


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>