Link to home
Start Free TrialLog in
Avatar of pcavacas
pcavacas

asked on

DTS Scheduling

 I have an issue that I'm trying to figure out the best way to accomplish.  We have a whole bunch of procedures that run and import data each night into an Oracle database.
  We are migrating some of the stuff over to our SQL Server (SQL Server 2000).  What I need is a way to execute the DTS Package not at a specific time, but after the other packages (in Oracle) finish.  So what I have been thinking is at the end of the Oracle stuff it would INSERT a line into a row in a table (probably in Oracle, but I might be able to insert into a SQL table if needed).
  Now from this point I'm trying to figure out the best way to start the DTS package.  I could write an NT Service that monitors the table, but that seems like a lot of extra overhead for this.
  So how should I do this?
Avatar of nigelrivett
nigelrivett

Schedule a task that every 5 mins? checks this table - can do this from sql server if the table is on oracle or sql server. This then starts the dts job when this line appears.

Another way is to have as the first step in the dts job a job which loops (pausing for 5 mins?) waiting for the line to appear before completing successfully to allow the next step to run - I think this is the less complex option.
i think you could do this:

make a DTS package (i think you've done this)
make an SQL Server Agent package that will run the DTS
make a table in SQL server into which Oracle will insert a record when it is ready to be imported from
make an insert trigger on the SQL table that runs

sp_start_job

From SQL Server Books Online:
sp_start_job (T-SQL)
Instructs SQL Server Agent to execute a job immediately.

Syntax
sp_start_job [@job_name =] 'job_name' | [@job_id =] job_id
    [,[@error_flag =] error_flag]
    [,[@server_name =] 'server_name']
    [,[@step_name =] 'step_name']
    [,[@output_flag =] output_flag]


there might be a smoother way to do this, but this ain't bad.
ASKER CERTIFIED SOLUTION
Avatar of MCM
MCM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
but i should be clear that I have never done this mese'f; 'spure theory.
If your import in oracle package could call an cmd command or if your import is done from a cmd script just know that you could run a dts package from a command line or cmd batch with DTSRun utility.
Avatar of pcavacas

ASKER

MCM:  I'm going to try this solution and see if I can get the Oracle Procedure changed to do the insert into this table, shouldn't be a problem, but you never know with some people.

nigelrivett:  If I can't do MCM solution for politcal reasons, then I will try this solution.

krispols:  I can't do this solution because the stuff that fires off the jobs is on UNIX and has no like to execute commands on a Windows box.