Restore database without trans log

  • The trans log was deleted for our database in SQL 2005 due to size (she thought it would re-create the .ldf like MS Access recreates the creates an .ldb file).  The database was fine until that point.  Is there any way to get that database up and running without restoring from backup?  The last back up was two weeks ago and we don't want to have to re-enter all that data.  Any ideas?

  • It is gracefully file closed...

    Try CREATE DATABASE with ATTACH_REBUILD_LOG option ...

    See BOL for syntax..

    http://msdn2.microsoft.com/en-us/library/ms176061.aspx

     

    MohammedU
    Microsoft SQL Server MVP

  • Assuming that the database is offline, you could try sp_attach_single_file_db


    Regards,

    Carlos

  • we have another way to rebuit a new log file

    you just detach the database and attached with new log file option through enterprise manager attached and deattached utility option .

    it will automatically built ur new log file and u dont need to resotre ur dtabase again .

     

     

    Syed Muhammad Naveed

    Database Administrator

    Karachi Pakistan

     

  • oh, this post help me a lot

    i was going to make a post asking how to resotre a database with a new log file and deleteing the big old one

    thanks a lot


    If something's hard to do, then it's not worth doing.

  • What concerns me most about this thread is that there appears to be a lack of understanding about maintaining a SQL Server and its files.

    With the right backup strategy and database settings, transaction log file size can be kept to a minimum - one that is relevant for the volume of data being read/inserted/updated.

    Add to this some capacity planning and you reduce the risk of getting into these situations.

    Not to mention that having a two week gap between backups is a dangerous way to live. Even for development databases where the data is not considered critical, there should be some strategy in place to allow the mimicking of the production environment and the protection of the data.

    Having fallen into this trap and seen the trouble and pain it can cause, I strongly recommend that those of you who have experienced this problem take some time to look in BOL at backup strategies to reduce the likelihood of this happening again.


    Regards,

    Steve

    Life without beer is no life at all

    All beer is good, some beers are just better than others

  • I strongly agree with Steve, As a DBA our primary goal is to save data. Depending on your business requirement you should have different recovery model.

    Please make a point :

    1) Backing upthe database with right back plan.

    2) Checking the datafilw and log file growth and adminstrating it.

    3) Develop a DRP in case of disaster.

     

     

    Minaz Amin 

     

    "More Green More Oxygen !! Plant a tree today"

  • It's seems really common from the posts I read. Check out this ongoing thread with links to posts of people that need to restore but don't have backups.  A lot of people seem to assume that SQL Server takes care of this for them.

    It's dead, Jim

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=67782

     

     

Viewing 8 posts - 1 through 7 (of 7 total)

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