SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


BACKUP / RESTORE


BACKUP / RESTORE

Author
Message
Jamie-2229
Jamie-2229
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3134 Visits: 837
Comments posted to this topic are about the item BACKUP / RESTORE

Jamie
kevriley
kevriley
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3114 Visits: 2618
makes no difference to the answer, but the question states that the backup location is 'F:\......', but al the answers refer to a location at 'C:\......'

probably just a typo


Kev
ChiragNS
ChiragNS
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3383 Visits: 1865
nice question

"Keep Trying"
Steve Jones
Steve Jones
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: Administrators
Points: 62288 Visits: 19102
Corrected the path typo.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Eric Mamet
Eric  Mamet
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1589 Visits: 893
Sorry to be a bit late but I don't see why the first one is incorrect.

Could someone explain, please? Ermm
Jamie-2229
Jamie-2229
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3134 Visits: 837
This question was poorly written and since I first started writing them because I found poorly written questions could throw me off easily, I vowed to fix this. My resolve did not shine through on this one.

The goal here was to make note of the compression option on SQL backup. http://msdn.microsoft.com/en-us/library/bb933863.aspx

The fact is, there was a second more hidden goal here and this had to do with the LSN (Log Sequence Number). It is really simple to attach the database, but it gets more complicated if the database is not set to simple mode and there are trn files to consider for recovery purposes.

Basically the first one doesn't work because the LSN is not taken into consideration. You will get an error if you attempt to restore it in the manner suggested:

The tail of the log for the database "AdventureWorks" has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log.

To demonstrate this, backup adventureworks with compression:
BACKUP DATABASE AdventureWorks
TO DISK = 'C:\Backup\AdventureWorks.bak'
WITH COMPRESSION, INIT, STATS = 10

Run the first choice:
RESTORE DATABASE AdventureWorks
FROM DISK = N'C:\backup\AdventureWorks.bak'
WITH MOVE N'AdventureWorks' TO N'C:\Data\AdventureWorks.mdf',
MOVE N'AdventureWorks_Log' TO N'C:\LOG\AdventureWorks.ldf',
RECOVERY, STATS = 10;

Now use the second method (there is no mention of Recovery and thus no LSN required):

RESTORE DATABASE [Adventureworks]
FROM DISK = N'C:\Backup\Adventureworks.bak'
WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 10
GO

Jamie
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search