Detatch and reattach Db

  • Hi,

    Typical problem, running out of disk space and transaction log size through the roof !!

    I have attemted to detach the database, rename the transaction log file and reattach using sp_attach_single_file_db, but it fails complaining about the transaction log being invalid. I was under the impression that it creates a new transaction log when you go through this process.

    The database size is around 4GB and there is just under 1GB left on the server, the transaction log i renamed comes in at around 38GB, which was was going to be deleted after the reattach was done, but it seems it wont reattach without it.

    Is there any way at all I can get around this?

    Thanks in advance

    Rob

  • It should work as long as there is only one transaction log file. If you have multiple, I've got an article posted that has a workaround.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • Thanks for that Andy,

    That'll be it then. There is two logs set up for the database im working on. Could you direct me to your article please.

    Regards

    Rob

  • No worries Andy,

    I just noticed the "All Articles" link beyond the link on your previous post.

    Thanks !!

    Rob

Viewing 4 posts - 1 through 4 (of 4 total)

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