Re: Are logs any use in a no logging database? (fwd)
Posted in 1996
Topics: Backup & Restore, Transactions, Locking & Isolation, Logging & Checkpoints
Cheryl Kendricks wrote:
> Cheryl Kendricks
> Internet:cherylk@prod1.jcdc.doleta.gov OR cherylk@gwysmtp.jcdc.doleta.gov
> DTSI, Inc. Voice: 1-800-598-5008 Fax: 512-393-7296
> Database Administrator - DOL Job Corps San Marcos, Texas
> ------------------------------------------------------------------------>
> On Wed, 22 May 1996 Spetc@aol.com wrote:
>
> > We do not use logging on our database.
> >
> > 1. We perform level 0,1 archives, but we don't backup the logs, do we really
> > need to?
Logical logs are used for two purposes. Fast recovery every time the
engine is brought up from Offline mode to Quiescent, and after a restore
from an archive. If your database does not use transaction logging,
then when restoring from an archive you simply answer "no" to the
question "Do you want to restore from logical logs?" (In ontape).
The restore will bring your system back to the start time of the
archive. Any work performed after that point will be lost. The logical
logs are responsible for applying transactions that have happened since
the last archive, which will bring your system back to the actual time
when the problem happened (ie. a disk crash).
The logs are also used when OnLine goes down (power outage) but you
don't actually lose a disk. When OnLine starts back up, it will copy
any "before images" found in the physical log back to the appropriate
table on disk. At a system checkpoint, all modified pages are flushed
back out, so if you were making changes to data since the last system
checkpoint, your changes would be lost. If you work against a logged
database, your transactions would be played back, retrieving most (if
not all) of your transaction information, which means data loss would be
very minimal.
> >
> > 2. What are the logs used for in a no logging database? For example, if I
> > update every row in a table with 10 million rows with a single update
> > statement and I interrupted it half way through would the first 5 million
> > updates be rolled back? Would it use the logs for this purpose?
> >
In an un-logged database, the transaction logs do very little. They
record certain SQL DDL commands (such as create table), but that's about
it. Any SQL DML (insert, update,delete,etc) statements are not recorded
in the transaction logs.
If you are updating 10 million rows and it gets halfway through, there
is no rollback capability in a non-logged database.
Keaton Adams
Informix Software