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:04,730
In this lesson, we'll be taking
a look at memory management.
2
00:00:04,730 --> 00:00:06,320
Memory management
is very important
3
00:00:06,320 --> 00:00:09,080
because memory is very
important to Oracle.
4
00:00:09,080 --> 00:00:13,340
These Oracle caches all
have a particular job to do.
5
00:00:13,340 --> 00:00:15,290
And the performance
of our system
6
00:00:15,290 --> 00:00:17,450
is highly dependent
on whether or not
7
00:00:17,450 --> 00:00:19,580
we have them sized correctly.
8
00:00:19,580 --> 00:00:22,610
So Oracle has taken a
number of different methods
9
00:00:22,610 --> 00:00:24,650
through the years
to manage memory--
10
00:00:24,650 --> 00:00:26,480
all the way back
to the old days,
11
00:00:26,480 --> 00:00:28,160
where we used manual
memory management.
12
00:00:28,160 --> 00:00:29,780
And many people still do.
13
00:00:29,780 --> 00:00:33,260
And then, in version
10g, Oracle came up
14
00:00:33,260 --> 00:00:35,660
with automatic shared
memory management.
15
00:00:35,660 --> 00:00:38,630
And in 11g, automatic
memory management.
16
00:00:38,630 --> 00:00:40,700
So we have some
choices here in how
17
00:00:40,700 --> 00:00:43,340
we manage our memory so
it's important to understand
18
00:00:43,340 --> 00:00:45,370
how they work.
19
00:00:45,370 --> 00:00:47,280
So the first type
of memory management
20
00:00:47,280 --> 00:00:49,350
is known as manual
memory management.
21
00:00:49,350 --> 00:00:51,510
And when you do an
installation of Oracle
22
00:00:51,510 --> 00:00:54,920
and then the creation of a
database in the DBCA tool,
23
00:00:54,920 --> 00:00:57,390
there's an option for
you to choose what type
24
00:00:57,390 --> 00:00:59,070
of memory management you want.
25
00:00:59,070 --> 00:01:01,320
When we manually
manage our memory,
26
00:01:01,320 --> 00:01:04,230
that means we're doing
separate parameter settings
27
00:01:04,230 --> 00:01:06,160
for the following parameters.
28
00:01:06,160 --> 00:01:07,980
So the shared pool size--
29
00:01:07,980 --> 00:01:10,290
the size of the shared pool.
30
00:01:10,290 --> 00:01:13,020
The size of the
database buffer cache.
31
00:01:13,020 --> 00:01:15,210
The size of the large pool.
32
00:01:15,210 --> 00:01:18,210
And the size of the
Java and Stream pools.
33
00:01:18,210 --> 00:01:19,560
And also the PGA--
34
00:01:19,560 --> 00:01:21,480
the program global area.
35
00:01:21,480 --> 00:01:23,580
So we're taking all
of the parameters
36
00:01:23,580 --> 00:01:26,160
that we can manually
size and we're
37
00:01:26,160 --> 00:01:28,560
taking that responsibility
on ourselves
38
00:01:28,560 --> 00:01:30,540
to say that we're
deciding what we
39
00:01:30,540 --> 00:01:33,510
want those parameters
to be-- those values.
40
00:01:33,510 --> 00:01:36,270
And then the memory is
cut out in the operating
41
00:01:36,270 --> 00:01:39,240
system for Oracle to
use in that fashion.
42
00:01:39,240 --> 00:01:42,480
Many DBAs still use manual
memory management today
43
00:01:42,480 --> 00:01:45,960
because they feel it's the most
efficient way to manage memory.
44
00:01:45,960 --> 00:01:49,320
Because the other two methods
have somewhat of an overhead
45
00:01:49,320 --> 00:01:52,560
involved because Oracle
is managing some portion
46
00:01:52,560 --> 00:01:55,440
of the memory, to some degree.
47
00:01:55,440 --> 00:01:59,180
In 10g, Oracle came out
with automatic shared memory
48
00:01:59,180 --> 00:02:00,230
management.
49
00:02:00,230 --> 00:02:04,190
And with automatic shared
memory management, or ASMM,
50
00:02:04,190 --> 00:02:08,310
Oracle is managing just
the SGA dynamically.
51
00:02:08,310 --> 00:02:11,690
So the only Memory
settings that we change
52
00:02:11,690 --> 00:02:15,920
are the overall size of the
SGA and the size of the PGA.
53
00:02:15,920 --> 00:02:18,770
So the PGA-- being the
program global area--
54
00:02:18,770 --> 00:02:22,100
isn't associated with any
of the caches in the SGA.
55
00:02:22,100 --> 00:02:24,200
And so the PGA stands
alone on its own,
56
00:02:24,200 --> 00:02:27,810
anyway, also in manual
memory management.
57
00:02:27,810 --> 00:02:31,400
However, as far as the SGA
goes, what's occurring here?
58
00:02:31,400 --> 00:02:34,910
So we're setting a
parameter called sga_target
59
00:02:34,910 --> 00:02:38,000
and that's going to be
the size of the SGA.
60
00:02:38,000 --> 00:02:43,220
Within that sga_target
boundary, everything in the SGA
61
00:02:43,220 --> 00:02:46,160
is automatically
managed by Oracle.
62
00:02:46,160 --> 00:02:49,820
So it will decide on the
size of the shared pool,
63
00:02:49,820 --> 00:02:51,770
and the size of the
database buffer cache,
64
00:02:51,770 --> 00:02:54,410
and the large pool, and the
Java cache-- all of those,
65
00:02:54,410 --> 00:02:56,930
it will decide as it sees fit.
66
00:02:56,930 --> 00:02:58,970
And it has the
ability to do this
67
00:02:58,970 --> 00:03:02,930
because it has processes,
like MMAN, under the hood that
68
00:03:02,930 --> 00:03:04,220
are managing the memory.
69
00:03:04,220 --> 00:03:08,660
So if Oracle senses that the
buffer cache needs more memory,
70
00:03:08,660 --> 00:03:11,780
it can take away memory
from the shared pool
71
00:03:11,780 --> 00:03:14,330
and give it to the buffer cache.
72
00:03:14,330 --> 00:03:19,100
So all of the caches within
the sga_target are being moved
73
00:03:19,100 --> 00:03:22,370
and sized constantly,
changing to adapt to whatever
74
00:03:22,370 --> 00:03:24,840
your database needs are.
75
00:03:24,840 --> 00:03:27,600
This is a good idea,
at least for a database
76
00:03:27,600 --> 00:03:30,790
that is sort of dynamic
or a hybrid database.
77
00:03:30,790 --> 00:03:34,620
So let's say that a database
is an OLTP transactional
78
00:03:34,620 --> 00:03:36,810
system during the
day, but at night, it
79
00:03:36,810 --> 00:03:40,760
does more decision support
and batch processing.
80
00:03:40,760 --> 00:03:43,140
And a lot of databases
are like that.
81
00:03:43,140 --> 00:03:45,120
Well, the needs of the SGA--
82
00:03:45,120 --> 00:03:47,670
particularly the shared
pool and the buffer cache--
83
00:03:47,670 --> 00:03:50,290
are different for those
types of operations.
84
00:03:50,290 --> 00:03:51,960
So what are your options?
85
00:03:51,960 --> 00:03:54,420
Well, if you're using
manual memory management,
86
00:03:54,420 --> 00:03:56,260
you need to split
the difference.
87
00:03:56,260 --> 00:03:59,460
So you make a compromise
between the two.
88
00:03:59,460 --> 00:04:03,270
So a transactional system would
benefit from a larger shared
89
00:04:03,270 --> 00:04:06,780
pool and less from
a buffer cache.
90
00:04:06,780 --> 00:04:08,790
But a batch system
is going to need
91
00:04:08,790 --> 00:04:12,210
a lot more in the buffer cache
and less in the shared pool.
92
00:04:12,210 --> 00:04:15,930
So in manual memory management,
you have to make a compromise.
93
00:04:15,930 --> 00:04:18,540
But with automatic
shared memory management,
94
00:04:18,540 --> 00:04:19,660
you don't have to do that.
95
00:04:19,660 --> 00:04:23,190
Because during the day, Oracle
will be automatically managing
96
00:04:23,190 --> 00:04:26,910
the memory toward a
transactional system
97
00:04:26,910 --> 00:04:29,220
and at night toward
a batch system.
98
00:04:29,220 --> 00:04:30,990
So it has that flexibility.
99
00:04:30,990 --> 00:04:32,940
Although, it does have
overhead associated
100
00:04:32,940 --> 00:04:36,780
with it that can sometimes
affect performance.
101
00:04:36,780 --> 00:04:40,020
In 11g, Oracle went
one step further
102
00:04:40,020 --> 00:04:43,620
and decided to have a setting
to manage all of the memory
103
00:04:43,620 --> 00:04:44,440
together.
104
00:04:44,440 --> 00:04:48,150
And this is called AMM, or
automatic memory management.
105
00:04:48,150 --> 00:04:51,660
And so the SGA and
the PGA together
106
00:04:51,660 --> 00:04:53,960
are determined by
two parameters--
107
00:04:53,960 --> 00:04:57,390
a memory_target and
a memory_max_target.
108
00:04:57,390 --> 00:05:01,170
Oracle will manage all memory
sizing within those boundaries.
109
00:05:01,170 --> 00:05:04,740
So if we give a
MEMORY_MAX_TARGET of 2 gig
110
00:05:04,740 --> 00:05:06,810
and a MEMORY_TARGET
of some value less
111
00:05:06,810 --> 00:05:08,340
than or equal to that--
112
00:05:08,340 --> 00:05:11,730
that means Oracle has 2
gigabytes of memory to manage
113
00:05:11,730 --> 00:05:15,300
and size the SGA, and the
PGA, and all the components
114
00:05:15,300 --> 00:05:17,010
that they contain.
115
00:05:17,010 --> 00:05:19,290
So to look at this
relationship a little bit,
116
00:05:19,290 --> 00:05:21,990
we have two parameters in
Automatic Memory Management
117
00:05:21,990 --> 00:05:23,850
that can be used to define this.
118
00:05:23,850 --> 00:05:27,690
We say memory_max_target
and we set that to a value.
119
00:05:27,690 --> 00:05:30,600
memory_max_target is
not a dynamic parameter,
120
00:05:30,600 --> 00:05:33,330
it cannot be changed
while the database is up.
121
00:05:33,330 --> 00:05:35,220
If we want to change
memory_max_target,
122
00:05:35,220 --> 00:05:39,190
we have to change it in the SP
file and restart the database.
123
00:05:39,190 --> 00:05:41,730
However, memory_target
is dynamic.
124
00:05:41,730 --> 00:05:45,000
So within this boundary,
we can make memory_target
125
00:05:45,000 --> 00:05:49,920
smaller or larger, as long as we
don't exceed memory_max_target.
126
00:05:49,920 --> 00:05:53,520
And again, memory_target
is a dynamic parameter.
127
00:05:53,520 --> 00:05:56,100
So normally, what
you'll see is DBAs
128
00:05:56,100 --> 00:05:58,920
that size memory_target
to a certain value,
129
00:05:58,920 --> 00:06:01,440
and memory_max_target
to a certain value,
130
00:06:01,440 --> 00:06:04,440
and then memory_target to
a value that is less than
131
00:06:04,440 --> 00:06:06,120
or equal to that boundary.
132
00:06:06,120 --> 00:06:09,060
And that gives you the ability,
if you size it-- let's say,
133
00:06:09,060 --> 00:06:12,810
that memory_max_target is 2
gigabytes and memory_target is
134
00:06:12,810 --> 00:06:14,070
1.5--
135
00:06:14,070 --> 00:06:16,710
that gives you the ability
to grow your memory,
136
00:06:16,710 --> 00:06:18,900
should you need to do so.
137
00:06:18,900 --> 00:06:20,970
So those are the three
types of memory management
138
00:06:20,970 --> 00:06:22,620
available to us in Oracle.
139
00:06:22,620 --> 00:06:24,990
And it's up to the
DBA to choose the best
140
00:06:24,990 --> 00:06:27,670
one for his or her situation.
11366
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.