One simple question. I have a DB with MDF+NDFs files and I want to restore/c
reate
its backup to a DB with only one MDF file.
How?
Thanks,
PS: My INET does not allow me any domains but MS. So, if your solution point
s to
links outside MS, please copy the content in the message.A restored database is exactly like the original. The number and size of
the files will be the same after the restore.
You can consolidate the data files after the restore by executing DBCC
SHRINKFILE ... EMPTYFILE on the 'ndf' file. This will migrate data pages
from the secondary data file to the primary data file. You can remove the
secondary file afterward with ALTER DATABASE REMOVE FILE.
Hope this helps.
Dan Guzman
SQL Server MVP
"Ian Hughes" <anonymous@.discussions.microsoft.com> wrote in message
news:27B711FB-6AF6-4D26-9333-9C68CACF41D6@.microsoft.com...
quote:
> Hi,
> One simple question. I have a DB with MDF+NDFs files and I want to
restore/create
quote:
> its backup to a DB with only one MDF file.
> How?
> Thanks,
> PS: My INET does not allow me any domains but MS. So, if your solution
points to
quote:|||Dan's answer assumes he's got multiple files in the same filegroup. if he's
> links outside MS, please copy the content in the message.
got multiple filegroups and objects in those filegroups then i think the onl
y
option is to go into each object and move it to the primary filegroup. once
the secondary filegroup is emptied, then the file(s) for that filegroup can
be
deleted.
Dan Guzman wrote:
[QUOTE]
> A restored database is exactly like the original. The number and size of
> the files will be the same after the restore.
> You can consolidate the data files after the restore by executing DBCC
> SHRINKFILE ... EMPTYFILE on the 'ndf' file. This will migrate data pages
> from the secondary data file to the primary data file. You can remove the
> secondary file afterward with ALTER DATABASE REMOVE FILE.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Ian Hughes" <anonymous@.discussions.microsoft.com> wrote in message
> news:27B711FB-6AF6-4D26-9333-9C68CACF41D6@.microsoft.com...
> restore/create
> points to
No comments:
Post a Comment