AboutPeter Choi Expertise I am a senior Oracle DBA, PeopleSoft Administrator and Project Manager with
10 years experience. I have been working with PeopleSoft (HRMS 5, 7, 7.x and
8.9), Oracle RDBMS (7.3 - 10gR2) on various Unix and Windows platforms, and some Oracle Application Server (9i/10gR2). I also have experience with the configuration and administration of BEA`s Tuxedo and WebLogic for PeopleSoft 8.x.
Expert: Peter Choi Date: 6/16/2008 Subject: Oracle commands from Windows command line...
Question Peter, a couple of years ago you asked the question:
"Is there a way to run oracle commands *directly* from the windows command line? In other words, is there something similar to the osql tool for SQL Server? SQL*Plus is a command line utility for Oracle, but you first have to start it and then you can issue the commands, as far as I know there is no way to type something like 'sqlplus user=scott@mydb pwd=tiger command="exec myproc;' at the windows command line prompt."
I have the same question/need. Did you ever get a good answer to this question?
Thanks,
Stephen
Answer Hi Stephen,
With Oracle 8i and higher, you can now invoke SQL*PLUS from a MS-DOS command line in Windows.
The easiest way is to ensure that you've setup the proper paths and environment variables such as
ORACLE_HOME specifies the (home) directory where Oracle products are installed. This directory is exactly one level below ORACLE_BASE.
ORACLE_SID specifies the database (System Identifier) that you wish to connect to.
You can create a <file_name>.BAT file that can be scheduled using Task Scheduler to be launched at a specified date/time or recurrence.
Within the .bat file, you would have something like this: