473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

about restore

Now, I take over a application, one of the functionality is to restore database, but I find the original code, the original code puzzles me. To all user databases, for example, the restoring procedure of pubs database, is as follows:



1.

RESTORE DATABASE [pubs] FROM DISK = N'C:\backup\model.bak'

WITH FILE = 1, RECOVERY, REPLACE, KEEP_REPLICATION,

MOVE N'modeldev' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\pubs_Playback.mdf',

MOVE N'modellog' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\pubs_Playback.ldf'



2.

RESTORE DATABASE [pubs] FROM DISK = N'C:\backup\pubs.bak'

WITH STATS=10, FILE = 1, RECOVERY, REPLACE, KEEP_REPLICATION,

MOVE N'pubs' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\pubs.mdf',

MOVE N'pubs_log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\pubs_log.ldf'





I don’t understand what role the first SQL statement plays.

Or the original code has problem?
Sep 11 '07 #1
1 1178
rob313
16
If you are running these two statements right after one another with nothing in between, then I would say the first statement is useless. I'm not sure why you would recover a backup of the model database into the pubs database and then restore a backup of the pubs database into pubs. I notice it has the KEEP_REPLICATION setting on, but I don't see how that would alter things. Anyone else?
Sep 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: For example John Smith | last post by:
Is there any reason why SQL Server (EM) would go through all the motions of a restore and not actually do anything at all? To get into this situation I backup from a client's server and download...
0
by: xo55ox | last post by:
Hi, I have been trying to set up an automated restore process from prod to backup server. First, I schedule the full database backup nightly, transfer the backup file and restore it to the...
3
by: butatista | last post by:
Please help SQL Server 2000 Standard I am trying to restore databases on my server and am unable to get them to restore using the database option. For example, the location of my backup...
1
by: Jagdip Singh | last post by:
Hi all, I have a question about database recovery I have database backup and doing restore. After restore, Database will go to roll forward pending stage. I will go for roll forward. What if i...
9
by: GL | last post by:
I am running DB2 8.1.1 on AIX 5.1 Having a problem with a redirected restore. Once into the restore continue phase, I immediately get the following “SQL2059W A device full warning was...
11
by: Chris | last post by:
I have searched this group for answers and tried the responses. I am trying to Use an full online backup from our production server and apply it to our test server. The Tablespaces in the...
0
by: Takpol | last post by:
Hello, I have several archived filegroups that have data in them partitioned based on the date. These filegroups have been removed from database after archival. For example two months ago....
5
by: HSP | last post by:
hi. i need to restore an old database. The db was backed up using a DLT drive, using 2 volumes. The content for the tapes was copied to file onto Solaris machine using rsh and dd (for backup...
7
by: tommydkat | last post by:
Hi! I need to migrate a UDB 7.1 32-bit database on one HP-UX system to a 8.3 (FP3) 64-bit database on a new HP-UX system. I found this newsgroup post which indicates this not possible using...
0
by: zhif | last post by:
I tried to test this process on my personal laptop. Could you help me to take a look where is the problem as below? 1. I created a source database, name: db100 <-- db2 create db db100...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.