"Jesper Sommer" wrote
> En transaktions log er en fil der indeholder alle de rettelser der er
> foretaget i din database, siden et bestemt tidspunkt.
Så langt så godt
> Det er altså bevidst designet sådan, at "nye ting" hober sig op i
> transaktions loggen, indtil man syntes man vil "comitte" dem til sin
> database.
Nej det har du misforstået (ellers har jeg
Hvis man kører med full recovery model så indeholder transaction loggen alle
ændringer i datagrundlaget siden sidste fulde backup
Full recovery model indebærer at man ligeledes tager en løbende backup af
transaction loggen
Har man brug for at genindlæse en backup, fx pga diskcrash etc
Så tager man først en backup af den aktive transactionlog
Så indlæser man først den fulde backup fx fra om natten + evt differential
backups
Derefter indlæser man backups af transactionsloggen indtil seneste backup
hvorved man faktisk udfører opdateringer løbende mod databasen
Til sidst den sidste backup af transaction loggen
Fra BOL (Books OnLine):
<quote>
Recovering in the Event of Media Failure
You can restore a database to the state it was in at the point of failure if
the current transaction log file for the database is available and
undamaged. To restore the database to the point of failure:
Back up the currently active transaction log. For more information, see
Transaction Log Backups.
Restore the most recent database backup without recovering the database.
If differential backups exist, restore the most recent one.
Restore each transaction log backup created since the database or
differential backup in the same sequence in which they were created without
recovering the database.
Apply the most recent log backup (created in Step 1), and recover the
database.
Important To protect against loss of transactions under the Full Recovery
model, the transaction log must be protected against damage. It is strongly
recommended that fault-tolerant disk storage be used for the transaction
log.
</quote>
Mht manuel trunkering af loggen:
<quote>
Although the transaction log may be truncated manually, it is strongly
recommended that you do not do this, as it breaks the log backup chain.
Until a full database backup is created, the database is not protected from
media failure. Use manual log truncation only in very special circumstances,
and create a full database backup as soon as practical.
</quote>
Dvs man er imho bedre tjent med at køre med "Simple Recovery Model"
NB arbejder man med Simple Recovery Model så mister man alle data siden
sidste backup fx i tilfælde af et diskcrash og databasen er væk
- Peter