Tuesday, March 27, 2012

Backup failing

Hi everybody,
I have the below script on SQL Server 2005, SP1 on Windows 2003 Server to
backup a database
BACKUP DATABASE [XYZ] FILEGROUP = N'PRIMARY' TO [XYZ] WITH NOFORMAT, NOINIT,
NAME = N'XYZ-Full Filegroup Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
declare @.backupSetId as int
select @.backupSetId = position from msdb..backupset where
database_name=N'XYZ' and backup_set_id=(select max(backup_set_id) from
msdb..backupset where database_name=N'XYZ' )
if @.backupSetId is null begin raiserror(N'Verify failed. Backup information
for database ''XYZ'' not found.', 16, 1) end
RESTORE VERIFYONLY FROM [XYZ] WITH FILE = @.backupSetId, NOUNLOAD, NOREWIND
GO
And after 40% processing the backup fails with below error message. I have
been trying to find out the solution for past 2 days, but in vain. Can
someone look at below results and show me any pointers?
10 percent processed.
20 percent processed.
30 percent processed.
Msg 3634, Level 16, State 1, Line 1
The operating system returned the error '32(The process cannot access the
file because it is being used by another process.)' while attempting
'CreateFile' on 'F:\MSSQL\005.YINT01\XYZ\XYZ01.mdf'.
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Msg 50000, Level 16, State 1, Line 3
Verify failed. Backup information for database 'XYZ' not found.
Msg 3250, Level 16, State 0, Line 4
The value '0' is not within range for the FILE parameter.
Msg 3013, Level 16, State 1, Line 4
VERIFY DATABASE is terminating abnormally.
On Feb 26, 5:42 am, Viking <Vik...@.discussions.microsoft.com> wrote:
> Hi everybody,
> I have the below script on SQL Server 2005, SP1 on Windows 2003 Server to
> backup a database
> BACKUP DATABASE [XYZ] FILEGROUP = N'PRIMARY' TO [XYZ] WITH NOFORMAT, NOINIT,
> NAME = N'XYZ-Full Filegroup Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
> GO
> declare @.backupSetId as int
> select @.backupSetId = position from msdb..backupset where
> database_name=N'XYZ' and backup_set_id=(select max(backup_set_id) from
> msdb..backupset where database_name=N'XYZ' )
> if @.backupSetId is null begin raiserror(N'Verify failed. Backup information
> for database ''XYZ'' not found.', 16, 1) end
> RESTORE VERIFYONLY FROM [XYZ] WITH FILE = @.backupSetId, NOUNLOAD, NOREWIND
> GO
> And after 40% processing the backup fails with below error message. I have
> been trying to find out the solution for past 2 days, but in vain. Can
> someone look at below results and show me any pointers?
> 10 percent processed.
> 20 percent processed.
> 30 percent processed.
> Msg 3634, Level 16, State 1, Line 1
> The operating system returned the error '32(The process cannot access the
> file because it is being used by another process.)' while attempting
> 'CreateFile' on 'F:\MSSQL\005.YINT01\XYZ\XYZ01.mdf'.
> Msg 3013, Level 16, State 1, Line 1
> BACKUP DATABASE is terminating abnormally.
> Msg 50000, Level 16, State 1, Line 3
> Verify failed. Backup information for database 'XYZ' not found.
> Msg 3250, Level 16, State 0, Line 4
> The value '0' is not within range for the FILE parameter.
> Msg 3013, Level 16, State 1, Line 4
> VERIFY DATABASE is terminating abnormally.
AS the error states, some other process is grabbing the file while
your restore in in process. Are you running some anti-virus software
that isn't configured properly for a SQL Server machine? Tape backup
perhaps?
|||I should have mentioned all the testing I have done. Tracy, yes, there is
anti-virus software on the system. I have disabled the service ran the job
again and yet I get the same error. There is no tape backup connected this
server. I am just lost in finding out the cause..!
"Tracy McKibben" wrote:

