• Mac1986 (2/14/2013)


    Hi,

    I have a situation where in I need to restore a .BAK file and i do not have enough disk space to restore the entire Data and log files from the .BAK file.

    Is there a way than I can just restore the data and not restore the log file. OR create a an empty log file while restoring and not considering the huge log file from the .BAK file?

    I'm using SQL Server 2008 R2 version.

    As Win said you cant do it. SQL needs to restore the database to as it was when it was backed up. So if you have a 10GB MDF and a 1000GB LDF and thats how it was when it was backed up to the BAK file, SQL has to restore it as such.

    As Win said, you could do a detach / attach single file DB, but this can be risky and not always successful, as the log is not a throw away file, so you could detach while things are going on, and when it attaches without the log chain in the log fails and causes you more problems.

    The only safe way would be to ensure you have enough disk space on the destination server to ensure you can restore as it was backed up.

    Failing that, you could look at shrinking the transaction log, but that again could be dodgy, backing up and then restoring to destination.

    Also why is the log so big? Has the DB got proper transaction log maintenance running on it?