Friday, March 9, 2012

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.
DanHi,
It can be our Backup process or Virus software accessing the file. Please
verify.
Thanks
Hari
SQL Server MVP
"Dan Slaby" <dls@.newsgroup.nospam> 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
>|||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(<DBName> ). 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 i
s
> 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 o
f
> any process using this database when I detached it. Any helpful suggestion
s
> to be able to attach this database will be appreciated. Thank you.
> Dan
>
>

No comments:

Post a Comment