![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all- I have a DB that I'm backing up nightly, and I need to restore it into a "holding" DB so I can run DTS on it. I know I can do a basic restore in t-sql, but can I use the "move" attribute to restore as another DB? Would this work: BACKUP DATABASE dbLive TO dbLiveDaily WITH init <- backs up DB and overwrites the existing backup BACKUP LOG dbLive TO dbLiveLogDaily WITH init <- backs up logs and overwrites the existing backup RESTORE DATABASE dbLive FROM dbLiveDaily, MOVE 'dbLive' TO 'e:\dbLiveHolding\data\dbLiveHolding.mdf', MOVE 'dbLiveLog' TO 'e:\dbLiveHolding\log\dbLiveLog.ldf' Thanks in advance!! Best Regards, Joe |
#3
| |||
| |||
|
|
Hi, Using the Move option you can restore the database backup with a different name in the same SQL Server. Say you are backing up the database dbLive , now you need to restore the backup to a new database named "DBOFFLINE" Issue the below command with NORECOVERY, so as you can restore the transaction log backup as well) Your command had some syntax issues, so use the below 1. RESTORE DATABASE dboffline FROM dbLiveDaily WITH MOVE 'dbLive' TO 'e:\dbLiveHolding\data\dbLiveHolding_offline.mdf', MOVE 'dbLiveLog' TO 'e:\dbLiveHolding\log\dbLiveLog_offline.ldf' , NORECOVERY 2. RESTORE Log dboffline FROM dbLiveLogDaily WITH RECOVERY Note: It is not required to put INIT in the below command as you specified. BACKUP LOG dbLive TO dbLiveLogDaily WITH init Thanks Hari MCDBA "Joe" <anon (AT) ymous (DOT) com> wrote in message news:OqNJHCENEHA.3096 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Hi all- I have a DB that I'm backing up nightly, and I need to restore it into a "holding" DB so I can run DTS on it. I know I can do a basic restore in t-sql, but can I use the "move" attribute to restore as another DB? Would this work: BACKUP DATABASE dbLive TO dbLiveDaily WITH init <- backs up DB and overwrites the existing backup BACKUP LOG dbLive TO dbLiveLogDaily WITH init <- backs up logs and overwrites the existing backup RESTORE DATABASE dbLive FROM dbLiveDaily, MOVE 'dbLive' TO 'e:\dbLiveHolding\data\dbLiveHolding.mdf', MOVE 'dbLiveLog' TO 'e:\dbLiveHolding\log\dbLiveLog.ldf' Thanks in advance!! Best Regards, Joe |
![]() |
| Thread Tools | |
| Display Modes | |
| |