Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 filelistonly

Author  Topic 

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2007-08-13 : 10:47:42
1-anyone know why there are 4 files in this bak file?
2-how do you create it?
3-how do you restore it?
thx



restore filelistonly
from disk = 'r:\backup\IPGDB_BackupDevice.bak'



PRIMARY D:\Program Files\Microsoft SQL Server\MSSQL\Data\klxprodplan\klxprodplan.mdf D PRIMARY 52428800 35184372080640
KLX_BASE_DAT D:\Program Files\Microsoft SQL Server\MSSQL\Data\klxprodplan\klxprodplan_1.mdf D KLX_BASE_DAT 1727725568 35184372080640
KLX_DERIVED_DAT D:\Program Files\Microsoft SQL Server\MSSQL\Data\klxprodplan\klxprodplan_2.mdf D KLX_DERIVED_DAT 71122944000 35184372080640
LOG L:\Program Files\Microsoft SQL Server\MSSQL\Logs\klxprodplan\klxprodplan_log.ldf L NULL 1645871104 35184372080640


=============================
http://www.sqlserverstudy.com

ashley.sql
Constraint Violating Yak Guru

299 Posts

Posted - 2007-08-13 : 10:49:33
check this out

http://www.dbarecovery.com/createbkupdev.html

and other articles. It will tell you everything you need to know.

Ashley Rhodes
Go to Top of Page

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2007-08-13 : 11:04:07
thanks but it didnt help.

i don't wanna use GUI. I wanna do it using sql commands.

=============================
http://www.sqlserverstudy.com
Go to Top of Page

ashley.sql
Constraint Violating Yak Guru

299 Posts

Posted - 2007-08-13 : 11:27:55
They also have T-sql steps for everything
Look at the top of everypage. The last URL in blue is T-SQl Steps
right after GUI steps

Ashley Rhodes
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-08-13 : 12:18:08
You just use the FILE option in the WITH option of the RESTORE command. For example, FILE = 1.

You get these multiples files by not specifying WITH INIT in the BACKUP command and using the same file.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2007-08-13 : 13:18:14
tkizer
with init is specified.

BACKUP DATABASE [klxprodplan] TO [klxprodplan_BackupDevice] WITH INIT , NOUNLOAD , NAME = 'klxprodplan backup', NOSKIP , STATS = 10, NOFORMAT

=============================
http://www.sqlserverstudy.com
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-08-13 : 13:31:10
I just realized what you've posted is showing the data files of the one backup file. These are not multiple backup files. You've just got multiple data files in this particular database.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

funketekun
Constraint Violating Yak Guru

491 Posts

Posted - 2007-08-13 : 13:35:19
how do i create multiple files on a backup and how do i restore it.?

=============================
http://www.sqlserverstudy.com
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-08-13 : 13:41:38
You are missing my point. There is nothing different with the backup nor with the restore since these are the data files.

Double click on your database and check out how many data files you have specified.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-08-13 : 15:17:49
When you restore from that backup, sql will generate multiple files for target db.
Go to Top of Page
   

- Advertisement -