+ Reply to Thread
Results 1 to 3 of 3

Error 5123

  1. Error 5123

    I detached a database and moved it to another folder. I am trying to
    re-attach the database and am getting 'Error 5123: CREATE FILE encountered
    operating system error 32(The process cannot access the file because it is
    being used by another process.) while attempting to open or create the
    physical file...

    Is there a file configuration setting I can change to eliminate this error
    message? I've done this many times without problem and had no indication of
    any process using this database when I detached it. Any helpful suggestions
    to be able to attach this database will be appreciated. Thank you.

    Dan



  2. Re: Error 5123

    Hi,

    It can be our Backup process or Virus software accessing the file. Please
    verify.

    Thanks
    Hari
    SQL Server MVP

    "Dan Slaby" wrote in message
    news:OKxEEK$jFHA.3960@TK2MSFTNGP12.phx.gbl...
    >I detached a database and moved it to another folder. I am trying to
    >re-attach the database and am getting 'Error 5123: CREATE FILE encountered
    >operating system error 32(The process cannot access the file because it is
    >being used by another process.) while attempting to open or create the
    >physical file...
    >
    > Is there a file configuration setting I can change to eliminate this error
    > message? I've done this many times without problem and had no indication
    > of any process using this database when I detached it. Any helpful
    > suggestions to be able to attach this database will be appreciated. Thank
    > you.
    >
    > Dan
    >




  3. RE: Error 5123

    Dan,

    I am having the exact same problem. I loaded a utility from
    www.sysinternals.com that told me that it is indeed the SQL Server process
    locking the .mdf file. I, however, have been unable to correct the problem.
    I'm thinking about stopping the SQL Server, renaming the .mdf files,
    restarting the server, then attaching the DBs.

    I believe I locked the DB file accidentally before I detached by issuing a
    DBCC OpenTran(). Now I can't reattach because of the file lock.

    Leslie

    "Dan Slaby" wrote:

    > I detached a database and moved it to another folder. I am trying to
    > re-attach the database and am getting 'Error 5123: CREATE FILE encountered
    > operating system error 32(The process cannot access the file because it is
    > being used by another process.) while attempting to open or create the
    > physical file...
    >
    > Is there a file configuration setting I can change to eliminate this error
    > message? I've done this many times without problem and had no indication of
    > any process using this database when I detached it. Any helpful suggestions
    > to be able to attach this database will be appreciated. Thank you.
    >
    > Dan
    >
    >
    >


+ Reply to Thread