Solved

Oracle Job Scheduling Execution

Posted on 2014-11-27
1
373 Views
Last Modified: 2014-11-30
Without being too technical about, I would like to know the usual steps that are taken to create and schedule a Job in Oracle and then have the server execute the job(Ex. A query that pulls the overnight orders) so that the Server (Windows)  at a specified time and perhaps save a csv copy of this file in a predefined location.
0
Comment
Question by:Benki Canoso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 40469811
You could use dbms_scheduler and a stored procedure to create the CSV and write it to a directory on the database server using UTL_FILE.  This requires writing some code but does keep it all in the database.

There are MANY samples of UTL_FILE and DBMS_SCHEDULER in the docs and online.

Here is the first link I found with a search:
http://nimishgarg.blogspot.com/2011/09/create-csv-file-using-plsql.html

You could also go with the simple:
Create a sql script and use sqlplus and schedule it from Windows Task Scheduler.

If the resulting CSV will not exceed 4000 characters something like this.

Create a script named mycsv.sql
set lines 4000
set trimspool on
set pages 0
set feedback off
spool c:\folder\mycsv.csv
select col1 || ',' || col2 || ',' || col3 from some_table;
spool off

Then from a CMD prompt:

sqlplus user/password @c:\script_dir\mycsv.sql
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question