Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Anadi.

Asked: August 23, 2016 - 12:08 pm UTC

Last updated: September 08, 2023 - 7:16 am UTC

Version: 12c

Viewed 10K+ times! This question is

You Asked

Hello Tom,

I have very silly question for an experience person in oracle. but i am totally confused. please help

As per my knowledge, memory_target is the parameter which oracle use to tune sga and pga components. and Memory_max_target is the parameter which is the max limit for the memory_target that can be tune dynamically by a dba. right?

question is, Do oracle also automatically and dynamically increase the component as per the Memory_max_target. for ex. if Memory_max_target=4G and Memory_target=2G, will oracle itself increase the SGA components upto 4G as per Memory_max_target when needed or not?

Also, if we have to increase the memory settings, say 5G, will increasing only Memory_max_target work or we have to set Memory_target too?

Regards,
Anadi

and Connor said...

This is perhaps more about *when* you are allowed to change these values.

memory_max_target says:

"No matter what the situation is, I want to guarantee (as best possible) to the Operating System that my Oracle instance is not going to consume more than this much memory"

So I might set that to (say) 30G on a box with (say) 48G RAM. Once it is set...I *cannot* change it, without restarting the instance.

memory_target says:

"I will try to keep my SGA and PGA limited to this setting, but if you need to, you can change it *without* restarting the instance, to any value *up to* memory_max_target".

In my experience, on most platforms, at amount of memory specified by "memory_max_target" becomes either locked down to only be accessible by Oracle, or is allocated by the OS anyway, so it is rare to see them differing in value. After all, if mem_tgt is 20G and mem_max is 30G, I struggle to see why I would "keep in reserve" that 10G..I may as well use it.

Also, google for "memory_target" and "huge pages"...It might be relevant to your platform.

Rating

  (4 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Question remain's

Anadi Ameta, August 24, 2016 - 4:20 am UTC

Hi McDonald,

Thanks for reply.

But, my question still remains. Whether Oracle automatically tune SGA/PGA as per the Memory_max_target if it's needed to exceed from memory_target or not?

If Memory_max_target is 30G and Memory_target is 20G, if needed, will oracle go beyond 20G upto 30G by it's on or DBA have to increase memory by using "alter system set memory_target=30G"

Connor McDonald
August 24, 2016 - 6:19 am UTC

No....we will not go past 20G. memory_target is what we try to stay under.

Please clarify

Anadi Ameta, August 24, 2016 - 6:24 am UTC

so that means, if it's needed, say 25G, only DBA can increase it. until that oracle will use pre specified 20G only. Right?
Connor McDonald
August 25, 2016 - 3:14 am UTC

Yup.

for memory movement

Markus, August 24, 2016 - 10:15 am UTC

In my experience, on most platforms, at amount of memory specified by "memory_max_target" becomes either locked down to only be accessible by Oracle, or is allocated by the OS anyway, so it is rare to see them differing in value. After all, if mem_tgt is 20G and mem_max is 30G, I struggle to see why I would "keep in reserve" that 10G..I may as well use it. 



memory between memory_target and memory_max_target will be reserved in the paging area but never paged in as long as it is not used by oracle processes. we can move memory between instances that way without restart, .e.g.

before: real memory 10G, instance 1: memory_target 5G, memory_max_target 7G, instance 2: memory_target 5G, memory_max_target 7G
after: real memory 10G, instance 1: memory_target 7G, memory_max_target 7G, instance 2: memory_target 3G, memory_max_target 7G


Connor McDonald
August 25, 2016 - 2:51 am UTC

THanks Markus - I was unware we could shift it between instances.

MEMORY_TARGET and MEMORY_MAX_TARGET

MEYO Romuald Blaise, September 07, 2023 - 7:18 pm UTC

Good evening everyone, our developer has changed the parameters of MEMORY_TARGET and MEMORY_MAX_TARGET in order to increase the execution speed of our oracle database by passing the values to 8G, but after verification we have:
NAME TYPE VALUE
------------------------------------ -------------- ---------------------------
sga_target big integer 7808M
SQL> show parameter sga_max_size;

NAME TYPE VALUE
------------------------------------ -------------- ---------------------------
sga_max_size big integer 7808M
SQL> show parameter pga_aggregate_target;

NAME TYPE VALUE
------------------------------------ -------------- ---------------------------
pga_aggregate_target big integer 2600M
SQL> show parameter pga_aggregate_limit;

NAME TYPE VALUE
------------------------------------ -------------- ---------------------------
pga_aggregate_limit big integer 5200M
SQL> Show parameter memory_target;

NAME TYPE VALUE
------------------------------------ -------------- ---------------------------
memory_target big integer 0
SQL> show parameter memory_max_target;

NAME TYPE VALUE
------------------------------------ -------------- ---------------------------
memory_max_target big integer 0
SQL>
My question is whether the values obtained are normal because after restarting the server the BD no longer runs but as it is a VM under hyper-V I restored from a checkpoint and everything has started again but I'm afraid to restart the server to avoid crashing again.
Connor McDonald
September 08, 2023 - 7:16 am UTC

The video below is 5 years old but still relevant...namely, you don't want to use memory_target

So issue an "alter system reset" on the memory_target params and stick with sga/pga target