I have a copy of a backup from a user site. a .sbk file..
I have a development server at my work site and an old copy of the
database that I use for testing. I would like to overlay my old copy of
the database with the backup from the user site. What is the best way
to do this?
ThanksSee the RESTORE DATABASE topic in Books Online. To overwrite the old copy,
just specify the same name and the REPLACE options, along with all the other
requried items...
Kevin Hill
President
3NF Consulting
www.3nf-inc.com/NewsGroups.htm
"terry" <cooleyt@.woh.rr.com> wrote in message
news:phaaf.179542$lI5.158808@.tornado.ohiordc.rr.com...
>I have a copy of a backup from a user site. a .sbk file..
> I have a development server at my work site and an old copy of the
> database that I use for testing. I would like to overlay my old copy of
> the database with the backup from the user site. What is the best way to
> do this?
> Thanks
>|||here are the steps I am taking to do the restore
step 1
Restore filelistonly
from disk = c:\projects\\lams.sdk
this produces a table with
logical filename = hrattend_data physical name =
f:\sqldata\\hrattend.mdf
logical filename = hrattend_log physical name = f:\sqldata\\hrattend.ldf
step 2
restore database hrattend
from disk = c:\projects\..\lams.sdk
with
move hrattend_data to c:\program files\\hrattend.mdf,
move hrattend_log to c:\program files\..\hrattend.ldf,
replace,
stats = 10
the data is still the old data.
my question is following the restore filelistonly, why does the physical
name fields reference f:\ ? shouldn't this be in c:\ where the backup
is located?|||> the data is still the old data.
Do RESTORE HEADERONLY. You might have several backups on that file and you a
re restorring the oldest
one. Use the FILE option to specify anything else than the first (1).
> my question is following the restore filelistonly, why does the physical n
ame fields reference f:\
> ?
Where do you see this physical name field?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"terry" <cooleyt@.woh.rr.com> wrote in message news:Rbdaf.181702$lI5.74710@.tornado.ohiordc.rr
.com...
> here are the steps I am taking to do the restore
> step 1
> Restore filelistonly
> from disk = c:\projects\\lams.sdk
> this produces a table with
> logical filename = hrattend_data physical name = f:\sqldata\\hrattend
.mdf
> logical filename = hrattend_log physical name = f:\sqldata\\hrattend.ld
f
> step 2
> restore database hrattend
> from disk = c:\projects\..\lams.sdk
> with
> move hrattend_data to c:\program files\\hrattend.mdf,
> move hrattend_log to c:\program files\..\hrattend.ldf,
> replace,
> stats = 10
> the data is still the old data.
> my question is following the restore filelistonly, why does the physical n
ame fields reference f:\
> ? shouldn't this be in c:\ where the backup is located?
>
>|||Hi,
Physical name field is the actual place your MDF and LDF were stored when
you backup the source database. Based on that
you can decide whether you need a MOVE command or not. Incase if you have
same folder in destination server then you do not want to
give a MOVE command; else you have mention move command to redirect the MDF
and LDF to a new path.
The other question:- As Tibor mentioned use RESTORE HEADERONLY command to
find the latest backup file and use FILE = 'latest number'
in your RESTORE DATABASE command.
Thanks
Hari
SQL server MVP
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:e%23PXQcE4FHA.252@.TK2MSFTNGP15.phx.gbl...
> Do RESTORE HEADERONLY. You might have several backups on that file and you
> are restorring the oldest one. Use the FILE option to specify anything
> else than the first (1).
>
> Where do you see this physical name field?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "terry" <cooleyt@.woh.rr.com> wrote in message
> news:Rbdaf.181702$lI5.74710@.tornado.ohiordc.rr.com...
>|||terry wrote:
> here are the steps I am taking to do the restore
> step 1
> Restore filelistonly
> from disk = c:\projects\\lams.sdk
> this produces a table with
> logical filename = hrattend_data physical name =
> f:\sqldata\\hrattend.mdf
> logical filename = hrattend_log physical name = f:\sqldata\\hrattend.ld
f
> step 2
> restore database hrattend
> from disk = c:\projects\..\lams.sdk
> with
> move hrattend_data to c:\program files\\hrattend.mdf,
> move hrattend_log to c:\program files\..\hrattend.ldf,
> replace,
> stats = 10
> the data is still the old data.
> my question is following the restore filelistonly, why does the physical
> name fields reference f:\ ? shouldn't this be in c:\ where the backup
> is located?
>
>
The physical name in the RESTORE FILELISTONLY, refers to the original
location of the files. This is info that is stored in the backup file
and isn't related to anything on your server.
If you want to overwrite your existing database, you don't have to use
the MOVE option. Basically you just run -
RESTORE DATABASE hrattend FROM DISK = 'c:\projects\...\lams.sdk'
WITH RECOVERY, REPLACE, STATS =10
HTH
Regards
Steen|||this did not work as expected. The backup file that I am using was
created on 11/02. I previously restored the database in Jun. The new
back up file is larger than the previous one, so I am assuming that it
contains more records. Following the restore, my tables still only
contain records ending in June.
I tried to create a new database from the 11/02 backup using the Restore
function in the enterprise manager. I successfully created a new
database, but it still only contains records up to Jun. What am I missing?|||I finally figured it out. Thanks for the help...
The restore headeronly set me off in the right direction. There were
three backup sets in the backup file. They neglected to tell me that.
No comments:
Post a Comment