Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

t-log question

Status
Not open for further replies.

mkal

Programmer
Joined
Jun 24, 2003
Messages
223
Location
US
If I do the following: (all done in the same database)

backup log databasename
to disk = 'C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\filename.trn'
go
backup log databasename with truncate_only
go
dbcc shrinfile('logicalname_log', 500)
go

Is there any chance of losing any transactions between the backup of the log and the truncation of the log?

Thanks!
 
Yes. If a transaction comes in between when you start the backup log to disk, and the backup log with truncate only that transaction will not be backed up.

When you do a transaction log backup it automatically flushes all commited transactions from the log. There isn't any reason to have the backup log with truncate_only after the backup to disk.

By doing this you won't be able to restore your logs in the event of a failure.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top