<s>
In	O
the	O
Oracle	B-General_Concept
RDBMS	I-General_Concept
environment	O
,	O
redo	B-Application
logs	I-Application
comprise	O
files	O
in	O
a	O
proprietary	O
format	O
which	O
log	O
a	O
history	O
of	O
all	O
changes	O
made	O
to	O
the	O
database	O
.	O
</s>
<s>
Each	O
redo	B-Application
log	I-Application
file	I-Application
consists	O
of	O
redo	O
records	O
.	O
</s>
<s>
A	O
redo	O
record	O
,	O
also	O
called	O
a	O
redo	O
entry	O
,	O
holds	O
a	O
group	O
of	O
change	B-Application
vectors	I-Application
,	O
each	O
of	O
which	O
describes	O
or	O
represents	O
a	O
change	O
made	O
to	O
a	O
single	O
block	O
in	O
the	O
database	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
a	O
user	O
UPDATEs	O
a	O
salary-value	O
in	O
a	O
table	O
containing	O
employee-related	O
data	O
,	O
the	O
DBMS	B-General_Concept
generates	O
a	O
redo	O
record	O
containing	O
change-vectors	O
that	O
describe	O
changes	O
to	O
the	O
data	O
segment	O
block	O
for	O
the	O
table	O
.	O
</s>
<s>
And	O
if	O
the	O
user	O
then	O
COMMITs	O
the	O
update	O
,	O
Oracle	B-Application
generates	O
another	O
redo	O
record	O
and	O
assigns	O
the	O
change	O
a	O
"	O
system	O
change	O
number	O
"	O
(	O
SCN	O
)	O
.	O
</s>
<s>
Whenever	O
something	O
changes	O
in	O
a	O
datafile	O
,	O
Oracle	B-Application
records	O
the	O
change	O
in	O
the	O
redo	B-Application
log	I-Application
.	O
</s>
<s>
The	O
name	O
redo	B-Application
log	I-Application
indicates	O
its	O
purpose	O
:	O
If	O
the	O
database	O
crashes	O
,	O
the	O
RDBMS	O
can	O
redo	O
(	O
re-process	O
)	O
all	O
changes	O
on	O
datafiles	O
which	O
will	O
take	O
the	O
database	O
data	O
back	O
to	O
the	O
state	O
it	O
was	O
when	O
the	O
last	O
redo	O
record	O
was	O
written	O
.	O
</s>
<s>
DBAs	O
use	O
the	O
views	O
V$LOG	O
,	O
V$LOGFILE	O
,	O
V$LOG_HISTORY	O
and	O
V$THREAD	O
to	O
find	O
information	O
about	O
the	O
redo	B-Application
log	I-Application
of	O
the	O
database	O
.	O
</s>
<s>
Each	O
redo	B-Application
log	I-Application
file	I-Application
belongs	O
to	O
exactly	O
one	O
group	O
(	O
of	O
which	O
at	O
least	O
two	O
must	O
exist	O
)	O
.	O
</s>
<s>
Oracle	B-Application
uses	O
that	O
current	O
group	O
to	O
write	O
the	O
redo	B-Application
log	I-Application
entries	O
.	O
</s>
<s>
Each	O
log	O
switch	O
causes	O
checkpoint	O
,	O
however	O
,	O
the	O
converse	O
is	O
not	O
true	O
:	O
a	O
checkpoint	O
does	O
not	O
cause	O
a	O
redo	B-Application
log	I-Application
switch	O
.	O
</s>
<s>
Redo	B-Application
log	I-Application
files	I-Application
occur	O
in	O
two	O
types	O
:	O
</s>
<s>
Before	O
a	O
user	O
receives	O
a	O
""	O
message	O
,	O
the	O
system	O
must	O
first	O
successfully	O
write	O
the	O
new	O
or	O
changed	O
data	O
to	O
a	O
redo	B-Application
log	I-Application
file	I-Application
.	O
</s>
<s>
The	O
RDBMS	O
first	O
writes	O
all	O
changes	O
included	O
in	O
the	O
transaction	O
into	O
the	O
log	O
buffer	O
in	O
the	O
System	B-Application
Global	I-Application
Area	I-Application
(	O
SGA	O
)	O
.	O
</s>
<s>
Of	O
course	O
,	O
when	O
a	O
transaction	O
commits	O
,	O
the	O
redo	B-Application
log	I-Application
buffer	O
must	O
be	O
flushed	O
to	O
disk	O
,	O
because	O
otherwise	O
the	O
recovery	B-Application
for	O
that	O
commit	O
could	O
not	O
be	O
guaranteed	O
.	O
</s>
<s>
Having	O
a	O
redo	B-Application
log	I-Application
makes	O
it	O
possible	O
to	O
replay	O
SQL	O
statements	O
.	O
</s>
<s>
Before	O
an	O
Oracle	B-General_Concept
database	I-General_Concept
changes	O
data	O
in	O
a	O
datafile	O
it	O
writes	O
changes	O
to	O
the	O
redo	B-Application
log	I-Application
.	O
</s>
<s>
If	O
something	O
happens	O
to	O
one	O
of	O
the	O
datafiles	O
,	O
a	O
recovery	B-Application
procedure	O
can	O
restore	O
a	O
backed-up	O
datafile	O
and	O
then	O
replay	O
the	O
redo	O
written	O
since	O
backup-time	O
;	O
this	O
brings	O
the	O
datafile	O
to	O
the	O
state	O
it	O
had	O
before	O
it	O
became	O
unavailable	O
.	O
</s>
<s>
Standby	B-Application
databases	I-Application
in	O
an	O
Oracle	B-Application
Data	I-Application
Guard	I-Application
environment	O
use	O
the	O
same	O
technique	O
:	O
one	O
database	O
(	O
the	O
primary	O
database	O
)	O
records	O
all	O
changes	O
and	O
sends	O
them	O
to	O
the	O
standby	O
database(s )	O
.	O
</s>
<s>
If	O
a	O
database	O
crashes	O
,	O
the	O
recovery	B-Application
process	O
has	O
to	O
apply	O
all	O
transactions	O
,	O
both	O
uncommitted	O
as	O
well	O
as	O
committed	O
,	O
to	O
the	O
data-files	O
on	O
disk	O
,	O
using	O
the	O
information	O
in	O
the	O
redo	B-Application
log	I-Application
files	I-Application
.	O
</s>
<s>
Oracle	B-Application
must	O
re-do	O
all	O
redo-log	O
transactions	O
that	O
have	O
both	O
a	O
BEGIN	O
and	O
a	O
COMMIT	O
entry	O
(	O
roll	O
forward	O
)	O
,	O
and	O
it	O
must	O
undo	O
all	O
transactions	O
that	O
have	O
a	O
BEGIN	O
entry	O
but	O
no	O
COMMIT	O
entry	O
(	O
roll	O
back	O
)	O
.	O
</s>
<s>
(	O
Re-doing	O
a	O
transaction	O
in	O
this	O
context	O
simply	O
means	O
applying	O
the	O
information	O
in	O
the	O
redo	B-Application
log	I-Application
files	I-Application
to	O
the	O
database	O
;	O
the	O
system	O
does	O
not	O
re-run	O
the	O
transaction	O
itself	O
.	O
)	O
</s>
<s>
The	O
system	O
thus	O
re-creates	O
committed	O
transactions	O
by	O
applying	O
the	O
“	O
after	O
image	O
”	O
records	O
in	O
the	O
redo	B-Application
log	I-Application
files	I-Application
to	O
the	O
database	O
,	O
and	O
undoes	O
incomplete	O
transactions	O
by	O
using	O
the	O
"	O
before	O
image	O
"	O
records	O
in	O
the	O
undo	O
tablespace	B-General_Concept
.	O
</s>
<s>
Change	B-General_Concept
data	I-General_Concept
capture	I-General_Concept
can	O
read	O
the	O
redo	B-Application
logs	I-Application
.	O
</s>
<s>
In	O
Oracle	B-Application
Data	I-Application
Guard	I-Application
configurations	O
,	O
standby	O
redo	B-Application
logs	I-Application
resemble	O
their	O
equivalent	O
online	O
redo	B-Application
logs	I-Application
,	O
but	O
serve	O
to	O
store	O
redo	O
data	O
transmitted	O
from	O
a	O
different	O
database	O
.	O
</s>
<s>
Given	O
the	O
verbosity	O
of	O
the	O
logging	O
,	O
Oracle	B-Application
Corporation	I-Application
provides	O
methods	O
for	O
archiving	O
redo	B-Application
logs	I-Application
(	O
archive-logs	O
)	O
,	O
and	O
this	O
in	O
turn	O
can	O
feed	O
into	O
data-backup	O
scenarios	O
and	O
standby	B-Application
databases	I-Application
.	O
</s>
<s>
The	O
existence	O
of	O
a	O
detailed	O
series	O
of	O
individually	O
logged	O
transactions	O
and	O
actions	O
provides	O
the	O
basis	O
of	O
several	O
data-management	O
enhancements	O
such	O
as	O
Oracle	B-Application
Flashback	I-Application
,	O
log-mining	B-Application
and	O
point-in-time	B-General_Concept
recovery	I-General_Concept
.	O
</s>
<s>
can	O
influence	O
the	O
use	O
of	O
redo	O
in	O
database	O
recovery	B-Application
.	O
</s>
<s>
For	O
database	B-General_Concept
tuning	I-General_Concept
purposes	O
,	O
efficiently	O
coping	O
with	O
redo	B-Application
logs	I-Application
requires	O
plentiful	O
and	O
fast-access	O
disk	O
.	O
</s>
