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:03,470
In this lesson, we
want to take a look
2
00:00:03,470 --> 00:00:07,940
at the background processes
that run from the Oracle kernel.
3
00:00:07,940 --> 00:00:10,520
So the background
processes are going
4
00:00:10,520 --> 00:00:13,400
to be a part of the Oracle
instance, the instance being
5
00:00:13,400 --> 00:00:17,480
comprised of background
processes and memory caches.
6
00:00:17,480 --> 00:00:20,120
So this is the background
process portion
7
00:00:20,120 --> 00:00:21,500
of the instance.
8
00:00:21,500 --> 00:00:24,890
These align really
with the CPU resource.
9
00:00:24,890 --> 00:00:27,320
So if the three basic
resources of a computer
10
00:00:27,320 --> 00:00:30,560
are CPU, memory, and disk,
the background processes
11
00:00:30,560 --> 00:00:32,960
are utilized by the CPU.
12
00:00:32,960 --> 00:00:35,780
That's where the rubber
meets the road when it comes
13
00:00:35,780 --> 00:00:39,140
to the CPU making Oracle work.
14
00:00:39,140 --> 00:00:42,320
It does it by using these
background processes.
15
00:00:42,320 --> 00:00:45,290
These all run as a part
of the Oracle kernel.
16
00:00:45,290 --> 00:00:47,840
So if you've ever heard of
an operating system kernel,
17
00:00:47,840 --> 00:00:49,680
Oracle has a kernel as well.
18
00:00:49,680 --> 00:00:53,450
It's kind of a core set of
operations that it can do.
19
00:00:53,450 --> 00:00:55,370
When we talk about
background processes,
20
00:00:55,370 --> 00:00:57,620
it's important to
make a distinction
21
00:00:57,620 --> 00:01:00,420
between certain kinds
of operating systems.
22
00:01:00,420 --> 00:01:03,320
There are two basic
types of operating system
23
00:01:03,320 --> 00:01:05,660
for our purposes in
this discussion--
24
00:01:05,660 --> 00:01:08,630
multi-threaded
and multi-process.
25
00:01:08,630 --> 00:01:11,930
And example of a
multi-process operating system
26
00:01:11,930 --> 00:01:14,540
would be something
like Linux or Unix,
27
00:01:14,540 --> 00:01:17,480
where every one of these
background processes
28
00:01:17,480 --> 00:01:21,560
is going to be given a dedicated
operating system process.
29
00:01:21,560 --> 00:01:23,780
So each one of these
processes that we're
30
00:01:23,780 --> 00:01:27,980
going to discuss basically
has its own set of resources
31
00:01:27,980 --> 00:01:29,450
in order to do its job.
32
00:01:29,450 --> 00:01:32,030
And that's a very
efficient way to handle
33
00:01:32,030 --> 00:01:34,310
a server-based operating system.
34
00:01:34,310 --> 00:01:36,960
A multi-threaded operating
system is slightly different.
35
00:01:36,960 --> 00:01:39,830
That's something more
like Windows would be.
36
00:01:39,830 --> 00:01:43,080
Windows runs as a
multi-threaded operating system.
37
00:01:43,080 --> 00:01:48,080
So what that means is when we
start Oracle, it actually runs
38
00:01:48,080 --> 00:01:50,300
through one single executable.
39
00:01:50,300 --> 00:01:52,160
And you can actually
see this on Windows.
40
00:01:52,160 --> 00:01:54,650
It's an oracle.exe.
41
00:01:54,650 --> 00:01:58,760
That's the only
process that's started.
42
00:01:58,760 --> 00:02:00,380
All of these
background processes
43
00:02:00,380 --> 00:02:03,470
run as threads or
portions of the process.
44
00:02:03,470 --> 00:02:05,480
And that is honestly
a less efficient way
45
00:02:05,480 --> 00:02:08,030
to run a server
operating system and can
46
00:02:08,030 --> 00:02:09,950
cause some of the
higher end performance
47
00:02:09,950 --> 00:02:12,890
problems that you can have
on Oracle running on Windows.
48
00:02:16,510 --> 00:02:18,880
So the first process that
we're going to look at
49
00:02:18,880 --> 00:02:20,410
is the main process.
50
00:02:20,410 --> 00:02:23,690
And that's PMON, or
the Process Monitor.
51
00:02:23,690 --> 00:02:27,260
PMON regulates all of
the other processes.
52
00:02:27,260 --> 00:02:30,850
So PMON cleans up processes
like zombie processes
53
00:02:30,850 --> 00:02:33,460
that have been
disconnected irregularly.
54
00:02:33,460 --> 00:02:37,270
So the PMON process is the
single most important process
55
00:02:37,270 --> 00:02:41,190
that must be alive and
running in an Oracle database.
56
00:02:41,190 --> 00:02:46,240
Often DBAs will check to see
if the PMON process is running
57
00:02:46,240 --> 00:02:48,490
when they're trying to
determine whether a database is
58
00:02:48,490 --> 00:02:49,450
up or not.
59
00:02:49,450 --> 00:02:51,670
It's not the only way to do it.
60
00:02:51,670 --> 00:02:54,820
But you do know if at the
operating system level,
61
00:02:54,820 --> 00:02:57,970
you look for PMON, say
in a Linux machine,
62
00:02:57,970 --> 00:03:00,460
and PMON is not
running, you definitely
63
00:03:00,460 --> 00:03:04,060
do not have a database running,
because PMON must be alive.
64
00:03:04,060 --> 00:03:07,270
And so an example of how you
would look at that and Linux
65
00:03:07,270 --> 00:03:10,480
is with a command
like ps, for process.
66
00:03:10,480 --> 00:03:14,620
So its "ps -ef | grep pmon."
67
00:03:14,620 --> 00:03:18,080
And that would allow you
to see the PMON process.
68
00:03:18,080 --> 00:03:20,350
The next process
we look at is SMON,
69
00:03:20,350 --> 00:03:22,370
and that's the System Monitor.
70
00:03:22,370 --> 00:03:25,480
SMON has two primary
responsibilities.
71
00:03:25,480 --> 00:03:28,330
It's responsible for
cleaning up instance recovery
72
00:03:28,330 --> 00:03:30,830
and cleaning up temporary files.
73
00:03:30,830 --> 00:03:34,390
So let's talk about what
instance recovery means.
74
00:03:34,390 --> 00:03:38,590
Let's say for a second that
we have a server that's
75
00:03:38,590 --> 00:03:40,480
running in Oracle Database.
76
00:03:40,480 --> 00:03:42,430
We haven't shut it
down or anything.
77
00:03:42,430 --> 00:03:43,870
It's running along.
78
00:03:43,870 --> 00:03:45,820
Users are connecting
and doing work.
79
00:03:45,820 --> 00:03:49,210
And someone pulls the plug
out of the back of the server.
80
00:03:49,210 --> 00:03:51,610
Well, of course, a
crash is going to occur.
81
00:03:51,610 --> 00:03:55,060
Both the operating system
and Oracle will crash.
82
00:03:55,060 --> 00:03:58,130
So we plug it back in,
restart the server.
83
00:03:58,130 --> 00:03:59,800
The operating system starts.
84
00:03:59,800 --> 00:04:01,960
And then we restart Oracle.
85
00:04:01,960 --> 00:04:04,180
Well, what's happened
in that crash
86
00:04:04,180 --> 00:04:05,880
is that everything in Oracle--
87
00:04:05,880 --> 00:04:08,830
the processes, memory
that's being used--
88
00:04:08,830 --> 00:04:11,860
all of that has come down
in an inconsistent state.
89
00:04:11,860 --> 00:04:14,930
So it can't be used as
it is at that point.
90
00:04:14,930 --> 00:04:18,610
However, the SMON process
comes in during the startup
91
00:04:18,610 --> 00:04:21,520
and initiates what's
called instance recovery.
92
00:04:21,520 --> 00:04:26,140
And SMON will synchronize all
of the different components
93
00:04:26,140 --> 00:04:29,200
in Oracle to get them
back into a stable state.
94
00:04:29,200 --> 00:04:31,390
So instance recovery
is very important.
95
00:04:31,390 --> 00:04:32,890
The most important
thing to remember
96
00:04:32,890 --> 00:04:34,640
about instance
recovery, however,
97
00:04:34,640 --> 00:04:37,550
is that Oracle does
it automatically.
98
00:04:37,550 --> 00:04:39,670
It's not something that
you have to get involved.
99
00:04:39,670 --> 00:04:41,890
It's not like a
database recovery.
100
00:04:41,890 --> 00:04:44,200
That's why it's called
instance recovery, because it's
101
00:04:44,200 --> 00:04:46,060
a different type of recovery.
102
00:04:46,060 --> 00:04:48,670
The second primary
responsibility of SMON
103
00:04:48,670 --> 00:04:50,770
is to clean up temporary files.
104
00:04:50,770 --> 00:04:52,630
Oracle will create
temporary files
105
00:04:52,630 --> 00:04:58,000
at times when it has to write
extra data from memory down
106
00:04:58,000 --> 00:04:58,610
to disk.
107
00:04:58,610 --> 00:05:01,480
So there's not enough
memory to do the operation
108
00:05:01,480 --> 00:05:02,380
that Oracle needs.
109
00:05:02,380 --> 00:05:04,430
And it writes it out to disk.
110
00:05:04,430 --> 00:05:07,930
SMON is responsible for
cleaning that up and keeping
111
00:05:07,930 --> 00:05:11,440
those temporary files as open
with as much free space as
112
00:05:11,440 --> 00:05:12,910
possible.
113
00:05:12,910 --> 00:05:16,950
Next is the Database
Writer process, or DBWn.
114
00:05:16,950 --> 00:05:19,990
And the small n is intentional.
115
00:05:19,990 --> 00:05:23,380
In Oracle, no operations
are done on disk.
116
00:05:23,380 --> 00:05:25,360
It's done in memory instead.
117
00:05:25,360 --> 00:05:28,630
The reason is processing
in memory is faster.
118
00:05:28,630 --> 00:05:30,370
than processing on disk.
119
00:05:30,370 --> 00:05:33,490
So when we look at how
Oracle actually works,
120
00:05:33,490 --> 00:05:39,100
a process will go out to the
disk and read data from disk
121
00:05:39,100 --> 00:05:41,050
and bring it into memory.
122
00:05:41,050 --> 00:05:42,940
And there in memory
is where it'll
123
00:05:42,940 --> 00:05:45,400
be available to other
users who might need it
124
00:05:45,400 --> 00:05:48,400
and the user that initiated
the query to begin with.
125
00:05:48,400 --> 00:05:52,030
So it's the Database Writer
process that does this.
126
00:05:52,030 --> 00:05:55,090
It reads data from
disk into memory
127
00:05:55,090 --> 00:05:57,760
and then eventually
writes it back to disk.
128
00:05:57,760 --> 00:06:00,550
The reason that we call
the Database Writer process
129
00:06:00,550 --> 00:06:05,020
DBWn, or little n, is that
we can have multiple database
130
00:06:05,020 --> 00:06:06,340
writer processes.
131
00:06:06,340 --> 00:06:10,060
There's a lot of work in
reading data from disk
132
00:06:10,060 --> 00:06:11,770
up into memory and back.
133
00:06:11,770 --> 00:06:13,540
And so, consequently,
sometimes it
134
00:06:13,540 --> 00:06:15,400
helps from a
performance perspective
135
00:06:15,400 --> 00:06:18,400
to have multiple Database
Writer processes.
136
00:06:18,400 --> 00:06:20,420
And so if we had
more than one, they
137
00:06:20,420 --> 00:06:25,210
would be named DBW0, DBW1,
and so on and so forth.
138
00:06:25,210 --> 00:06:27,910
Next process is the
Checkpoint Process.
139
00:06:27,910 --> 00:06:30,340
The functionality of
the Checkpoint process
140
00:06:30,340 --> 00:06:33,670
used to be done by the
Database Writer process
141
00:06:33,670 --> 00:06:35,580
in earlier versions of Oracle.
142
00:06:35,580 --> 00:06:37,390
It was later separated out.
143
00:06:37,390 --> 00:06:41,290
So we just mentioned how
Oracle will read data from disk
144
00:06:41,290 --> 00:06:42,640
and put it into memory.
145
00:06:42,640 --> 00:06:45,640
The data that's on the
disk is known as a block.
146
00:06:45,640 --> 00:06:48,610
And the data in memory
is known as a buffer.
147
00:06:48,610 --> 00:06:51,880
So it's almost like Oracle,
the Database Writer process,
148
00:06:51,880 --> 00:06:55,480
actually, that reads
data blocks from disk
149
00:06:55,480 --> 00:06:57,340
and puts them into
buffers that's
150
00:06:57,340 --> 00:07:00,700
the same size as the
block into those buffers.
151
00:07:00,700 --> 00:07:04,540
When a block is written into
a buffer and then changed,
152
00:07:04,540 --> 00:07:07,000
it becomes what's
called a dirty buffer.
153
00:07:07,000 --> 00:07:10,360
So that buffer in memory
needs to be written down
154
00:07:10,360 --> 00:07:12,340
to disk for consistency.
155
00:07:12,340 --> 00:07:15,160
So buffers that have not
been changed are clean.
156
00:07:15,160 --> 00:07:17,410
Those that have been
changed are dirty.
157
00:07:17,410 --> 00:07:20,800
It's the CKPT
process that signals
158
00:07:20,800 --> 00:07:24,970
the writing of the dirty
buffers back down to disk.
159
00:07:24,970 --> 00:07:27,730
When it decides
that needs to occur,
160
00:07:27,730 --> 00:07:30,340
the amount of dirty
buffers in memory
161
00:07:30,340 --> 00:07:32,360
has reached a
certain threshold, it
162
00:07:32,360 --> 00:07:36,220
signals Database Writer, write
all of those dirty buffers
163
00:07:36,220 --> 00:07:38,830
back to disk for
read consistency.
164
00:07:38,830 --> 00:07:42,220
We can have full checkpoints
and incremental checkpoints.
165
00:07:42,220 --> 00:07:44,380
A full checkpoint will
actually write out
166
00:07:44,380 --> 00:07:46,120
all of the dirty buffers.
167
00:07:46,120 --> 00:07:48,220
And that used to be
the way that Oracle
168
00:07:48,220 --> 00:07:50,290
operated all of the time.
169
00:07:50,290 --> 00:07:51,880
Now in newer versions
of Oracle, we
170
00:07:51,880 --> 00:07:54,010
have what's called
incremental checkpoints.
171
00:07:54,010 --> 00:07:56,110
It's a little more
intelligent process
172
00:07:56,110 --> 00:07:58,000
that can decide the
dirty buffers that
173
00:07:58,000 --> 00:08:00,400
need to be written
down to disk the most
174
00:08:00,400 --> 00:08:03,100
importantly, the ones that are
the most important to write.
175
00:08:03,100 --> 00:08:06,460
The reason is a checkpoint
can cause a sort of pause
176
00:08:06,460 --> 00:08:08,290
in the database
while that's being
177
00:08:08,290 --> 00:08:10,300
done for read consistency.
178
00:08:10,300 --> 00:08:14,110
And so it can be more efficient
to do incremental checkpoints.
179
00:08:14,110 --> 00:08:19,240
Another important process is
the Log Writer Process, or LGWR.
180
00:08:19,240 --> 00:08:22,450
The Log Writer process
is crucial in Oracle's
181
00:08:22,450 --> 00:08:24,740
recoverability architecture.
182
00:08:24,740 --> 00:08:26,920
So Oracle is designed
from the ground up
183
00:08:26,920 --> 00:08:29,980
to be able to recover
from disasters,
184
00:08:29,980 --> 00:08:32,890
from the loss of data,
the loss of disk.
185
00:08:32,890 --> 00:08:34,960
But an architecture
has to be in place
186
00:08:34,960 --> 00:08:36,830
that allows that to happen.
187
00:08:36,830 --> 00:08:38,830
So the Log Writer
process is really
188
00:08:38,830 --> 00:08:43,600
key to that, because every
change that occurs in an Oracle
189
00:08:43,600 --> 00:08:48,010
Database, is written out
eventually to files called redo
190
00:08:48,010 --> 00:08:50,590
logs for recovery purposes.
191
00:08:50,590 --> 00:08:53,230
So those changes are
written and recorded
192
00:08:53,230 --> 00:08:55,650
by the Log Writer process.
193
00:08:55,650 --> 00:08:59,530
They're written first to
memory and then later to disk,
194
00:08:59,530 --> 00:09:01,210
as what we call redo logs.
195
00:09:01,210 --> 00:09:05,200
Then those redo logs can
be used during recovery
196
00:09:05,200 --> 00:09:07,390
in order to recover a database.
197
00:09:07,390 --> 00:09:10,660
Next is the Archiver
Process, or the ARCn.
198
00:09:10,660 --> 00:09:13,600
So we just discussed the
recoverability architecture.
199
00:09:13,600 --> 00:09:18,400
The way this actually works
is that as the LGWR process is
200
00:09:18,400 --> 00:09:22,030
writing changes that
eventually go to redo logs,
201
00:09:22,030 --> 00:09:23,980
those redo logs
will be written to
202
00:09:23,980 --> 00:09:26,110
and will eventually become full.
203
00:09:26,110 --> 00:09:29,870
It switches to the next redo
log, and so on and so forth.
204
00:09:29,870 --> 00:09:33,020
But there's a finite
number of redo logs.
205
00:09:33,020 --> 00:09:35,080
So it's possible
that eventually you
206
00:09:35,080 --> 00:09:37,930
can go through all
of the redo logs
207
00:09:37,930 --> 00:09:39,610
and go back to
the first redo log
208
00:09:39,610 --> 00:09:41,980
and begin overwriting
the changes.
209
00:09:41,980 --> 00:09:45,280
Now that would completely
short circuit our ability
210
00:09:45,280 --> 00:09:48,970
to do recovery, because those
changes are being overwritten.
211
00:09:48,970 --> 00:09:52,420
That's a process called
NOARCHIVELOG mode.
212
00:09:52,420 --> 00:09:55,450
So when we are running
a NOARCHIVELOG mode,
213
00:09:55,450 --> 00:09:57,670
we're saying that
recoverability of the database
214
00:09:57,670 --> 00:09:59,360
is not important to us.
215
00:09:59,360 --> 00:10:01,510
We don't want to do the
extra setup involved
216
00:10:01,510 --> 00:10:04,240
in the ARCHIVELOG mode.
217
00:10:04,240 --> 00:10:08,890
In ARCHIVELOG mode, a separate
process, the Archiver Process,
218
00:10:08,890 --> 00:10:13,720
is going to copy the redo
log out to a static file.
219
00:10:13,720 --> 00:10:16,280
So while the redo
logs are dynamic,
220
00:10:16,280 --> 00:10:18,160
and they'll be
written to, switched,
221
00:10:18,160 --> 00:10:19,510
and can be overwritten.
222
00:10:19,510 --> 00:10:22,390
Before that can ever
happen, Archiver Process
223
00:10:22,390 --> 00:10:24,850
will make a copy
of that redo log.
224
00:10:24,850 --> 00:10:28,270
And so now we have a history
of all of the changes
225
00:10:28,270 --> 00:10:29,290
that have occurred.
226
00:10:29,290 --> 00:10:32,020
Even the ones that were
overwritten in the redo logs
227
00:10:32,020 --> 00:10:34,810
were already written
out to ARCHIVELOGs.
228
00:10:34,810 --> 00:10:38,500
And the reason that we
use the ARCn designation
229
00:10:38,500 --> 00:10:40,690
is because the
Archiver Process can
230
00:10:40,690 --> 00:10:44,770
have multiple processes as
well, such as ARC0, ARC1,
231
00:10:44,770 --> 00:10:46,030
and so forth.
232
00:10:46,030 --> 00:10:48,010
This is to allow the
Archiver to write
233
00:10:48,010 --> 00:10:51,880
to multiple destinations,
such as a D drive,
234
00:10:51,880 --> 00:10:56,050
and then also to an E drive,
and then maybe to a tape system
235
00:10:56,050 --> 00:10:59,570
as well, or to off-site storage.
236
00:10:59,570 --> 00:11:01,650
There are a few other
background processes that we
237
00:11:01,650 --> 00:11:03,300
should look at before we close.
238
00:11:03,300 --> 00:11:06,060
These are less important
than the core processes
239
00:11:06,060 --> 00:11:07,080
that we've discussed.
240
00:11:07,080 --> 00:11:11,730
But they become important as
well as new features are added.
241
00:11:11,730 --> 00:11:15,280
The first MMON, which writes
out performance metrics.
242
00:11:15,280 --> 00:11:18,660
So Oracle is capable of
monitoring its own performance
243
00:11:18,660 --> 00:11:20,640
metrics inside the database.
244
00:11:20,640 --> 00:11:22,230
And it has a dedicated process.
245
00:11:22,230 --> 00:11:24,710
MMON, to record
that information.
246
00:11:24,710 --> 00:11:29,460
And that makes that available
to DBAs as well for diagnostics.
247
00:11:29,460 --> 00:11:32,880
The next process is
MMAN, the Memory Manager.
248
00:11:32,880 --> 00:11:35,520
And that will
automatically manage memory
249
00:11:35,520 --> 00:11:36,930
in an Oracle Database.
250
00:11:36,930 --> 00:11:39,600
So we can set up our
memory management
251
00:11:39,600 --> 00:11:41,740
in a lot of different ways
for an Oracle database.
252
00:11:41,740 --> 00:11:43,570
It's very flexible.
253
00:11:43,570 --> 00:11:46,950
We can also choose to just let
Oracle take care of it, decide
254
00:11:46,950 --> 00:11:49,530
what the memory
sizing should be.
255
00:11:49,530 --> 00:11:52,410
And that's what the
MMAN process does.
256
00:11:52,410 --> 00:11:56,770
The last is the LREG process,
for Listener Registration.
257
00:11:56,770 --> 00:12:01,560
This is a new process in 12c
that will register a database
258
00:12:01,560 --> 00:12:03,170
with what's called a listener.
259
00:12:03,170 --> 00:12:05,340
And a listener is
just a process that
260
00:12:05,340 --> 00:12:09,070
is listening for incoming
connections to the database.
21134
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.