Home All Groups Group Topic Archive Search About

Backup Contains .mdf .ldf and .ndf dont want .ndf

Author
19 Jan 2006 8:25 PM
Sean John
Hello,

I have a database(.mdf and .ldf) with a large table that is attached to
its own filegroup(.ndf).  I have created a full database backup and used

Restore FilelistOnly From Disk = 'C:\MSSQL\Data\Backup\Contact.bak'

I see 3 files

contact.mdf
contact.ldf
cont.ndf

I restored just the .mdf and .ldf to another database and when I look at
the properties and goto file groups it shows that the filegroup is still
there too.  How is the ndf a part of this database when I never restored
the .ndf

I wan to restore only .mdf and .ldf and leave the .ndf behind is this
possible and how.  Thanks for all HELP!





*** Sent via Developersdex http://www.developersdex.com ***

Author
19 Jan 2006 9:50 PM
Geoff N. Hiten
First, if you don't supply a "WITH MOVE" clause for the .ndf file, it will
use the original file path from where the backup was created.  Second, if
you do a full database restore, you must restore all the files.  You cannot
omit any files.  You can delete the file/filegroup after the restore is
completed.

--
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP




Show quote
"Sean John" <s*@aol.com> wrote in message
news:eoNsFaTHGHA.2064@TK2MSFTNGP09.phx.gbl...
>
> Hello,
>
> I have a database(.mdf and .ldf) with a large table that is attached to
> its own filegroup(.ndf).  I have created a full database backup and used
>
> Restore FilelistOnly From Disk = 'C:\MSSQL\Data\Backup\Contact.bak'
>
> I see 3 files
>
> contact.mdf
> contact.ldf
> cont.ndf
>
> I restored just the .mdf and .ldf to another database and when I look at
> the properties and goto file groups it shows that the filegroup is still
> there too.  How is the ndf a part of this database when I never restored
> the .ndf
>
> I wan to restore only .mdf and .ldf and leave the .ndf behind is this
> possible and how.  Thanks for all HELP!
>
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
Author
19 Jan 2006 10:15 PM
Sean John
When trying to delete file it says that
The file 'Contact'cannot be removed because it is not empty.

Is there a way to backup only .mdf or .ldf or restore just .mdf or .ldf
and no .ndf???



*** Sent via Developersdex http://www.developersdex.com ***
Author
19 Jan 2006 10:53 PM
Andrew J. Kelly
Have a look in BOL under DBCC SHRINKFILE specifically the EMPTYFILE option
and then ALTER DATABASE specifically the REMOVE FILE option.

--
Andrew J. Kelly  SQL MVP


Show quote
"Sean John" <s*@aol.com> wrote in message
news:O3$1kXUHGHA.1424@TK2MSFTNGP12.phx.gbl...
> When trying to delete file it says that
> The file 'Contact'cannot be removed because it is not empty.
>
> Is there a way to backup only .mdf or .ldf or restore just .mdf or .ldf
> and no .ndf???
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
Author
20 Jan 2006 2:43 AM
Geoff N. Hiten
You have to delete all user objects from the file.filegroup.  Then folow
Andrew's instructions.

Backups and restores always require a full database to work with.  You can
do a filegroup backup, but it must be restored to a full database.  The
short answer is no, you cannot transfer part of a database using backup and
restore.  The tools simply do not work that way.

--
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP




Show quote
"Sean John" <s*@aol.com> wrote in message
news:O3$1kXUHGHA.1424@TK2MSFTNGP12.phx.gbl...
> When trying to delete file it says that
> The file 'Contact'cannot be removed because it is not empty.
>
> Is there a way to backup only .mdf or .ldf or restore just .mdf or .ldf
> and no .ndf???
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***

AddThis Social Bookmark Button