Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,430 --> 00:00:05,120
In this lesson, we want to
examine the redo architecture
2
00:00:05,120 --> 00:00:07,190
of the Oracle database system.
3
00:00:07,190 --> 00:00:12,230
Any true RDBMS must be
designed with recovery in mind.
4
00:00:12,230 --> 00:00:14,150
So there are many
types of failures
5
00:00:14,150 --> 00:00:17,000
that can occur in an
Oracle database that
6
00:00:17,000 --> 00:00:19,310
require some kind of recovery.
7
00:00:19,310 --> 00:00:23,060
For instance, if we have a
database server and the disk
8
00:00:23,060 --> 00:00:24,830
in that server fails--
9
00:00:24,830 --> 00:00:26,210
let's say one of the disks--
10
00:00:26,210 --> 00:00:28,820
10 disks, one of
them fails, that disk
11
00:00:28,820 --> 00:00:30,500
was holding database data--
12
00:00:30,500 --> 00:00:33,520
then a recovery is
required in some way.
13
00:00:33,520 --> 00:00:37,940
And an RDBMS must be able to
perform incomplete recovery as
14
00:00:37,940 --> 00:00:39,600
well as complete recovery.
15
00:00:39,600 --> 00:00:41,870
So if we were to define
complete recovery,
16
00:00:41,870 --> 00:00:44,690
that means the recovery
of all the changes
17
00:00:44,690 --> 00:00:48,600
and data in the database up
until the point of failure--
18
00:00:48,600 --> 00:00:50,990
so right before the
failure occurred,
19
00:00:50,990 --> 00:00:54,080
that's our level of
recovery-- complete recovery.
20
00:00:54,080 --> 00:00:55,760
So you might ask,
well, why do we need
21
00:00:55,760 --> 00:00:58,190
to do an incomplete recovery?
22
00:00:58,190 --> 00:01:00,230
Well, the truth is that
an incomplete recovery
23
00:01:00,230 --> 00:01:03,170
is almost as common as
a complete recovery is.
24
00:01:03,170 --> 00:01:05,270
An incomplete
recovery occurs when
25
00:01:05,270 --> 00:01:08,630
we need to recover the
database to a point
26
00:01:08,630 --> 00:01:11,040
that it was in the past.
27
00:01:11,040 --> 00:01:13,530
So you might wonder, why
would we need to do this?
28
00:01:13,530 --> 00:01:15,380
Let's say that a
developer accidentally
29
00:01:15,380 --> 00:01:17,570
drops a production table--
30
00:01:17,570 --> 00:01:20,750
an essential production table
that we cannot be without--
31
00:01:20,750 --> 00:01:25,700
but doesn't tell us until about
six hours after the act occurs.
32
00:01:25,700 --> 00:01:29,960
Changes occur in the database
after the table was dropped,
33
00:01:29,960 --> 00:01:32,730
but the table itself
has to be recovered.
34
00:01:32,730 --> 00:01:35,240
So if we do a complete
recovery, that
35
00:01:35,240 --> 00:01:38,720
means we'll restore the backup
and do a complete recovery
36
00:01:38,720 --> 00:01:40,640
of all the changes
in the database
37
00:01:40,640 --> 00:01:42,800
all the way up to
the present time,
38
00:01:42,800 --> 00:01:45,590
but that would actually
restore the statement
39
00:01:45,590 --> 00:01:47,240
that dropped the table.
40
00:01:47,240 --> 00:01:50,450
So it would not gain us anything
to do with complete recovery
41
00:01:50,450 --> 00:01:52,010
in that scenario.
42
00:01:52,010 --> 00:01:54,920
What we would need to do
is an incomplete recovery.
43
00:01:54,920 --> 00:01:57,440
So we would need to
recover the database up
44
00:01:57,440 --> 00:02:00,800
to the point in time
right before the drop
45
00:02:00,800 --> 00:02:02,900
of the production
table occurred,
46
00:02:02,900 --> 00:02:04,460
and then open the database.
47
00:02:04,460 --> 00:02:07,260
We would lose the changes
that occurred after,
48
00:02:07,260 --> 00:02:09,050
and that's something
that has to be decided
49
00:02:09,050 --> 00:02:12,560
on-- whether the table itself
is more important than the data
50
00:02:12,560 --> 00:02:13,950
that occurred after.
51
00:02:13,950 --> 00:02:16,070
But that's the concept of
an incomplete recovery.
52
00:02:16,070 --> 00:02:20,270
So both must be done
at times in an RDBMS.
53
00:02:20,270 --> 00:02:25,050
So in Oracle's architecture,
the Log Writer, process or LGWR,
54
00:02:25,050 --> 00:02:28,400
writes changes to the
log buffer in memory
55
00:02:28,400 --> 00:02:30,920
and then to redo logs.
56
00:02:30,920 --> 00:02:34,040
Oracle can operate in two
different modes in terms
57
00:02:34,040 --> 00:02:35,750
of the redo architecture.
58
00:02:35,750 --> 00:02:38,490
The first is NOARCHIVELOG mode.
59
00:02:38,490 --> 00:02:41,130
So let's take a look
at how this works.
60
00:02:41,130 --> 00:02:44,540
Let's say that we have a
database with three redo logs.
61
00:02:44,540 --> 00:02:47,030
And the redo logs,
again, will be
62
00:02:47,030 --> 00:02:50,490
the storage for the changes
that occur in the database.
63
00:02:50,490 --> 00:02:55,450
So the log writer process
writes to the first redo log.
64
00:02:55,450 --> 00:02:58,450
Once that redo log
is full, Oracle
65
00:02:58,450 --> 00:03:01,300
performs what's
called a log switch.
66
00:03:01,300 --> 00:03:05,200
That switches to a log writer
process writing to the next,
67
00:03:05,200 --> 00:03:08,580
or second redo log.
68
00:03:08,580 --> 00:03:12,750
Once that data is written and
the second redo log is full,
69
00:03:12,750 --> 00:03:14,710
another log switch occurs.
70
00:03:14,710 --> 00:03:16,710
Now we're writing to the third.
71
00:03:16,710 --> 00:03:19,920
But what happens when
the third is full?
72
00:03:19,920 --> 00:03:22,290
Oracle performs
another log switch,
73
00:03:22,290 --> 00:03:24,060
and the log writer
process begins
74
00:03:24,060 --> 00:03:28,380
writing to the first
redo log again, actually
75
00:03:28,380 --> 00:03:31,560
overwriting the changes
that were there before.
76
00:03:31,560 --> 00:03:34,980
Now, we may say this is
counterintuitive to the idea
77
00:03:34,980 --> 00:03:37,710
that this is a
recoverable architecture,
78
00:03:37,710 --> 00:03:39,090
and we would be correct.
79
00:03:39,090 --> 00:03:43,590
NOARCHIVELOG mode is not a
recoverability architecture.
80
00:03:43,590 --> 00:03:46,530
We would not be able to
do complete recoveries
81
00:03:46,530 --> 00:03:48,270
with NOARCHIVELOG mode.
82
00:03:48,270 --> 00:03:50,700
However, it is a valid mode.
83
00:03:50,700 --> 00:03:53,790
You can operate a database
at NOARCHIVELOG mode,
84
00:03:53,790 --> 00:03:57,240
and there are situations where
company business requirements
85
00:03:57,240 --> 00:03:59,490
may state that the
database does not
86
00:03:59,490 --> 00:04:01,680
need to be recoverable;
that that's not
87
00:04:01,680 --> 00:04:03,810
an important part
of the requirements.
88
00:04:03,810 --> 00:04:06,420
Things like storage
may be more important.
89
00:04:06,420 --> 00:04:10,020
So NOARCHIVELOG is valid,
although Oracle does not
90
00:04:10,020 --> 00:04:13,410
recommend that you run
databases in NOARCHIVELOG mode.
91
00:04:13,410 --> 00:04:15,390
And it's worth
understanding that that's
92
00:04:15,390 --> 00:04:18,690
the default for a database
when it's created.
93
00:04:18,690 --> 00:04:21,160
So let's examine
ARCHIVELOG mode,
94
00:04:21,160 --> 00:04:24,440
which is a full
recoverability architecture.
95
00:04:24,440 --> 00:04:26,370
Just as before, the
log writer process
96
00:04:26,370 --> 00:04:29,880
begins writing to
the first redo log.
97
00:04:29,880 --> 00:04:32,580
When a log switch
occurs, log writer
98
00:04:32,580 --> 00:04:35,760
begins writing to
the second redo log.
99
00:04:35,760 --> 00:04:39,210
But at that moment,
the archiver process
100
00:04:39,210 --> 00:04:42,390
writes a copy of
the redo log out
101
00:04:42,390 --> 00:04:44,880
to what's called an
archived log file--
102
00:04:44,880 --> 00:04:48,390
or an offline log,
sometimes referred to.
103
00:04:48,390 --> 00:04:51,390
That'll be a complete and
full copy of the changes that
104
00:04:51,390 --> 00:04:52,950
are in redo log 1.
105
00:04:52,950 --> 00:04:55,080
So now we've switched to here.
106
00:04:55,080 --> 00:04:58,140
Log writer's writing
to the second redo log.
107
00:04:58,140 --> 00:04:59,130
It gets full.
108
00:04:59,130 --> 00:05:00,750
Log switch occurs.
109
00:05:00,750 --> 00:05:04,110
An archiver writes
out arch02.log--
110
00:05:04,110 --> 00:05:08,220
so the second archive log,
which is a copy of redo log 2.
111
00:05:08,220 --> 00:05:10,590
Log writer writes to
the third redo log.
112
00:05:10,590 --> 00:05:12,140
Switch occurs again.
113
00:05:12,140 --> 00:05:15,000
Archiver writes out
the third archive log.
114
00:05:15,000 --> 00:05:17,040
Now, at this point,
we're overwriting
115
00:05:17,040 --> 00:05:19,500
changes in the redo
log, but we're not
116
00:05:19,500 --> 00:05:22,170
concerned about this,
because the changes are all
117
00:05:22,170 --> 00:05:24,210
written in this static file.
118
00:05:24,210 --> 00:05:26,540
And when the log
switch occurs again,
119
00:05:26,540 --> 00:05:28,770
the data that's in
the first redo log
120
00:05:28,770 --> 00:05:32,100
will be written out to the next
archive log in the sequence.
121
00:05:32,100 --> 00:05:35,700
What this gives us,
consequently, is with a backup,
122
00:05:35,700 --> 00:05:39,750
we can apply all of the changes
that are stored in the archive
123
00:05:39,750 --> 00:05:43,920
logs, then all the changes
that are in the redo logs,
124
00:05:43,920 --> 00:05:47,250
and get a full recoverability
architecture of all the changes
125
00:05:47,250 --> 00:05:50,400
that occurred up to
the point of failure.
10068
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.