Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-03-07
4
Medium Priority
?
301 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 40

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 2000 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

722 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