Monday, March 05, 2007

Automatic Memory Management in Oracle 11g

Since quite a few days I had the chance to look at parts of the beta documentation for the Oracle 11g database and since a few days I also have the beta software.

One of the new features coming up is the enhencement of automatic memory management.

The whole automatic memory thing had already started with the release Oracle 9i where the parameter SGA_MAX_SIZE was introduced, to limit the maximum memory Oracle can use for the SGA. Within SGA_MAX_SIZE a number of caches were dynamically, but still manually adjustable. These caches included the
DB BUFFER CACHE, the
SHARED POOL, the
JAVA POOL and the
LARGE POOL.

In those days the DBA had to check statistics in v$views in order to find out if the caches needed manual adjustment.

Starting with Oracle 10gR1 the new parameter SGA_TARGET was introduced which allowed us to limit the amount of SGA_MAX_SIZE which can be used by Oracle.
If you set SGA_TARGET to a value other than 0 (zero) then Automatic Shared Memory Management (ASMM) is enbaled in 10g. This meens that we allow Oracle to adjust these caches as the workload needs it. We can increase this value dynamically, but manually by adjusting SGA_TARGET up to SGA_MAX_SIZE. In most cases it does not make sense to set SGA_TARGET to a value different from SGA_MAX_SIZE. This is only for systems like a SUN FIRE which allow the dynamic reconfiguration of the server (adding memory boards while the server is running).
Within SGA_TARGET a number of caches are autotuned, including the
DB BUFFER CACHE, the
SHARED POOL, the
JAVA POOL, the
LARGE POOL and starting from 10gR2 also the new in 10gR1
STREAMS POOL.
At startup time SGA_TARGET is allocated and first of all the non dynamically adjustable caches get their catch. Afterwards the others, the automatically tunable caches get their share.
SGA_MAX_SIZE is reserved for ORACLE at startup time, but as long as it is not touched it is not used.
As of Oracle 11g we will have one parameter which we can use to allow Oracle not only to adjust these five caches in the SGA but also we allow Oracle to shrink and grow the entire SGA memory in order to hand over memory to the PGAs (process memory) and vice versa.
This parameter is called MEMORY_TARGET. With this we can specify how much memory we want to allow ORACLE to use all over, including SGA and PGAs.
MEMORY_TARGET is a dynamic parameter and can be changed with an ALTER SYSTEM SET... statement. It can be adjusted up to the value of MEMORY_MAX_TARGET. Now we do not only have Automatic Shared Memory Mamangement but Automatic Memory Management (system memory plus process memory).
Here is what the reference says:
MEMORY_TARGET specifies the Oracle system-wide usable memory. The database tunes memory to the the MEMORY_TARGET value, reducing or enlarging the SGA and PGA as needed. In a text initialization parameter file, if you omit the line for MEMORY_MAX_TARGET and include a value for MEMORY_TARGET, the database automatically sets MEMORY_MAX_TARGET to the value of MEMORY_TARGET. If you omit the line for MEMORY_TARGET and include a value for MEMORY_MAX_TARGET, the MEMORY_TARGET parameter defaults to zero. After startup, you can then dynamically change MEMORY_TARGET to a non-zero value, provided that it does not exceed the value of MEMORY_MAX_TARGET.

This is a feature we had expected to come up since a long time and I hope that it will work fine for at least most of the systems.
But I would suggest to first test it thoroughly before using it in production because all these new features which have AUTOMATIC in their names can have their issues at least in the first releases. And this is why they never are the default right away.

4 Comments:

At Mon Mar 05, 09:31:00 AM, Blogger HP Fuchs said...

Interesting post, thank you. I hope you will do a series of posts about 11g new features on your blog.

Here is a list of some of the other 481 promised new features :-)

 
At Tue Mar 06, 12:38:00 PM, Blogger henrikruenger said...

Great,everytime it is interesting to read your blog. One of my favorites. Thanks very much.

We'll have to talk in future so that I can invite you to one of the DOAG www.doag.org meetings.

Hope to see you there soon,

Henrik

 
At Tue Mar 06, 04:48:00 PM, Blogger lutz_hartmann said...

Hi, thanks for the nice feedback.
Spread the news and keep on reading.
I'll keep on blogging, after have gone through the first heave obsacles with my new company.
Now I feel that I have the time to get back to blogging more frequently again.
=;-)

 
At Thu Mar 08, 07:37:00 AM, Blogger lutz_hartmann said...

Hi Henrikrueger,
definitely!
I have just offered a speach about 11g to the Swiss Oracle User Group for March and they rejected because they already will have Guenther Stuerner in September or so.

I would love to come. Pls contact me by email.

By the way,
I have moved my blog to http://sysdba.wordpress.com
yesterday
=;-)

 

Post a Comment

<< Home