Re: Database backup script

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Gregory A. Larsen (greg.larsen_at_netzero.com)
Date: 06/29/04


Date: Tue, 29 Jun 2004 09:36:38 -0700

Are you sure that your script gets all the way through the differential
restore? If for some reason the differential restore didn't happen or
failed, then you database would be in "loading" status.

-- 
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"David Thayer" <dthayer@deltanet.net> wrote in message
news:227bb01c45df3$a0fe1a20$a601280a@phx.gbl...
> In SQL 7, we backup and restore an OLTP database to
> another server to off-load some processing and to have a
> static copy of the database at a point in time.
>
> Here's the procedure:
> --restore from full backup
> RESTORE DATABASE <database name> from
>
> DISK =
> N'\\<server>\<share>\<folder>\<subfolder>\file_1.bak',
> DISK = N'<server>\<share>\<folder>\<subfolder>\file_2.bak',
> DISK = N'<server>\<share>\<folder>\<subfolder>\file_3.bak',
> DISK = N'<server>\<share>\<folder>\<subfolder>\file_4.bak'
> WITH MOVE '<file name 1>' to 'location\file1.mdf',
> MOVE '<file name 2' to 'location\file2.mdf',
> MOVE '<log file name 1>' to 'location\LOGfile1.ldf',
> MOVE '<log file name 2>' to 'location\LOGfile2.ldf',
> NORECOVERY, REPLACE
> --restore differential backup
> RESTORE DATABASE <database name> FROM DISK
> = '<server>\<share>\<folder>\<subfolder>\filename.BAK'
> with recovery
>
>
> Periodically, this script completes, but leaves the
> restored database in 'loading' status.  I know how to
> correct this, by using 'RESTORE DATABASE with RECOVERY',
> but I'm wondering why this happens sometimes and not
> others. Any suggestions?


Relevant Pages

  • RE: How do I restore from mdf and ldf files?
    ... Tasks -> Backup Database ... Tasks -> Restore Database ... Windows 2003 Server with Latest Service Pack ... Pre-requisites for Sharepoint Backup and Restore: ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Restoring SQL Server Backups
    ... ORIGINAL BACKUP & RESTORE (MSDE Database) ... occurrenceof cachestore flush for the 'Object Plans' cachestore (part ...
    (microsoft.public.sqlserver.server)
  • Re: Restoring SQL Server Backups
    ... ORIGINAL BACKUP & RESTORE (MSDE Database) ... occurrenceof cachestore flush for the 'Object Plans' cachestore (part ...
    (microsoft.public.sqlserver.server)
  • Re: RMAN backup strategy on 10g r2 on linux
    ... "Oracle Database 10g Linux Administration" book in order to understand ... how to efficiently backup and restore our instance of the db. ... I wrote a shell script that is called by cron every night. ...
    (comp.databases.oracle.server)
  • Re: POINT IN TIME RESTORE
    ... This is what you should have done in order to do the restore as you wish: ... > 3- erase data ... > 5- restore database with norecovery ... The BACKUP DATABAE can of course be at an earlier point in time, ...
    (microsoft.public.sqlserver.server)