Solved

How do i take a backup of a database with multiple filegroups

Posted on 2011-03-07
4
295 Views
Last Modified: 2012-05-11
Hei!
  i need to export a new database from en existing one. The old db consists of appros 120 tables, over 3 file groups.
I need a selection of approx 55 tables which is spread over these 3 filegroups.
how do i do it

//shanj
0
Comment
Question by:shanj
  • 2
4 Comments
 
LVL 39

Expert Comment

by:lcohan
ID: 35059683
You cab issue a FULL database backup like below:

--Add dump devices for all db's on E:\ drive
exec sp_addumpdevice @devtype = 'disk' , @logicalname = 'MyDB_bak'      ,@physicalname = 'H:\SQL_BACKUP\MyDB.bak'

--backup db
BACKUP DATABASE [MyDB] TO  [MyDB_bak] WITH COPY_ONLY, NOFORMAT, INIT,  NAME = N'MyDB-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO
0
 

Author Comment

by:shanj
ID: 35066297
Tried this approach , but when i try to restore the backup i get en error.
Logical file 'STAGE_RT_HIST' is not part of database 'STAGE_RT_HIST'. Use RESTORE FILELISTONLY to list the logical file names.

//shan
0
 
LVL 14

Accepted Solution

by:
Daniel_PL earned 500 total points
ID: 35066993
Hello.
As far as I understand you would like to extract only about half of tables from your current database.
To extract only some tables you can restore full database backup and drop unwanted tables, export data to files and then import it back to new db or use SQL Server Import and Export Wizard.

About error you are getting.
Where do you want to restore your backup - at the same server?
How do you perform restore operation?

You need to be aware of that SQL Server create files in the same locations as they are in the backup.
If you want to restore database files to other locations you need to use WITH MOVE clause and provide new files locations.

You can check logical file names in your backup by running following command:

RESTORE FILELISTONLY FROM MyDB_bak
--OR
RESTORE FILELISTONLY FROM DISK=N'<path to your backup file>'

0
 

Author Closing Comment

by:shanj
ID: 35067232
Thanks
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now