Re: Error 5123 Cannot Attach DB

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi,

Can you stop MSSQL Server service and copy both files into a new folder.
Then rename the copied files to a different name
and try to attach the database.

Also verify the file names and directory you mention is correct.

Thanks
Hari
SQL Server MVP

"Leslie" <Leslie@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A9250A47-F159-4DD0-B7B3-B3AE24638468@xxxxxxxxxxxxxxxx
> Hari,
>
> I cannot copy the files as I get the same lock error. I have determined
> it
> is indeed SQL Server which is locking the files. I have rebooted the SQL
> Server as well, and that does not clear the file locks. I'm afraid the
> DBCC
> OpenTran (oldoaiapp) is what caused the lock.
>
> I tried the Query Analyzer command below and am getting the error below
> (the
> filename path IS correct):
>
> EXEC sp_attach_db @dbname = 'OldOAIApp',
>
> @filename1 = N'C:\SQLData\MSSQL\Data\POAIAPP.mdf',
> @filename2 = N'C:\SQLData\MSSQL\Data\POAIAPP_log.ldf'
>
> Error:
> Server: Msg 5105, Level 16, State 4, Line 1
> Device activation error. The physical file name
> 'C:\SQLData\MSSQL\Data\POAIAPP.mdf' may be incorrect.
>
> "Hari Prasad" wrote:
>
>> Hi,
>>
>> Probably your MDF or LDF file will be used by either Backup process or
>> Anti
>> virus software. Verify both first and attach again.
>> If you still have issues then try to copy the files to a new folder and
>> use
>> SP_ATTACH_DB to attach the database.
>>
>> Incase if you still have issues then restart sql server service.
>>
>> Thanks
>> Hari
>> SQL Server MVP
>


.



Relevant Pages

  • Re: Error 7619 - Cannot enable FTS on any database
    ... logged on as Admin or as a member of the Admin Group on the server where SQL ... re-try deleting the \MSSearch folder again and ... Then using your SQL Server 2000 installation CD re-install via "Custom ... Installation" the Full-Text Search component. ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Error 7619 - Cannot enable FTS on any database
    ... The server threw an exception. ... I've checked the permissions on the folder and all is fine, ... even after a reboot with SQL Server and SQL Agent stopped (and the MS Search ... >> changing the account that either the Microsoft Search service or SQL ...
    (microsoft.public.sqlserver.fulltext)
  • RE: SBS 2003 Unable to connect to database STS_Config
    ... Uninstall the SQL server from the SBS 2k3 server from add/remove programs ... Uninstall Microsoft SQL Server Desktop Engine (SHAREPOINT) ... If AV software install any extra IIS virtual directory, ...
    (microsoft.public.windows.server.sbs)
  • Re: Memory issues with 64-bit SQL Server 2005 on 64-bit Win 2003 C
    ... I also checked the individual patch levels for the .NET drivers, SQL Server ... The SQL Server is fully patched, however Windows Update reported that the OS ... Lock pages in memory -- I guess you might have taken care of it as well. ...
    (microsoft.public.sqlserver.clustering)
  • Re: Configure web synchronization wizard
    ... Looking for a SQL Server replication book? ... database i have and it gives me a folder name(C:\Program Files\Microsoft ... until you get to the snapshot folder dialog. ...
    (microsoft.public.sqlserver.replication)