You are here:

Oracle/run a SQL script file outside SQL*Plus?

Advertisement


Question
Hi, one more question,

We usually use the following syntax to run a SQL script file within SQL*Plus, is there other ways to achieve this? (for example, in DB2, we can use the command: db2 -tf createdb.db2)

SQL >  @/oracle/scripts/script.sql

Thanks,
lzzzz

Answer
Hi there,

from the command line, you can also issue a sqlplus <user>/<password>@<Oracle_sid> <script.sql>.

This can easily be used for batch scheduling on both Windows or Unix platform. This assumes, as in your DB2 example, that the path to the executable is set. Otherwise you will need to include the path where the SQLPLUS.EXE (or sqlplus on unix) is loacted.

Hope this helps.

Peter

Oracle

All Answers


Answers by Expert:


Ask Experts

Volunteer


Peter Choi

Expertise

I am a senior Oracle DBA, PeopleSoft HCM specialist and Project Manager with 15+ years experience. I have been working with PeopleSoft (HRMS/HCM 5, 7, 7.x and 8.9, 9.x), Oracle RDBMS (7.3 - 11gR2) on various Unix and MS-Windows platforms, and some Oracle Application Server (9i - 11gR1). I also have experience with the configuration and administration of PeopleSoft's Internet Architecture (PIA) and the Oracle 11g Fusion Middleware and Oracle Business Intelligence (OBI).

©2012 About.com, a part of The New York Times Company. All rights reserved.