// oracle · memory

sga_target

Total SGA size under Automatic Shared Memory Management; Oracle divides it among buffer cache, shared pool and other pools.

По умолчанию
0
Range
0, or up to sga_max_size
Restart needed
Нет
Default checked on
Oracle AI Database 26ai / 23ai

Что оно делает

Values set for db_cache_size, shared_pool_size and similar become minimums. It can be changed online up to sga_max_size. Set inside a PDB, it limits that PDB's share of the SGA and must be smaller than the root's sga_target (ORA-56747).

Значение по умолчанию

0. 0 when not set (Oracle 23ai/26ai); DBCA sets it at creation. Oracle Free caps the instance at 2GB of RAM and has 1.5GB in CDB$ROOT.

Check the current value

SHOW PARAMETER sga_target

SELECT name, value, isdefault, issys_modifiable, isses_modifiable, ispdb_modifiable
FROM v$parameter
WHERE name = 'sga_target';

Change it

ALTER SYSTEM SET sga_target = 8G SCOPE=BOTH;

No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).

When to change it

When the buffer cache advisory (V$DB_CACHE_ADVICE) or V$SGA_TARGET_ADVICE shows a larger SGA would cut physical reads.

What can go wrong

Above sga_max_size the change needs a restart; too large leaves the OS and PGA short.

The closest setting on other engines

ДвижокНастройкаПо умолчаниюRestart
Oracle sga_target this page 0 Нет
PostgreSQL shared_buffers 128MB Да
MySQL innodb_buffer_pool_size 128MB Нет
SQL Server max server memory (MB) 2147483647 Нет
SQLite cache_size -2000 (about 2MB) Нет

Questions about sga_target

What is the default value of sga_target in Oracle?

0. 0 when not set (Oracle 23ai/26ai); DBCA sets it at creation. Oracle Free caps the instance at 2GB of RAM and has 1.5GB in CDB$ROOT.

Does changing sga_target require a restart?

No. No restart: ALTER SYSTEM with SCOPE=BOTH applies immediately and is saved in the SPFILE. It can be set inside a PDB (ISPDB_MODIFIABLE = TRUE).

When should I change sga_target?

When the buffer cache advisory (V$DB_CACHE_ADVICE) or V$SGA_TARGET_ADVICE shows a larger SGA would cut physical reads.

Back to all Oracle settings, or check the Oracle manual for every option.

// one client for every engine

Check sga_target on your own server

SQLly runs the query above against Oracle and the other engines in this reference, from one desktop app on macOS, Windows and Linux.