Monday, February 20, 2012

Is backup log truncate inactive part of logs?

Also,what is steps needed for online backup?
backup database and then
backup logs
or reverse?
Thanks a lot,ZvonimirTo answer your subject line, the backup log command does nothing with the INACTIVE part of the log. It only truncates the active part, it does not shrink the logfile if that is what you are asking. A full backup does not truncate or shrink the log file so it depends on what your needs are in regards to doing a log backup before or after a full backup.

HTH|||rhigdon,

The active portion of the log can never be truncated. The active part represents transactions in progress. It is the inactive part that is truncated.

blindman|||"Active portion" may not have been the right term to use, you are right in saying Active TRANSACTIONS are transactions that have not been committed. So, not sure if we can call any PORTION of the log active, and would we call the remainder INACTIVE? Meaning the empty space of the footprint plus the transactions not checkpointed?

My definition of the active portion of the tran log in the context of this thread was the transactions that have not been checkpointed and sent to the database yet but were still in the tran log (and of course would show up in any query). Wheras (again, my definition) the inactive portion was the percentage not being used in the tran log.

Soo, not sure if active or inactive are the right terms but what I meant to relay was that if my tran log is 50mb with 20mb used, a backup or truncate log command would clear that 20mb but still leave the footprint or shell of 50mb until it was shrunk or grew more.

Thanks for pointing that out :)|||You are also right that active trans can not be truncated , forgot to add that.|||Thanks for Your answers.I believe i wasn't exact enough.
My experience with DB2 and Oracle tell me that for RDBMS common feature is "online backup",that is during backup my users can work with database.But,for recovery of database,only database online backup isn't enough,because of uncommited transactions in "active part of logs".So,for online backup I MUST do BACKUP LOG.
My qestions are:
1) How i force database to do online backup?Is this any reserved word for online backup telling "it is online backup" or SQL by "status of database" recognize online ( or offline) backup?

2) What is better:
a) BACKUP DATABASE
BACKUP LOG (with truncate,not shrink)
or
b) BACKUP LOG
BACKUP DATABASE?

Thanks a lot for Your answers,Zvonimir

No comments:

Post a Comment