Recovery SQL Server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David McGeorge

    Recovery SQL Server

    Coming more from Oracle background, I want to do a point in time
    recovery test on SQl Server. Let's say database PUBS backed up every
    night and Trans log backup 3 time every 6 hours between 6 a.m. and 6
    p.m. , now we want to create a database PUBS2 and recover data upto
    2:00 p.m yesterday , i.e. I think applied backup from two night before
    then apply to trans log backup ?? Is that what wehave to and how to
    apply Trans log? I am not sure. Please script and advise.
  • Dan Guzman

    #2
    Re: Recovery SQL Server

    You don't need to create the target database beforehand because RESTORE will
    create it during the restore process. The rest of your process is correct -
    restore from database backup and apply transaction log backups in order to
    the desired point in time. The scripts:

    RESTORE DATABASE PUBS2
    FROM DISK='c:\Backup s\PUBS.bak'
    WITH
    MOVE 'pubs' TO 'C:\DataFiles\p ubs.mdf',
    MOVE 'pubs_Log' TO 'C:\DataFiles\p ubs_log.ldf',
    NORECOVERY

    RESTORE LOG PUBS2
    FROM DISK='c:\Backup s\PUBS_Log_0600 .bak'
    WITH NORECOVERY

    RESTORE LOG PUBS2
    FROM DISK='c:\Backup s\PUBS_Log_1200 .bak'
    WITH NORECOVERY

    RESTORE LOG PUBS2
    FROM DISK='c:\Backup s\PUBS_Log_1800 .bak'
    WITH
    STOPAT = '20040717 14:00:00',
    RECOVERY


    --
    Hope this helps.

    Dan Guzman
    SQL Server MVP

    "David McGeorge" <soalvajavab1@y ahoo.com> wrote in message
    news:bc907f76.0 407181950.268d3 244@posting.goo gle.com...[color=blue]
    > Coming more from Oracle background, I want to do a point in time
    > recovery test on SQl Server. Let's say database PUBS backed up every
    > night and Trans log backup 3 time every 6 hours between 6 a.m. and 6
    > p.m. , now we want to create a database PUBS2 and recover data upto
    > 2:00 p.m yesterday , i.e. I think applied backup from two night before
    > then apply to trans log backup ?? Is that what wehave to and how to
    > apply Trans log? I am not sure. Please script and advise.[/color]


    Comment

    Working...