Solved

DTS Scheduling

Posted on 2001-08-13
6
277 Views
Last Modified: 2013-11-30
 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?
0
Comment
Question by:pcavacas
6 Comments
 
LVL 18

Expert Comment

by:nigelrivett
ID: 6380476
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.
0
 
LVL 2

Expert Comment

by:MCM
ID: 6381608
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.
0
 
LVL 2

Accepted Solution

by:
MCM earned 75 total points
ID: 6381620
on further thought, you really don't need the table/trigger cluge. you should be able to run
EXEC sp_start_job 'DTSPackageName'
as a command through ODBC/OLEDB
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 2

Expert Comment

by:MCM
ID: 6381628
but i should be clear that I have never done this mese'f; 'spure theory.
0
 
LVL 3

Expert Comment

by:krispols
ID: 6384308
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.
0
 
LVL 2

Author Comment

by:pcavacas
ID: 6384385
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.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

706 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now