Re: does this backup sequence commit all data to the database
- From: Roger <lesperancer@xxxxxxxxxx>
- Date: Wed, 9 Jul 2008 09:19:23 -0700 (PDT)
On Jul 8, 5:06 pm, "Roy Harvey (SQL Server MVP)" <roy_har...@xxxxxxxx>
wrote:
does this backup sequence commit all data to the database
No, the data was committed when the application transactions were
committed. That could be an explicit COMMIT when an explicit BEGIN
TRAN was used, or an implicit COMMIT when each insert, update and
delete was executed outside an explicit transaction.
and does the shrinkfile command reduce the size of the ldf ?
Possibly, but I would not count on it. The BACKUP command was
directed at the database, not the log. If the database is in SIMPLE
recovery mode there is no reason to backup the log. In that case the
SHRINKFILE against the log file might reduce the size unless there is
a really big uncommitted transaction open. If the database is in FULL
or BULK LOGGED recovery mode the log will keep growing until backed
up (or truncated). In that case the chance of the log file shrinking
is smaller since all log data since the last backup will be preserved,
which is to say the data in the log represents the minimum size to
which it can be shrunk.
I strongly suggest you review the documentation on recovery models and
log management.
Roy Harvey
Beacon Falls, CT
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
.
- Follow-Ups:
- Re: does this backup sequence commit all data to the database
- From: Roy Harvey (SQL Server MVP)
- Re: does this backup sequence commit all data to the database
- References:
- does this backup sequence commit all data to the database
- From: Roger
- Re: does this backup sequence commit all data to the database
- From: Roy Harvey (SQL Server MVP)
- does this backup sequence commit all data to the database
- Prev by Date: Re: SQL problem - a variation on outer join
- Next by Date: Re: does this backup sequence commit all data to the database
- Previous by thread: Re: does this backup sequence commit all data to the database
- Next by thread: Re: does this backup sequence commit all data to the database
- Index(es):
Relevant Pages
|