Restoring Backup -Size Issue

  • I have a backup file,which is 30 gb in size . When I restore, it creates 5 db's each of 20gb. So total of 100 gb space is required on my harddrive. But available space on my harddrive is only 80 gb.

    4 db's are restored and 5th one fails.

    Wondering if I can shrink the db size or anyway handle this situation.

    I guess this is because of the default db size or autogrowth option.

    Can anyone help me on this with steps.

  • When you restore a database from a backup set, the size of the data files and transaction log files will be identical to that of the database at the time the backup was taken. Depending on your needs, you could try using SQL Virtual Restore[/url], which allows you to restore a database that's smaller than what a normal restore would require.

    SQL BAK Explorer - read SQL Server backup file details without SQL Server.
    Supports backup files created with SQL Server 2005 up to SQL Server 2017.

  • As Ray Mond stated, to restore a db, you'll need free space at least equal to the size of the database files at backup time.

    If your bak file contains backups of a number of databases, you can restore them individually.

    Since in this case you are short on space, alternatives are:

    - restore the db to another drive letter

    e.g.

    RESTORE DATABASE yourdb

    FROM DISK = 'x:\MSSQL\BACKUP\yourdbFull.BAK'

    WITH MOVE 'yourdb_Data' TO 'E:\Mssql\Data\yourdb_DATA.mdf',

    MOVE 'yourdb_Data_2' TO 'F:\Mssql\Data\yourdb_DATA_2_Data.ndf' ,

    MOVE 'yourdb_Log' TO 'G:\Mssql\Data\yourdb_log.LDF' ,

    (no)RECOVERY

    - shrink a restored db to free up space for the next restore.

    It all depends on the goal of your restores !

    If you shrink a db, or some db-files, the data will not be well organized and will need index rebuilds ! which will cause your db file(s) to grow again !

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

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

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