SQL 6.5 database device size

  • Greetings!

    I have some 6.5 backups that I need to restore to one machine with lots of hard disk space and then I want to data transfer them to another machine where there is less disk space.

    Let's say the size of the .dat file I want to restore is 5G. If I create a 5G database device and database, the restore tells me that the database must be 30G to hold the 5G backup.

    So, I recreate the database and device to be 30G and then restore the backup.

    Now I want to data transfer this database to another machine where disk space is limited. I don't have 30G on this system to make the device so I want to know how big to make the database device to hold the transfer.

    If I look at the database information on the other machine (by editing it), it tells me that the database only has 2G of data space available, so I figure I need to create the new database device to be 28G (even though the backup file was only 5G).

    I don't believe that the 5G backup that I restored into the 30G database really took up 28G leaving me only 2G like SQL is telling me.

    I want to know how to tell how much space the database is really taking up so I will know how big to create the device on the target system where disk space is a premium.

    Do I just look at the 5G backup file and guess how big to create the device on the target machine?

    Is there some query I can run that will tell me how much space the database is really using since the edit database information doesn't seem to be correct?

    Thanks!

  • hi,

    in 6.5 backups couldn't be loaded into a database that was smaller than the original. Therefore if the database has been created/extended to a particular size then the secondary database needs to be created/extended in the same way. When we had to do this we created a new database that was bigger than the backup size (5GB in your case), generated a script to create all objects (tables, views, procedures etc) and then used BCP to copy data between the two This then acts to shrink the database.

    Paul

  • Yeah - I got my backup to restore, but I had to create the database to be 30G. That must be the database size on the machine where the backup was made and that is fine.

    The backup file itself is only 5G, so I know I don't really need 30G to hold it but I had to make the database 30G to do the restore.

    I don't have 30G on my target machine where I want to object transfer the database.

    Someone suggested that I take the size of the backup file, add 10% to it and create the database to be that size. This would be 5.5G instead of 30G.

    This seems to be working, but I was hoping to find a more scientific method of determing just how much room it is really taking up so I can document it for the next person that has to do what I am doing.

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

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