Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reduce Memory Usage from 16GB to 8GB - Oracle

Tags:

oracle

I had created a oracle instance using "Database Configuration Assistant". My system is having 64GB RAM. I had given 16GB to oracle instance, in Initialization Parameters Wizard.

Now i want to reduce that 16GB to 8GB. So that, the RAM occupied by oracle will be 8GB. I had tried this in SQL Developer,

ALTER SYSTEM SET pga_aggregate_target = 8289 M;
ALTER SYSTEM SET sga_target = 1536 M;

I had restarted the oracle service. It not got reflected. Still the oracle is using 16GB.

I dont know whether this is correct. Whether system reboot is needed for this.? or else how to reduce the memory usage.

like image 735
RobinHood Avatar asked Dec 05 '13 08:12

RobinHood


People also ask

How do I change allocated memory in Oracle?

You can allocate MEMORY_TARGET parameter and oracle will handle both SGA + PGA. You do not even need to set SGA_TARGET or SGA_MAX_SIZE. Let us assume we have 16 GB RAM on a server and we want to allocate 5 GB to Oracle. This can be simple done by setting MEMORY_TARGET to 5 GB.

What percentage of RAM should Oracle SGA be set?

from 95%RAM 80% should be for SGA and 20% for PGA.

How much RAM is occupied by Oracle?

So that, the RAM occupied by oracle will be 8GB. I had tried this in SQL Developer, I had restarted the oracle service. It not got reflected. Still the oracle is using 16GB. I dont know whether this is correct. Whether system reboot is needed for this.? or else how to reduce the memory usage. Show activity on this post.

How to manage memory in Oracle Database?

Oracle Database supports various memory management methods, which are chosen by initialization parameter settings. Oracle recommends that you enable the method known as automatic memory management. Oracle Database can manage the SGA memory and instance PGA memory completely automatically.

How do I limit PGA memory usage in Oracle Database?

Therefore, Oracle Database tries to limit PGA memory usage to the target, but usage can exceed the setting at times. To specify a hard limit on PGA memory usage, use the PGA_AGGREGATE_LIMIT initialization parameter. Oracle Database ensures that the PGA size does not exceed this limit.

How can I reduce RAM consumption without affecting performance?

I want to reduce excessive RAM consumption without affecting its speed and performance. I have 4GB RAM. Go to settings, graphic settings, and choose the app you use most click on them and choose the performance options. Then go to search and scroll to the bottom and choose respect these settings.


1 Answers

There are various ways to define the amount of memory used. Historically, you needed a lot of settings to change to impact total memory footprint. Nowadays, it is often by default setting only one and start tweaking later (when the Oracle installer does not screw up; it often sets things wrongly).

I would check the following:

select *
from   v$parameter
where  name like '%size%' 
       or 
       name like '%target%'

Check which ones have been set and need changing. It can be settingslike shared_pool_size, memory_target, sga_target, and others.

When you change it, some settings (depends on version and edition) can be changed while the instance is open and running, while some require a restart. Also, sometimes you are using a text file (pfile) and in some instance you may be using a binary file (spfile). Binary file is pre-condition to allow online changing without restarting.

You will probably succeed using something like:

alter system set NAME = VALUE scope=[spfile|both]

as sys user. Scope=spfile only changes the spfile, both changes runtime and spfile. When using a pfile like init*.ora, you just edit the text file and restart your instance.

To quickly restart, the best way is IMHO:

startup force

Please decreasing size, you will generally not have a problem assuming that the size is sufficient to handle the load. Do it in a test environment first. When increasing and depending on platform, please make sure first that your new settings can be handled. For instance, increasing memory allocated on Linux may require you to change kernel settings. Otherwise, your Oracle instance will not start unless the corrections are made first.

like image 164
Guido Leenders Avatar answered May 14 '23 16:05

Guido Leenders