Saturday, February 25, 2012

CMDExec not working in sql agent job.

We have both our sql server and agent running under an
account of sqlservice. I run a winrar job in the agent as
a CMDExec step and it fails everytime. If I terminal
service into the box under the sqlservice account I can
create new files on both the source and destination file
systems. I can also run the job as a batch script from the
command line.
I'm baffeled, if I can run the job as the same account
the agent is running under and specify the job as that
same user. What is stopping this job from running?
"c:\Program Files\WinRAR\rar" a -ep1 "\\Ixcorpnas01
\public1\bmurtha\telnform
[DATE].rar" "G:\MSSQL\BACKUP\telnform.BAK"
I get this error:
Executed as user: IXCORPSQL01\SqlService. The process
could not be created for step 2 of job
0x0C7C1F1321CA844D884F666429C26A67 (reason: The system
cannot find the file specified). The step failed.
But runs fine on the command line when logged in as
sqlservice.
Please help,
BryanHi Bryan
Is the service you are using a Domain account or a local account? The error
you get says it's executed as user 'IXCOPRSQL01\...' which to me sounds like
a local account rather than a domain account. If you are running it as a
local user, you might have problems getting to your '\\Ixcoprnas01\....'
share.
Regards
Steen
Bryan Murtha wrote:
> We have both our sql server and agent running under an
> account of sqlservice. I run a winrar job in the agent as
> a CMDExec step and it fails everytime. If I terminal
> service into the box under the sqlservice account I can
> create new files on both the source and destination file
> systems. I can also run the job as a batch script from the
> command line.
> I'm baffeled, if I can run the job as the same account
> the agent is running under and specify the job as that
> same user. What is stopping this job from running?
> "c:\Program Files\WinRAR\rar" a -ep1 "\\Ixcorpnas01
> \public1\bmurtha\telnform
> [DATE].rar" "G:\MSSQL\BACKUP\telnform.BAK"
> I get this error:
> Executed as user: IXCORPSQL01\SqlService. The process
> could not be created for step 2 of job
> 0x0C7C1F1321CA844D884F666429C26A67 (reason: The system
> cannot find the file specified). The step failed.
> But runs fine on the command line when logged in as
> sqlservice.
> Please help,
> Bryan|||Hi Steve,
Oddly enough I didn't figure out what was happening
until I took that line and executed in Query Analyizer
with xp_cmdshell. It wound up it was path to RAR that was
blowing up. It had nothing to to with the NAS or the
backup path. I just stuck RAR in system32 and changed this:
"c:\Program Files\WinRAR\rar" to rar and it was all good.
Regards,
Bryan
>--Original Message--
>Hi Bryan
>Is the service you are using a Domain account or a local
account? The error
>you get says it's executed as user 'IXCOPRSQL01\...'
which to me sounds like
>a local account rather than a domain account. If you are
running it as a
>local user, you might have problems getting to
your '\\Ixcoprnas01\....'
>share.
>Regards
>Steen
>
>Bryan Murtha wrote:
as[vbcol=seagreen]
the[vbcol=seagreen]
>
>.
>

No comments:

Post a Comment