I have a job step that needs to run with a different parameter on Sunday.
The job step is of type Operating System Command. This step kicks of an
executable.
Can you help me with a solution?
Thanks,
ChrisHow about creating a second step that has different parameters. Then create
a second job that runs prior to this job. In this second job, you can check
to see if it is Sunday and then enable appropriate step on first job and
disable the other one (and vice versa).
"csl" <kcl1998@.hotmail.com> wrote in message
news:uCOv4089HHA.3548@.TK2MSFTNGP06.phx.gbl...
>I have a job step that needs to run with a different parameter on Sunday.
> The job step is of type Operating System Command. This step kicks of an
> executable.
> Can you help me with a solution?
> Thanks,
> Chris
>|||Hi,
I do this with three job steps. Job step 2 has the 6 days a week command,
and job step 3 has the sunday command. In job step one I put a statement
that calls RAISERROR('whatever', 16, 1) on Sunday. Then I set up step one to
go to step 2 on success and step 3 on failure. Both steps 2 and 3 quit
reporting success on success and quit reporting failure on failure.
Or, just create two SQL Agent jobs. One runs weekly on Mon-Sat, and the
other runs weekly on Sun.
--
Thank you,
Daniel Jameson
SQL Server DBA
Children's Oncology Group
www.childrensoncologygroup.org
"Dragon" <noSpam_Badill@.hotmail.com> wrote in message
news:uk2aK689HHA.4584@.TK2MSFTNGP03.phx.gbl...
>
> How about creating a second step that has different parameters. Then
> create a second job that runs prior to this job. In this second job, you
> can check to see if it is Sunday and then enable appropriate step on first
> job and disable the other one (and vice versa).
> "csl" <kcl1998@.hotmail.com> wrote in message
> news:uCOv4089HHA.3548@.TK2MSFTNGP06.phx.gbl...
>>I have a job step that needs to run with a different parameter on Sunday.
>> The job step is of type Operating System Command. This step kicks of an
>> executable.
>> Can you help me with a solution?
>> Thanks,
>> Chris
>>
>
Showing posts with label operating. Show all posts
Showing posts with label operating. Show all posts
Wednesday, March 28, 2012
Friday, March 23, 2012
Job problem
Hello,
I have a job where in one of the steps I'm coping a
database backup file from one server to the other using
an operating system command xcopy. The command I'm using
is below, but the job keeps failing on this step. The
error I get is "The job failed. The Job was invoked by
User TST-SQL\VDURAN. The last step to run was step 3
(copyfile).".
The command works fine if I execute from the actual
command prompt of the source server. My destination
server directory is shared and I have set my permssions
to full control for everyone. Please help.
xcopy d:\backups\TestBackup\OrdersDB.bak
\\duran\DBBackups\
TIA,
VicWhat is the exact error for step 3 ? Is this using a CmdExec job step ?
If you look at the step history you should see the exit code for the step
and the error.
If the file exists you will want to use the /Y switch for xcopy to allow
overwring of the file although this would generally hang the step if this
was the issue. How about just using copy /Y does this work ?
I take it that the SQLService account is running under a domain account ?
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Vic" <vduran@.specpro-inc.com> wrote in message
news:009c01c3d535$d23fb7c0$a101280a@.phx.gbl...
> Hello,
> I have a job where in one of the steps I'm coping a
> database backup file from one server to the other using
> an operating system command xcopy. The command I'm using
> is below, but the job keeps failing on this step. The
> error I get is "The job failed. The Job was invoked by
> User TST-SQL\VDURAN. The last step to run was step 3
> (copyfile).".
> The command works fine if I execute from the actual
> command prompt of the source server. My destination
> server directory is shared and I have set my permssions
> to full control for everyone. Please help.
> xcopy d:\backups\TestBackup\OrdersDB.bak
> \\duran\DBBackups\
>
> TIA,
> Vic|||Is it possible that you need to supply the actual path of
the xcopy command? Also, you may want to create the job
step to execute a command (.cmd) file rather than the
command itself. This would allow you to do some type of
eror code processing. It's been a long time since I've
done that in DOS batch files, but it should be doable.
Most likely you either have a path problem or a
permissions problem though.
I know this is a rather vague response, but hopefully it
will lead to something.
Matthew Bando
BandoM@.CSCTGI(remove).com
>--Original Message--
>Hello,
> I have a job where in one of the steps I'm coping a
>database backup file from one server to the other using
>an operating system command xcopy. The command I'm
using
>is below, but the job keeps failing on this step. The
>error I get is "The job failed. The Job was invoked by
>User TST-SQL\VDURAN. The last step to run was step 3
>(copyfile).".
> The command works fine if I execute from the actual
>command prompt of the source server. My destination
>server directory is shared and I have set my permssions
>to full control for everyone. Please help.
>xcopy d:\backups\TestBackup\OrdersDB.bak
>\\duran\DBBackups\
>
>TIA,
>Vic
>.
>|||Hello there.
I got kind of a similar issue with few jobs. To pin point
to the culprit, I set the DTS package to log the whole
process.
I found out which steps in my DTS package were failing and
not the generic SQL message from the job history, which
never says exactly what happened.
I have quite a few stpes in each job that uses windows
tasks. Two of those needs some time to be completed.
The first one, unzips a daily file to be run by other
steps to copy or update some tables.
The second step, copies the unzipped files to a different
server.
I applied two solutions for those command steps.
1. For the unzip command, I added an activeX step, which
loops while the file is being used by the DTS. Problem
solved here.
2. For the copy unzipped files to a different server (I
had to copy instead of moving files due to some internal
applications), I did take the step off the DTS and
schedule it to run a few minutes after the main job is
completed. Problem solved! for good.
Set the DTS log first to see exactly where your DTS is
failing, I bet is the move step (same thing happened to
me) I hope this helps. Good luck
>--Original Message--
>Hello,
> I have a job where in one of the steps I'm coping a
>database backup file from one server to the other using
>an operating system command xcopy. The command I'm using
>is below, but the job keeps failing on this step. The
>error I get is "The job failed. The Job was invoked by
>User TST-SQL\VDURAN. The last step to run was step 3
>(copyfile).".
> The command works fine if I execute from the actual
>command prompt of the source server. My destination
>server directory is shared and I have set my permssions
>to full control for everyone. Please help.
>xcopy d:\backups\TestBackup\OrdersDB.bak
>\\duran\DBBackups\
>
>TIA,
>Vic
>.
>
I have a job where in one of the steps I'm coping a
database backup file from one server to the other using
an operating system command xcopy. The command I'm using
is below, but the job keeps failing on this step. The
error I get is "The job failed. The Job was invoked by
User TST-SQL\VDURAN. The last step to run was step 3
(copyfile).".
The command works fine if I execute from the actual
command prompt of the source server. My destination
server directory is shared and I have set my permssions
to full control for everyone. Please help.
xcopy d:\backups\TestBackup\OrdersDB.bak
\\duran\DBBackups\
TIA,
VicWhat is the exact error for step 3 ? Is this using a CmdExec job step ?
If you look at the step history you should see the exit code for the step
and the error.
If the file exists you will want to use the /Y switch for xcopy to allow
overwring of the file although this would generally hang the step if this
was the issue. How about just using copy /Y does this work ?
I take it that the SQLService account is running under a domain account ?
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Vic" <vduran@.specpro-inc.com> wrote in message
news:009c01c3d535$d23fb7c0$a101280a@.phx.gbl...
> Hello,
> I have a job where in one of the steps I'm coping a
> database backup file from one server to the other using
> an operating system command xcopy. The command I'm using
> is below, but the job keeps failing on this step. The
> error I get is "The job failed. The Job was invoked by
> User TST-SQL\VDURAN. The last step to run was step 3
> (copyfile).".
> The command works fine if I execute from the actual
> command prompt of the source server. My destination
> server directory is shared and I have set my permssions
> to full control for everyone. Please help.
> xcopy d:\backups\TestBackup\OrdersDB.bak
> \\duran\DBBackups\
>
> TIA,
> Vic|||Is it possible that you need to supply the actual path of
the xcopy command? Also, you may want to create the job
step to execute a command (.cmd) file rather than the
command itself. This would allow you to do some type of
eror code processing. It's been a long time since I've
done that in DOS batch files, but it should be doable.
Most likely you either have a path problem or a
permissions problem though.
I know this is a rather vague response, but hopefully it
will lead to something.
Matthew Bando
BandoM@.CSCTGI(remove).com
>--Original Message--
>Hello,
> I have a job where in one of the steps I'm coping a
>database backup file from one server to the other using
>an operating system command xcopy. The command I'm
using
>is below, but the job keeps failing on this step. The
>error I get is "The job failed. The Job was invoked by
>User TST-SQL\VDURAN. The last step to run was step 3
>(copyfile).".
> The command works fine if I execute from the actual
>command prompt of the source server. My destination
>server directory is shared and I have set my permssions
>to full control for everyone. Please help.
>xcopy d:\backups\TestBackup\OrdersDB.bak
>\\duran\DBBackups\
>
>TIA,
>Vic
>.
>|||Hello there.
I got kind of a similar issue with few jobs. To pin point
to the culprit, I set the DTS package to log the whole
process.
I found out which steps in my DTS package were failing and
not the generic SQL message from the job history, which
never says exactly what happened.
I have quite a few stpes in each job that uses windows
tasks. Two of those needs some time to be completed.
The first one, unzips a daily file to be run by other
steps to copy or update some tables.
The second step, copies the unzipped files to a different
server.
I applied two solutions for those command steps.
1. For the unzip command, I added an activeX step, which
loops while the file is being used by the DTS. Problem
solved here.
2. For the copy unzipped files to a different server (I
had to copy instead of moving files due to some internal
applications), I did take the step off the DTS and
schedule it to run a few minutes after the main job is
completed. Problem solved! for good.
Set the DTS log first to see exactly where your DTS is
failing, I bet is the move step (same thing happened to
me) I hope this helps. Good luck
>--Original Message--
>Hello,
> I have a job where in one of the steps I'm coping a
>database backup file from one server to the other using
>an operating system command xcopy. The command I'm using
>is below, but the job keeps failing on this step. The
>error I get is "The job failed. The Job was invoked by
>User TST-SQL\VDURAN. The last step to run was step 3
>(copyfile).".
> The command works fine if I execute from the actual
>command prompt of the source server. My destination
>server directory is shared and I have set my permssions
>to full control for everyone. Please help.
>xcopy d:\backups\TestBackup\OrdersDB.bak
>\\duran\DBBackups\
>
>TIA,
>Vic
>.
>
Subscribe to:
Posts (Atom)