Maintenance Plan Error - File in Use by Another Process

  • We just moved to Server 2008 (from 2000) and after setting up the maintenance plans, everything seems to work, except some of the job history entries show:

    The process cannot access the file ... because it is being used by another process.

    It only happens on the report files.

    Half of the subplan steps will generate the report file just fine, half of them will throw the error.

    Sometimes the error is thrown more than once.

    Even when the error is thrown, the report file is still generated just fine.

    And the report file itself contains the same errors (and the same number of times).

    For example, at the bottom of one report file (where everything is listed as a success):

    Task start: 2010-07-03T00:10:14.

    Task end: 2010-07-03T00:10:14.

    Failed:(0) The process cannot access the file ... because it is being used by another process.

    Task start: 2010-07-03T00:10:14.

    Task end: 2010-07-03T00:10:14.

    Failed:(0) The process cannot access the file ... because it is being used by another process.

    Nothing else should be accessing that file at that time, and the errors don't show up in the actual system logs.

    This is a clean install of Windows Server 2008 R2 Standard.

    Any ideas?

    Thanks

  • Hi

    Got the same problem.

    MaintenancePlan Package in Agentjob writing the report to the ..\MSSQL\Log Folder

    happens randomly once ore twice a week only on Servers with external Storage =>NAS NetApp

    DBMS: SQL08 SP1 CU4

    Jobreport errors:

    Task start: 2010-07-07T03:00:01.

    Task end: 2010-07-07T03:00:09.

    Failed: (-1073548784) Executing the query "EXECUTE master.dbo.xp_create_subdir N'\\\\svr1918...." failed with the following error: "xp_create_subdir() returned error 183, 'Cannot create a file when that file already exists.'". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    ...

    ...

    Task start: 2010-07-07T03:00:11.

    Task end: 2010-07-07T03:00:11.

    Failed: (0) The process cannot access the file 'K:\\MSSQL10.xxxinstance\\MSSQL\\Log\\MaintenancePlan_ApplikationDB_Back Up Database (Transaction Log)_20100707030011.txt' because it is being used by another process.

    The First error is 183 trying to write the Backupfile or Folder on the Backupstorage.

    Code 183:'Cannot create a file when that file already exists (but it cant exist, there is only one Schedule).

    Backupstorage-Info: NAS-Secondary Storage (SATA iSCSI) referenced by UNC-Path i guess CIFS?

    The second error "process cannot access .." trying to write Jobreport file in ..\MSSQL\Log folder

    Primarystorage-Info: NAS-Primarystorage iSCSI Direct attached (NetApp)

    Where should I dig? On the DBMS or OS or on the SAN or Network or even Security(ADS, DNS, ...)?

    All the OS-Logs don't show much around the failure time

    Agenthistory:

    Executed as user: xx\yy. Microsoft (R) SQL Server Execute Package Utility Version 10.0.2531.0 for 64-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 03:00:00 Progress: 2010-07-07 03:00:01.44 Source: {80D91D46-EDC9-431C-AED2-6C8ACBE1DB94} Executing query "DECLARE @GUID UNIQUEIDENTIFIER EXECUTE msdb..sp...".: 100% complete End Progress Error: 2010-07-07 03:00:09.09 Code: 0xC002F210 Source: Back Up Database (Transaction Log) Execute SQL Task Description: Executing the query "EXECUTE master.dbo.xp_create_subdir N'\\svr1918...." failed with the following error: "xp_create_subdir() returned error 183, 'Cannot create a file when that file already exists.'". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. End Error Progress: 2010-07-07 03:00:09.39 Source: Back Up Database

    ...

    ...

    End Progress DTExec: The package execution returned DTSER_FAILURE (1). Started: 03:00:00 Finished: 03:00:12 Elapsed: 11.091 seconds. The package execution failed. The step failed.

    Thanx

    .......\ ~ ~ //

    .......(/ O O )

    --o00o-(_)-o00o---

    So far, so good, so what?

    ..-----------0ooo.--

    ....ooo0.....(...)

    ...(...)........)./

    .....(.......(_/

    ....._)

  • Do you really need the report files? I turn that feature off since I have found that the report files don't really have any useful information.

    Jeffrey Williams
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    How to post questions to get better answers faster
    Managing Transaction Logs

  • the DBMS or OS or on the SAN or Network or even Security(ADS, DNS, ...)?

    All the OS-Logs don't show much around the failure time.....thanks you verry much and god bless you......

    carbon poker review[/url]

  • Jeffrey Williams-493691 (7/7/2010)


    Do you really need the report files? I turn that feature off since I have found that the report files don't really have any useful information.

    Hi

    Well how do you analyze your JobStep failures? How would you find "returned error 183" when the error is not reproducible.

    Am I missing on any useful Logs or Logtables?

    I find the "View History" with the chopped off output lines and "... The step failed." pretty much useless, unless to make a difference between n Steps and green and red.

    The max 1024 character for this attribute might not be the best design for dynamic output sizes.

    Greetings Markus

    .......\ ~ ~ //

    .......(/ O O )

    --o00o-(_)-o00o---

    So far, so good, so what?

    ..-----------0ooo.--

    ....ooo0.....(...)

    ...(...)........)./

    .....(.......(_/

    ....._)

  • Have the same problems.

    Is there any one who knows what this depends on, except for a bug in SQL Server?

  • Found this by searching. Do not know if it helps you. But it helped me

    Check to see whether there is any anti-virus or anti-spyware tool running on the SQL Server, in particular if either tool has an 'On-Access' scanner. With some AV applications, when a file is first written or opened, the file is checked for viruses. This is what is meant by an on-scanner. SQL Backup is attempting to create the backup file and is prevented from doing so by the AV software. If you do have an Anti-virus or Anti-spyware application running, exclude the disk location where you create your backup files from the checks.

    If you are backing up to a network share, this investigation must be performed on the server hosting the file share rather than the local SQL Server computer.

    Process Explorer shows you information about which files processes have opened or loaded. Before using this tool, you may need to check the SQL Backup activity log for that particular job to retrieve the filename of the backup, if the filename was automatically generated by SQL Backup.

    · Download Process Explorer from the Microsoft site ( http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx ) and run the program.

    · Click the Find menu, and choose Find Handle or DLL...

    · Type the file name (name of the file which is locked by some process.)

    · After typing the search phrase, click the Search button

    You should see the list of applications which are accessing the file.

  • What I found out is that the file actually is written if I lokk in the folder. So what is causing the error...?

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply