Re: does this backup sequence commit all data to the database



I missed the line in the original message where the log was truncated,
and now you have supplied some new information, so let me start over.

As I understand it, you are saying:

1) The database is in FULL recovery mode.

2) During the day you BACKUP the LOG to files.

3) At night you TRUNCATE the log "to flush the log file of committed
transactions". Then you shrink the log file and backup the database.

One thing to understand is that every time you BACKUP the log the
space taken up by committed transactions is freed, at least up to the
start of the oldest open transaction. The log file size is not
changed, but space inside the log file is freed up. So there is no
special need to flush the log if the log is being backed up.

Another important issue is that shrinking the log should NOT be a
regularly scheduled event. You can read the details behind that here:
http://www.karaszi.com/sqlserver/info_dont_shrink.asp

The log file should be made large enough in the first place so that it
does not have to grow, and then it should be backed up frequently
enough that it never fills up.

So what I would suggest for your nightly process is to backup the log
one last time, then backup the database. No truncate, no shrink.

Roy Harvey
Beacon Falls, CT

On Wed, 9 Jul 2008 09:19:23 -0700 (PDT), Roger
<lesperancer@xxxxxxxxxx> wrote:

On Tue, 8 Jul 2008 15:14:51 -0700 (PDT), Roger

<lesperan...@xxxxxxxxxx> wrote:
backup log testdb with truncate_only
DBCC SHRINKFILE (testdb_log, 100) WITH NO_INFOMSGS
backup database testdb to disk = '\\DC01\Backups\DB01\testdb.bak' with
init

and does the shrinkfile command reduce the size of the ldf ?- Hide quoted text -

- Show quoted text -

the db is in 'full recovery mode', and I thought
backup log testdb with truncate_only

would flush all committed log transactions to the mdb, leaving only
open transactions in the log file

I understand that "backup log testdb to disk = '...'" will backup the
log transactions
which I'm during throughout the day

But at night, I want to flush the log file of committed transactions
to the db and then backup the db.... doesn't this do that ?
backup log testdb with truncate_only
DBCC SHRINKFILE (testdb_log, 100) WITH NO_INFOMSGS
backup database testdb to disk = '\\DC01\Backups\DB01\testdb.bak'
with
init
.



Relevant Pages

  • Re: Can anyone crash course me in SQL maintenance?
    ... Let's see if we can get an SQL expert to guide you ... ... I use redgate's SQL Backup to do a nightly backup, ... Log file size: 18g ... log as I'm not quite sure how transactions get committed to the SQL ...
    (microsoft.public.windows.server.sbs)
  • Re: Database/Logs dont shrink with Maintenance Task
    ... Only a shrink file can do that but it may require a backup to get ... Other wise it has to keep growing to make room for more transactions. ... the log file smaller--whether you shrink or not? ...
    (microsoft.public.sqlserver.setup)
  • Re: does this backup sequence commit all data to the database
    ... the data was committed when the application transactions were ...  That could be an explicit COMMIT when an explicit BEGIN ... recovery mode there is no reason to backup the log. ... I understand that "backup log testdb to disk = '...'" will backup the ...
    (comp.databases.ms-sqlserver)
  • Re: truncate transaction log
    ... The physical size of the log file will not shrink when you truncate the ... size that will hold all of the transactions in between log backups. ... time the log backup will truncate the committed transactions ...
    (microsoft.public.sqlserver.server)
  • RE: Error with SBS backup
    ... Error 800423f4 appears in the backup log file when you back up a volume by ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)