Restoring a log file backup with an attached DB

  • Hi All,

    Please assist i presently perform a weekly task where i detach my live db copy it to the standby server and then reattach it again on both ends,the reason for this is that the db is 480G and i cannot back it up using SQL backups.I want to implement log shipping,but how i do this is im not restoring the db from a backup file but rather just attaching it.

    Anybody Please.

  • You can't do log shipping if you are attaching databases.

    How big is your log file?

    If you aren't doing backups (FULL and Log), then your database must be growing huge from the log file not being truncated/shrunk.

    If you aren't going to backup the database, switch your recovery mode to SIMPLE. Truncate the log (BACKUP LOG dbname WITH TRUNCATE_ONLY). Then shrink the log file (DBCC SHRINKFILE ()). That should reduce the database size.

    If you can backup the database once, do so, restore it to the standby server using WITH NORECOVERY. Then just backup the log files and keep restoring them to the standby server using WITH NORECOVERY.

    -SQLBill

  • Do you overwrite the database on the standby when you do your weekly copy? What happens if you lose the disk on your primary in the middle of the copy and you have no backups? (Hint: UPDATE RESUME SET enddate=getdate(), current=0 WHERE CURRENT = 1)

    Look into some of the third party backup tools (e.g. SQL LiteSpeed). They can significantly reduce the storage and time requirements for doing your backups, and they will allow you to restore with NORECOVERY or STANDBY for your log shipping. In any event, I assume that your 480G of data is important to your organization; do whatever you have to to get proper backups.

  • Yes i do overwrite the db on the standby server.the live db,is copied to two servers,one is the SAN backup server and then thereafter the other is copied to the standby server.

    Will look at 3rd party tool.

    ps what does (Hint: UPDATE RESUME SET enddate=getdate(), current=0 WHERE CURRENT = 1) do ?

  • It's a joke......tells you that if this happens: What happens if you lose the disk on your primary in the middle of the copy and you have no backups?

    You need to have your resume updated...you might need it.

    -SQLBill

  • My wife doesn't get my sense of humor either.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply