Can i restore database with new log file?

  • I have a backup file which i am trying to restore. The log file is 140GB from this backup file, is there a way that i DO NOT use the log file from this backup file and create a new logfile explicitly?

  • No. A restore always recreates the database as it was at the time of the backup. That includes the size of all files.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (5/30/2013)


    No. A restore always recreates the database as it was at the time of the backup. That includes the size of all files.

    Thanks. When restoring does it restore MDF first then LDF or in parallel, assuming MDF and LDF are are different drives?

  • When restoring, the first step is to create all the files at the same size as the source database for the backup had them, then copy the data from the backup into the data file(s).

    If you don't have space for all the files, the restore will fail and you'll be left with nothing.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster (5/30/2013)


    When restoring, the first step is to create all the files at the same size as the source database for the backup had them, then copy the data from the backup into the data file(s).

    If you don't have space for all the files, the restore will fail and you'll be left with nothing.

    Is the copy process done in parallel? I have my db partitioned, would it copy all the partitions including the log file at same time?

  • A restore doesn't actually put anything into the log file, it's mostly empty after the restore completes.

    Whether there's any parallel depends on how many database data files, how many files the backup was striped over and how many drives are involved, though I can't remember the exact details.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 6 posts - 1 through 5 (of 5 total)

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