I have a job [job1] to start a trace and is scheduled to run every five
minutes:
Occurs every day every 5 minute(s) between 12:00:00 AM and 11:59:59 PM.
then...
If I have a job [job2] to stop the trace that was started in [job1] and is
scheduled to run every five minutes:
Occurs every day every 5 minute(s) between 12:00:00 AM and 11:59:59 PM.
I enable the jobs to run, and it appears that everything works great. Job1
executes for 5 minutes, followed by Job2 stopping the trace and doing what it
is asked to do. However, this seems to go against logic. Even though the
schedules for Job1 and Job2 are identical, it does not seem like they would
both execute exactly simultaneously, meaning that even though the schedules
are identical, it seems like either (in milliseconds) Job1 would execute
before Job2, or else Job2 would execute before Job1.
In the first case (Job1 before Job2), Job2 would stop Job1 after milliseconds
and no trace data would hardly ever be created. In the second case (Job2
before Job1), then Job1 does run for its five minutes before it is stopped
and restarted. So, in the second case, this is great. So far, that appears to
be what is happening, or at least my five minutes of trace is being collected,
repeatedly.
I am glad it is working like this, but it seems like it could just as easily
have Job1 execute before Job2 and hardly any trace data be collected. What
determines the order when schedules are identical?
Message posted via http://www.droptable.com
Hi
As this would be an internal undocumented feature of SQL Server you should
not rely on this staying the same between versions, therefore you should make
sure that your jobs will behave correctly regardless, for example specifying
the duration for the trace and then you would not need to stop it.
John
"cbrichards via droptable.com" wrote:
> I have a job [job1] to start a trace and is scheduled to run every five
> minutes:
> Occurs every day every 5 minute(s) between 12:00:00 AM and 11:59:59 PM.
> then...
> If I have a job [job2] to stop the trace that was started in [job1] and is
> scheduled to run every five minutes:
> Occurs every day every 5 minute(s) between 12:00:00 AM and 11:59:59 PM.
> I enable the jobs to run, and it appears that everything works great. Job1
> executes for 5 minutes, followed by Job2 stopping the trace and doing what it
> is asked to do. However, this seems to go against logic. Even though the
> schedules for Job1 and Job2 are identical, it does not seem like they would
> both execute exactly simultaneously, meaning that even though the schedules
> are identical, it seems like either (in milliseconds) Job1 would execute
> before Job2, or else Job2 would execute before Job1.
> In the first case (Job1 before Job2), Job2 would stop Job1 after milliseconds
> and no trace data would hardly ever be created. In the second case (Job2
> before Job1), then Job1 does run for its five minutes before it is stopped
> and restarted. So, in the second case, this is great. So far, that appears to
> be what is happening, or at least my five minutes of trace is being collected,
> repeatedly.
> I am glad it is working like this, but it seems like it could just as easily
> have Job1 execute before Job2 and hardly any trace data be collected. What
> determines the order when schedules are identical?
> --
> Message posted via http://www.droptable.com
>
|||In addition to John's comments, you could also just do this
in one job - the first job step to check if the trace is
running and stop it if it is. Then the second step is to
start the new trace.
-Sue
On Mon, 03 Apr 2006 23:31:34 GMT, "cbrichards via
droptable.com" <u3288@.uwe> wrote:
>I have a job [job1] to start a trace and is scheduled to run every five
>minutes:
>Occurs every day every 5 minute(s) between 12:00:00 AM and 11:59:59 PM.
>then...
>If I have a job [job2] to stop the trace that was started in [job1] and is
>scheduled to run every five minutes:
>Occurs every day every 5 minute(s) between 12:00:00 AM and 11:59:59 PM.
>I enable the jobs to run, and it appears that everything works great. Job1
>executes for 5 minutes, followed by Job2 stopping the trace and doing what it
>is asked to do. However, this seems to go against logic. Even though the
>schedules for Job1 and Job2 are identical, it does not seem like they would
>both execute exactly simultaneously, meaning that even though the schedules
>are identical, it seems like either (in milliseconds) Job1 would execute
>before Job2, or else Job2 would execute before Job1.
>In the first case (Job1 before Job2), Job2 would stop Job1 after milliseconds
>and no trace data would hardly ever be created. In the second case (Job2
>before Job1), then Job1 does run for its five minutes before it is stopped
>and restarted. So, in the second case, this is great. So far, that appears to
>be what is happening, or at least my five minutes of trace is being collected,
>repeatedly.
>I am glad it is working like this, but it seems like it could just as easily
>have Job1 execute before Job2 and hardly any trace data be collected. What
>determines the order when schedules are identical?
sql
No comments:
Post a Comment