> On Feb 26, 5:42 am, Viking <Vik...@.discussions.microsoft.com> wrote:
> AS the error states, some other process is grabbing the file while
> your restore in in process. Are you running some anti-virus software
> that isn't configured properly for a SQL Server machine? Tape backup
> perhaps?
>
|||I forgot to mention one more point on "your restore in in process". In fact I
have tried running the script without RESTORE..and I still see the error.
"Viking" wrote:
[vbcol=seagreen]
> I should have mentioned all the testing I have done. Tracy, yes, there is
> anti-virus software on the system. I have disabled the service ran the job
> again and yet I get the same error. There is no tape backup connected this
> server. I am just lost in finding out the cause..!
> "Tracy McKibben" wrote:
|||I ran the process monitor and found this nearest to the failure -
CreateFileF:\MSSQL\005.YINT01\XYZ\XYZ01.mdfSHARING VIOLATIONAccess:
Generic Read, Disposition: Open, Options: No Buffering, Non-Directory File,
Open No Recall, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a
I am unable to understand why should a CreateFile should be run before the
..BAK file is written to the defined path. Infact I assumed that RESTORE
VERIFYONLY, may be the culprit, and I had removed that command too. I didn't
see any difference!
One quick update here is that this instance has FULLTEXT SEARCH. Somewhere
in the google world, I read that this failure can be related to FULLTEXT
SEARCH, but nobody gave a solution.
I hope MS - SQL TEAM guys are looking into this posting too!
"Ben UK" wrote:
[vbcol=seagreen]
> If you're backing up to a file location, you can drop a lot of the options
> you have included with the backup statement.. ..as Tracy mentioned the error
> suggests something else is accessing the bak file.. ..I've seen this error
> before on one of my backups when BackupExec had overrun and was accessing the
> bak file when the backup task kicked off.. ..try downloading something like
> filemon (from sysinternals), place a filter so you just see activity on the
> bak file, and see what other process is accessing the file..
> "Viking" wrote:
|||On Feb 26, 11:25 pm, Viking <Vik...@.discussions.microsoft.com> wrote:
> I ran the process monitor and found this nearest to the failure -
> CreateFile F:\MSSQL\005.YINT01\XYZ\XYZ01.mdf SHARING VIOLATION Access:
> Generic Read, Disposition: Open, Options: No Buffering, Non-Directory File,
> Open No Recall, Attributes: n/a, ShareMode: Read, Write, AllocationSize: n/a
> I am unable to understand why should a CreateFile should be run before the
> .BAK file is written to the defined path. Infact I assumed that RESTORE
> VERIFYONLY, may be the culprit, and I had removed that command too. I didn't
> see any difference!
> One quick update here is that this instance has FULLTEXT SEARCH. Somewhere
> in the google world, I read that this failure can be related to FULLTEXT
> SEARCH, but nobody gave a solution.
> I hope MS - SQL TEAM guys are looking into this posting too!
>
Can you post the script that you are running? I'm confused as well,
you say you're running a backup, but the error seems to be related to
creating an MDF file.
|||Yes, I am confused myself too. Why is there a CREATEFILE when I am
running the backup script (posted already).
Anyways, here is it for your quick refrence.
BACKUP DATABASE [XYZ] FILEGROUP = N'PRIMARY' TO [XYZ] WITH NOFORMAT,
NOINIT,
NAME = N'XYZ-Full Filegroup Backup', SKIP, NOREWIND, NOUNLOAD, STATS =
10
GO
declare @.backupSetId as int
select @.backupSetId = position from msdb..backupset where
database_name=N'XYZ' and backup_set_id=(select max(backup_set_id) from
msdb..backupset where database_name=N'XYZ' )
if @.backupSetId is null begin raiserror(N'Verify failed. Backup
information
for database ''XYZ'' not found.', 16, 1) end
RESTORE VERIFYONLY FROM [XYZ] WITH FILE = @.backupSetId, NOUNLOAD,
NOREWIND
GO
On Feb 27, 5:51 pm, "Tracy McKibben" <tracy.mckib...@.gmail.com> wrote:
> On Feb 26, 11:25 pm, Viking <Vik...@.discussions.microsoft.com> wrote:
>
>
>
>
> Can you post the script that you are running? I'm confused as well,
> you say you're running a backup, but the error seems to be related to
> creating an MDF file.
|||On Feb 27, 6:59 am, "VIKING" <msrvik...@.gmail.com> wrote:
> Yes, I am confused myself too. Why is there a CREATEFILE when I am
> running the backup script (posted already).
> Anyways, here is it for your quick refrence.
>
If you run ONLY this part, what happens? Just run this in Query
Analyzer:
BACKUP DATABASE [XYZ] FILEGROUP = N'PRIMARY' TO [XYZ] WITH NOFORMAT,
NOINIT, NAME = N'XYZ-Full Filegroup Backup', SKIP, NOREWIND, NOUNLOAD,
STATS = 10
GO
|||On Feb 27, 6:09 pm, "Tracy McKibben" <tracy.mckib...@.gmail.com> wrote:
> On Feb 27, 6:59 am, "VIKING" <msrvik...@.gmail.com> wrote:
>
> If you run ONLY this part, what happens? Just run this in Query
> Analyzer:
> BACKUP DATABASE [XYZ] FILEGROUP = N'PRIMARY' TO [XYZ] WITH NOFORMAT,
> NOINIT, NAME = N'XYZ-Full Filegroup Backup', SKIP, NOREWIND, NOUNLOAD,
> STATS = 10
> GO
I am doing that right away. I shall keep you posted on the happenings.
|||On Feb 27, 6:48 pm, "VIKING" <msrvik...@.gmail.com> wrote:
> On Feb 27, 6:09 pm, "Tracy McKibben" <tracy.mckib...@.gmail.com> wrote:
>
>
> I am doing that right away. I shall keep you posted on the happenings.
OK. Out of luck. I am going mad!! Here is the error ...
10 percent processed.
20 percent processed.
30 percent processed.
Msg 3634, Level 16, State 1, Line 1
The operating system returned the error '32(The process cannot access
the file because it is being used by another process.)' while
attempting 'CreateFile' on 'F:\MSSQL\005.YINT01\EDGE
\EdgeActivityCenter01.mdf'.
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.

No comments:

Post a Comment