Re: Backup Job Fails, but Command Works in Query Analyzer

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Nobody (Nobody_at_nowhere.com)
Date: 04/16/04


Date: Fri, 16 Apr 2004 15:27:46 -0600

Michael,

One thing that is different between the two environments are the privileges.
For instance, you may have a mapped drive accessible to you in Query
Analyzer but not to the account that runs scheduled jobs.

May be worth looking into.

Farid

"michael [multnomah]" <wewill@reclaimourfuture.net> wrote in message
news:ntKdnYjoIPbmoh3d4p2dnA@speakeasy.net...
> Hello. I am completely stuck as to why my backup job is failing. I
> have a job which backs up all user databases. All of the user databases
> get backed up no problem, except for one. That one fails with:
>
> BackupDiskFile::OpenMedia: Backup device
> 'D:\BACKUP\EMPMART_PRD\EMPMART_PRD_db_200404161121.BAK' failed to open.
> Operating system error = 32(The process cannot access the file because
> it is being used by another process.).
>
> BUT, if I run the same exact command that failed in Query Analyzer:
>
> BACKUP DATABASE [EMPMART_PRD] TO DISK =
> N'D:\BACKUP\EMPMART_PRD\EMPMART_PRD_db_200404161125.BAK' WITH INIT ,
> NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT
>
> The backup succeeds every time. What is causing the backup job to fail,
> but not the command when run separate from a scheduled job? There is no
> anti-virus or other software that might be locking the file. It is not
> a drive space or permissions issue because the same command works in
> Query Analyzer. I am stuck???



Relevant Pages

  • Syntax Error in queryout
    ... I'm trying to run the following command in the master db from SQL the Query ... Analyzer and get a "Syntax Error in 'queryout'" message: ...
    (microsoft.public.sqlserver.programming)
  • sqlmaint.exe failed when using xp_sqlmaint
    ... >I can run SQLMaint.exe from the command line just fine, ... >but when I use the same options and run from Query ... >Analyzer, ... >really doesn't have the rights needed, how would I grant ...
    (microsoft.public.sqlserver.tools)
  • sqlmaint.exe failed when using xp_sqlmaint
    ... I can run SQLMaint.exe from the command line just fine, ... but when I use the same options and run from Query ... Analyzer, ... really doesn't have the rights needed, how would I grant ...
    (microsoft.public.sqlserver.tools)
  • Re: Counting Concurrent timed events
    ... When you make a command button, Access gives it an ambiguous name like "Command2" ... ... then compile your code ... Exit Sub ... what you need to be able to do is replace the SQL using a different date before you run the query that uses it. ...
    (microsoft.public.access.queries)
  • Re: Multiple table in dataset query
    ... If a row is marked as Modified, it will run your query defined in the ... Update Command object. ... Dim UpdateStaffCmd As New OleDb.OleDbCommand ... Private Sub frmStaff_Load(ByVal sender As System.Object, ...
    (microsoft.public.dotnet.framework.adonet)