Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Can't attach the database after delete log file

Author  Topic 

smong
Starting Member

1 Post

Posted - 2005-02-03 : 03:53:13
hi, i am new to SQL server and encounter this problem.
my log file has grown to very large size and i followed the recommendation in this forum to detach the database, delete the log file and attach back. but the system keep assoaciating the attach with the old log file and does not allow to create new log.

i try sp_attach_db and sp_attach_single_file_db but still always prompt error that the log file is incorrect.

now i can't get my database back online, any help will be appreciate.

scullee
Posting Yak Master

103 Posts

Posted - 2005-02-03 : 03:58:40
Ouch, i think you are in a bit of trouble. Detaching the database and deleting the log isnt a good thing to do.

You should have truncated the log and shrunk the db.
Go to Top of Page

franco
Constraint Violating Yak Guru

255 Posts

Posted - 2005-02-03 : 08:34:07
Please verify that your database is not a replicated db, because for a replicated database to be detached, it must be unpublished.

Also verify that you are member of the sysadmin or dbcreator fixed server roles in order to execute sp_attach_single_file_db.

Use sp_attach_single_file_db only on databases that have a single log file.

In case you have multiple log files you need to use sp_attach_db and not sp_attach_sinle_file_db.

Please refer to this MS article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;271223
and refer to BOL for a correct sintax of sp_attach_db with multiple files.
Kind regards.

Franco
Go to Top of Page
   

- Advertisement -