What to do when you need to import a large MSSQL database dump inside a virtual machine and you have no sufficient space?

Share

It is a good idea to hold your database server inside a virtual machine and run it only if needed. This will save the memory space from being loaded with running services when you don’t need them. But what if you need to import a large database dump file and there is no sufficient space allocated for the virtual machine?
You can try these steps:

1. Increase disk space used by the virtual machine

When you have VMware server installed:

– You can add another disk from Add Hardware wizard
This will be a ‘virtual’ disk that actually occupies the space from your host OS, only that it is available for use inside the virtual machine. So, you have to have the free space on your main physical hardware.
– You have to choose Hard Disk device, and the follow the steps in order to configure it (like setting the amount of space it occupies). The hardware will appear, if successfully configured, in the Harware section inside WMware server.

add_hardware

When you have version 3 of VMware Player

– open VMware Player
– choose Open virtual machine
– browse to the virtual machine, click OK and you should see an Edit virtual machine settings link. Here you can do all kind of configurations, among which extending the virtual machine disk space.

VMware-Player_8

For older versions of VMware Player these virtual machine settings are not available.

2. Make the virtual machine ‘see’ the newly created hardware

Ok, now the next step is configure the operating system inside the virtual machine to ‘see’ this new hardware device. Open the console that runs the virtual OS. Now you have to configure the newly added device, according to the OS.
I will describe now only for Microsoft Windows:
– Go To Start->Control Panel
– Choose Administrative Tools
– Double click Computer Management and go to Storage->Disk Management
– The configuration wizard should now pop up. Follow the steps, and in the end, choose Format drive.
Don’t worry if you completed the wizard and did not choose this option, you can always browse to the newly added hardware from windows explorer, and right click on it, then choose format. If you don’t format it, this hardware will be seen as having 0 Kb and cannot be used. I will now be referring to this new disk as E:

3. Import the large database dump

We have now the free space on which to import the database dump, let’s give it a try. The idea is to unpack the database dump on this newly created space. For this, i recommend installing SQL Server Management Studio Express. You can install this graphical management tool by following this link

– Now put the database dump on this new hardware and start SQL Server Management Studio Express.
– Create a new databse
– Right click it and choose Tasks->Restore->Database
– From the Source for restore section choose From device
– Click the browse button
The Backup media is File (because we have a db dump file)
– Add a location for this file. This means browse to E: and choose the database dump file.
– Check the Restore checkbox, and go to Options

restore_database
You will see a listbox named Restore database file as holding 2 entries, one pointing to a .mdf file, and another one pointing to a .ldf file. The .mdf file will be used to hold the unpacked database, and the .ldf file is used for logging.
– You need to use the browse button here and point to your own 2 files on E:. You will find these files in the same directory as where the database backup is. They will have the database backup name
– You can now click OK for the import to start.

4.Possible occurring error:

“Access denied.” code error 5.

Solutions:

– Check permissions for the .mdf, .ldf files by right clicking on them and choosing properties
– Log in with administrator user
If these do not work:
– Go to Start->Programs->Microsoft SQL Server->Configuration Tools->SQL Server Configuration Manager
– Choose SQL Server Services from the left tree, and in the right, right click on SQL Server(SQLEXPRESS)
– Choose Properties
– Inside the Log on tab, you have a select box marked by a Built in account radio button
– Select Local system

configuration_manager
Take a look here for a summary explanation.

Finally, there’s another very important peculiarity of what does Cialis that brings it so high above its alternatives. It is the only med that is available in two versions – one intended for use on as-needed basis and one intended for daily use. As you might know, Viagra and Levitra only come in the latter of these two forms and should be consumed shortly before expected sexual activity to ensure best effect. Daily Cialis, in its turn, contains low doses of Tadalafil, which allows to build its concentration up in your system gradually over time and maintain it on acceptable levels, which, consequently, makes it possible for you to enjoy sex at any moment without having to time it.

1 thought on “What to do when you need to import a large MSSQL database dump inside a virtual machine and you have no sufficient space?”
  • Ciprian Radu says:

    I do not agree with you when you say that “It is a good idea to hold your database server inside a virtual machine and run it only if needed. This will save the memory space from being loaded with running services when you don’t need them”.

    You can always put your database on your host machine and turn it on and off whenever you want. You don’t need a virtual machine to spare computer resources. Actually the virtual machine gives you a performance decrease. The advantage of a virtual machine is that you make use of virtualization (e.g.: multiple Operating Systems, each running on a VM, share the hardware resources of the same machine).

    An advantage that I see when using DBs inside WMs is that you can manage multiple versions of the database easier. You don’t need to make dumps of the database, just make copies of the virtual machine instead. This way you can change to any version of the database by starting the appropriate Virtual Machine. No need to restore the database anymore. But there is a downfall: you need far more disk space.

    PS: Are you working with a database from REWE? If so, maybe you can “lower” the prices to some products and I promise I will be buying only from REWE from now on (just jocking).

    December 7, 2009 at 10:56 am

Comments are closed.

By continuing to use the site, you agree to the use of cookies. More information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close