TRANSACTION WITH TRUNCATE WHILE OFFLINE?

  • Does anyone know how to sort this? I have a database which is offline. When I try to bring in back online with Enterprise Manager It won't do it saying the transaction log is full. If I try to truncate the log I run into problems because the database is offline. Is this a Chicken and egg problem? How can I get the database back online?

    TIA

  • You could try sp_detach_db then delete the transaction log (or rename) and use sp_attach_single_file_db to attach the DB itself, the only issue is this has to be a single file and log has to be single file.

    From BOL

    quote:


    When sp_attach_single_file_db attaches the database to the server, it builds a new log file and performs additional cleanup work to remove replication from the newly attached database.

    Use sp_attach_single_file_db only on databases that were previously detached from the server using an explicit sp_detach_db operation.

    Use sp_attach_single_file_db only on databases that have a single log file. Do not use this stored procedure on databases that have multiple log files.


    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • Thanks Antares. That looks like it might do the trick.

Viewing 3 posts - 1 through 2 (of 2 total)

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