Results 1 to 7 of 7

Thread: DB restore script questions

  1. #1
    Join Date
    Aug 2004
    Posts
    188

    DB restore script questions

    Hi, I was wondering if there was a script available for a database restore for the following situation.

    I'm backing up to a device called DBbackup, the device contains a full backup then a translog backup appends to this divice. So now i want to move this DBbackup device and restore it to a remote server.

    The problem i'm having is how would I restore a Database from to a point in time from this DBbackup.bak file? Any help would be great or any ideas too.

    thanks.

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    You can use following to restore from file:

    restore database db_name from disk = 'path\DBbackup.bak' with ...

    restore log db_name from disk = 'path\DBbackup.bak' with file = ...

  3. #3
    Join Date
    Aug 2004
    Posts
    188
    Thanks.. Is there a way that i can create a sp that will automatically restore say the full backup and 6 log backups from one device?

  4. #4
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    You could use the logic behind this article.

    http://www.databasejournal.com/featu...le.php/3389831

    You name/id ezecastle reminds me of something.

    I know the company EZECastle do a replstore copy of their backup device which includes both full backup and log backups. They usually provide 5 different device, one for each day in a week.

  5. #5
    Join Date
    Aug 2004
    Posts
    188
    thanks. I'm trying to figure out how to restore a database on a different server from a backup device called backup.bak this file has a full backup say at 4am and then trans logs appended to it every hour. Now when i move this file to the new server and go to restore it with EM i can restore the full backup then have to select one file at a time for the transaction logs. I want to try and come up wiht a way to automate that process of doing a point intime restore from this one device. Is this possible without haveing a maintenance plan have separate files?

    Yes i know EzE CastleSoftware very well

  6. #6
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    do the following.... you will get an idea

    restore filelistonly from disk ='l:\Thurs.BAK'
    restore headeronly from disk ='l:\Thurs.BAK' -- Look for the columns position and backup type
    restore labelonly from disk ='l:\Thurs.BAK'

  7. #7
    Join Date
    Aug 2004
    Posts
    188
    Thank you. I will give it a shot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •