Anda di halaman 1dari 8

When the database is first created, there are three log files, log files,

known mainly as part of the creation process is allocated.In Linux and


Unix platforms, a total of 1,000 of these log files 4KB page size; the
Windows platform, these log files, total 250 pages of size 4KB.However,
the main log files used the number, with each able to accommodate the
amount of data, are the database configuration file parameters control
logprimary and logfilsiz.All the major log file created by the use of the log
for the database selection strategy decisions.There are two different
strategies can be used, one is circular logging, a file owned by a build
log.However, activity logs, known as an infinite mixture of approach might
work best.

Circular log buffer requested the records stored in log order to cycle the
main log file is written.Once the main log file is filled, and is still marked
as "unavailable", DB2 database manager will allocate secondary log files,
and will record write them.Allowed the total number of secondary log files
logsecond by the database configuration file parameters control.

Owned building in the log file, and circular logging is similar to store log
records in the log buffer is written to the main pre-assigned log
file.However, the difference is that with circular logging, the log files will
never be reused.Every time the main log file is filled, when the log file will
be another major distribution, so the log file to use the main number
(specified by the database configuration parameter logprimary) will always
be obtained.As long as there is disk space, this process will continue.

Unlimited activity log.You might consider a simple configuration database,


allowed to use a large number of requirements for the major and / or
secondary log files to avoid the log space is all used up.However, be
allowed to log files (primary and secondary combined) is the maximum
number of 256, and if the size of your log file is relatively small, then the
quantitative work when the transaction is a transaction running large or
toolong time, you may still be used up quickly all the log space.Moreover,
since the distribution of the log file each time was forced to affect
performance, you'll want to allocate as much as possible to avoid a large
number of secondary log files.Ideally, you want to allocate enough
primary log files to meet most situations, and use services just to meet
peak workload the number of secondary log files.If you're concerned
about running out of log space, and you want to avoid allocating a large
number of secondary log files, you can configure the database to perform
an activity log is called the Infinite or Unlimited log strategy.Activity Log
allows an unlimited across all major logging and construction of one or
more files owned by the active transaction log, and effectively allow the
transaction to use an unlimited number of log files.In order to be able to
use unlimited activity log, you simply set the database configuration
parameters and logsecond userexit yes and -1, respectively.Note the
following point is very important that when the database configuration
parameter is set to yes when userexit, when the log file is closed when a
user's userexit program is called, and this program will not logFiles can be
stored permanently moved to another location (and therefore, the server
log storage space is running out of the danger will be eliminated).

Logsecond when the server configuration parameter is set to -1, the


configuration parameters and logfilsiz logprimary still in the active DB2 log
is used to specify the path to keep the number of primary log files, and
how each file should have.If DB2 needs to read from a log file the log, but
the file is not active log path, DB2 will call userexit program to retrieve
files from the archive log file, and copy it to the event log area, so that
other documents for the samewill accelerate the speed of reading.

Web Slike Karte Prevoditelj Blogovi Stvarno vrijeme Gmail više ▼

Top of Form
Sa jezika:
engleski

Na jezik:
hrvatski

Prevedi

Bottom of Form
Prijevod (engleski > hrvatski)

Kada se baza podataka prvi je stvoren, postoje tri log datoteke, log
datoteke, poznat uglavnom kao dio procesa stvaranja je allocated.In Linux i
Unix platformi, ukupno 1.000 ovih log datotekama 4KB veličina stranice,
Windows platformi, te log datoteke, ukupno 250 stranica veličine
4KB.However, glavni log datoteke se koriste broja, sa svakim moći smjestiti
količinu podataka, su baze podataka konfiguracijsku datoteku parametara
kontrole logprimary i logfilsiz.All glavni log datoteku napravljenu uz
korištenje zapisnika za strategiju baze izbor decisions.There su dvije
različite strategije mogu se koristiti, jedna je kružna prijavom, datoteka u
vlasništvu graditi log.However, aktivnosti trupaca, poznat kao beskonačni
mješavina pristup možda neće raditi najbolje.

Kružni log buffer zatražio slogovi spremljeni u dnevnik kako bi se ciklus


glavni log datoteka written.Once glavni log datoteka je ispunjen, a još uvijek
je označen kao "nedostupan", DB2 upravitelja baze podataka će izdvojiti
srednju log datoteka, te će snimiti ih pisati . Dopušteni ukupni broj
sekundarnih log datoteke logsecond koje datoteke baze podataka
konfiguracijski parametri kontrole.

Vlasništvu zgrade u log datoteku, i kružnom prijavite se sličan pohranjuje


zapise u log buffer je napisan na glavnom pre-dodijeliti log file.However,
razlika je u tome s kružnim prijavom, log datoteke nikad neće biti
reused.Every vrijeme glavni log datoteka je ispunjen, kada log datoteka će
biti još jedan veliki distribuciju, pa log datoteku koristiti glavni broj (odredi
parametar konfiguracije baze podataka logprimary) uvijek će biti
obtained.As dugo dok postoji prostor na disku, ovo proces će se nastaviti.

Neograničeno aktivnost log.You razmislite jednostavan oblik baze


podataka, dopušteno koristiti veliki broj zahtjeva za glavne i / ili sekundarnih
log datoteke kako bi se izbjeglo log prostor je sve koristi up.However, biti
dozvoljeno da log datoteke (primarni i sekundarni u kombinaciji) je
maksimalni broj od 256, a ako veličina log datoteka je relativno mala, a
zatim kvantitativno raditi kad je transakcija transakcija pokrenut veliki ili
toolong vremena, još uvijek može biti upotrijebljen do brzo sve log
space.Moreover , budući da distribucija log datoteku svaki put kad je bio
prisiljen utjecati na performanse, da ćete želite dodijeliti koliko je god
moguće kako bi izbjegli veliki broj sekundarnih log files.Ideally, želite
dodijeliti dovoljno primarne log datoteke u susret većini situacija , i koristiti
usluge samo u susret vrh opterećenje broj sekundarnih log files.If ste
zabrinuti za trčanje vanjska strana od log prostor, a želite izbjeći rasporedu
veliki broj sekundarnih log datoteke, možete konfigurirati bazu podataka za
obavljanje aktivnost prijavite se zove Beskonačni ili Unlimited se prijavite
strategy.Activity Prijavite omogućuje neograničen u svim većim prijavom i
izgradnja jedne ili više datoteka u vlasništvu aktivnog dnevnika transakcija, i
učinkovito omogućiti transakciju koristiti neograničen broj log files.In
reda biti u mogućnosti koristiti neograničen aktivnost log, jednostavno
postavite parametre konfiguracije baze podataka i logsecond userexit da i
-1, respectively.Note sljedeća točka je vrlo važno da kada je parametar
konfiguracije baze podataka je postavljeno na Da, kada userexit, kada log
datoteku je zatvoren kada korisnik userexit Program se zove, i ovaj
program neće logFiles mogu biti pohranjeni trajno preseljena na drugo
mjesto (i stoga, za pohranu server log prostor je trčanje vanjska strana od
opasnosti će biti eliminiran).

Logsecond kad parametar konfiguracije poslužitelja postavljen na -1,


konfiguracijski parametri i logfilsiz logprimary još uvijek u aktivnoj DB2
prijavite se koristi za određivanje put to držati broj primarnih log datoteke, te
kako svaka bi datoteka trebala have.If DB2 treba pročitati iz log file
zapisnik, ali datoteka nije aktivna log put, DB2 će pozvati userexit program
za preuzimanje datoteka s arhivsku datoteku zapisnika, i kopirajte ga na
području zapisnik događaja, tako da druge dokumente za samewill ubrzati
brzinu čitanja.
Google Prevoditelj za:PretraživanjaVideozapisiE-poštaTelefonChatPosao
O usluzi Google PrevoditeljIsključi neposredan prijevodPrivatnostPomoć
Infinite Logging

There is one more permutation of logging that’s worth investigating. Even


in archive logging

mode, the parameters LOGPRIMARY and LOGSECOND can still constrain


the maximum size

of a transaction, even though you can keep allocating as many log files as
your storage can

hold. If a transaction exhausts the sum of the log files represented in the
two parameters,

DB2 halts the transaction. This can even happen at a lower point if either
the MAX_LOG or

NUM_LOG_SPAN parameter is set. MAX_LOG controls the maximum


percentage of log space

a single unit of work can consume, and NUM_LOG_SPAN performs a similar


constraint based

on the maximum number of log files allowed to be used by a single unit of


work.

There are times when it’s nice not to worry about the minutiae of how
much logging is

happening and what fine-grained allocation you can offer to your


applications and users. If

you’re blessed with abundant storage, and an efficient régime for log
archival and retrieval,

you might want to tell DB2 to use only as many log files as required to
keep your transactions

humming. It is for this scenario that infinite logging was created.

Activate infinite logging by setting the LOGSECOND parameter to -1. You


also implicitly

activate USEREXIT and archive logging if it was not already set in your
database. With infinite

logging in place, DB2 uses the primary log files in a typical fashion; if any
transaction requires
more space, DB2 continues to allocate secondary log files until the unit of
work commits or

storage is exhausted.

■Caution It is tempting to think you should just set infinite logging to free
yourself of another housekeep-

ing task. I offer a word of warning here to dent your potential enthusiasm
a little. With infinite logging

enabled I’ve seen log storage blow out to consume all available space
dozens of times. In almost every case,

the culprit wasn’t a large bona fide transaction; instead, it was due to
developer error, typing errors in writing

SQL, a unit of work being left uncommitted for a long time, or


miscalculated effects of certain business logic.

It might sound like a good idea, but remember the old Chinese proverb,
“Be careful what you wish for—it

might just come true.”Log Housekeeping

To complete the logging foundation for later use in backups and recovery,
there are two more

details worth knowing. In all the discussions about logging, you’ll have
noticed that logs are

written to disk when the Log Buffer is flushed. And you’re probably aware
that disks are the

one part of a computer guaranteed to fail at the most inopportune time,


usually right after

you mutter these words: What could possibly go wrong?

DB2 provides a method to mirror your log files, so DB2 writes identical log
file informa-

tion to two separate locations. If the MIRRORLOGPATH parameter is set,


your logs are written

to both the normal and mirrored directories specified. Naturally, for it to be


of any benefit in

protecting against disk failure, your path for mirrored log files should point
to a completely
separate disk drive. Be especially careful if your environment uses RAID or
some form of stor-

age array, in which different logical volumes used under your file systems
might actually

reside in whole, or in part, on the same disk!

Sometimes it’s important to make sure that information possibly still being
tracked in an

active log file (one that hasn’t been filled and archived) is securely closed
off and processed

by the user exit or other archive log-management tools. Typically, this


might be before a big

upgrade or as part of some quality assurance task. You can manually force
DB2 to archive a

log on demand by using this command:

ARCHIVE LOG FOR DATABASE sample

This command forces the Log Buffers to flush and it also forces existing
transactions to

switch over to a new log file, thus freeing the current log files on disk for
archiving.

DB2 Backups

It’s time! Time to back up your database. You created it, added objects,
changed data, tweaked

parameters, and potentially even altered the log parameters if you’ve


followed this chapter.

Enough talk. It’s time for action. Run to your command line (don’t walk!)
and type the follow-

ing commands:

db2 => attach to db2inst1

Instance Attachment Information

Instance server = DB2/LINUX 9.5.0

Authorization ID = DB2INST1
Local instance alias = DB2INST1

db2 => backup database sample to /db2backups/sample

Backup successful. The timestamp for this backup image is :


20080301153901

CHAPTER 19 ■ DB2 BACKUP AND RECOVERY 366

Anda mungkin juga menyukai