# Oracle Database 19c SGA, PGA and HugePages Sizing Calculator for ERP

> Source: https://netray.co/tools/oracle-database-19c-sga-pga-memory-sizing-calculator
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Split server RAM into SGA and PGA for an Oracle 19c ERP database on Linux, see the default PGA_AGGREGATE_LIMIT and get the HugePages count.

## Category

oracle

## Erp

Oracle Database

## Audience

- Oracle DBA
- ERP administrator
- Linux administrator

## Tool

**Kind:** calculator

**Inputs:**

#### Server RAM

**Key:** ram

**Type:** number

**Default:** 256

**Min:** 8

**Step:** 8

**Unit:** GB

**Help:** Physical memory on the database server.

#### OS and other software reserve

**Key:** reserve_pct

**Type:** number

**Default:** 10

**Min:** 0

**Max:** 50

**Step:** 1

**Unit:** %

**Help:** Kept for the OS, page cache, agents and backup software. Never less than 4 GB.

#### Share of remaining memory for this instance

**Key:** share

**Type:** slider

**Default:** 100

**Min:** 10

**Max:** 100

**Step:** 5

**Unit:** %

**Help:** Lower this if several instances share the server.

#### SGA share of instance memory

**Key:** sga_share

**Type:** select

**Default:** 0.7

**Options:**

##### 60% (mixed OLTP and heavy batch)

**Value:** 0.6

##### 70% (typical ERP OLTP)

**Value:** 0.7

##### 80% (OLTP, light sorting)

**Value:** 0.8

##### 50% (reporting and large sorts)

**Value:** 0.5

#### PROCESSES parameter

**Key:** processes

**Type:** number

**Default:** 1500

**Min:** 100

**Step:** 50

**Help:** The init parameter, not the current session count.

#### Average PGA per process

**Key:** pga_per

**Type:** number

**Default:** 5

**Min:** 1

**Step:** 1

**Unit:** MB

**Help:** Measure with V$PROCESS.PGA_ALLOC_MEM averages at peak; 5 MB is a starting assumption.

#### Instance type

**Key:** rac

**Type:** select

**Default:** 0

**Options:**

##### Single instance

**Value:** 0

##### Oracle RAC instance

**Value:** 1

**Outputs:**

#### Reserve for OS and other software (GB)

**Key:** reserve

**Expr:** max(4, ram * reserve_pct / 100)

**Format:** decimal

#### Memory for this instance (GB)

**Key:** db_mem

**Expr:** max(0, ram - reserve) * share / 100

**Format:** decimal

#### SGA_TARGET (GB)

**Key:** sga

**Expr:** db_mem * sga_share

**Format:** decimal

**Primary:** true

**Description:** Set SGA_TARGET (and SGA_MAX_SIZE) to this with ASMM; leave MEMORY_TARGET unset.

#### PGA_AGGREGATE_TARGET (GB)

**Key:** pga_target

**Expr:** db_mem - sga

**Format:** decimal

**Primary:** true

#### Default PGA_AGGREGATE_LIMIT (GB)

**Key:** pga_limit

**Expr:** max(2, max(2 * pga_target, if(eq(rac, 1), 5, 3) * processes / 1024))

**Format:** decimal

**Description:** Oracle default when MEMORY_TARGET is unset: 200% of PGA_AGGREGATE_TARGET, but at least 2 GB and at least 3 MB x PROCESSES (5 MB x PROCESSES for RAC).

#### Expected PGA use at PROCESSES (GB)

**Key:** expected_pga

**Expr:** processes * pga_per / 1024

**Format:** decimal

#### HugePages needed (2 MB pages)

**Key:** hugepages

**Expr:** ceil(sga * 1024 / 2)

**Format:** integer

**Description:** Minimum vm.nr_hugepages for this SGA. Add a few pages of headroom and sum across all instances on the host.

#### PGA warning (1 = expected PGA exceeds target)

**Key:** pga_warn

**Expr:** if(gt(expected_pga, pga_target), 1, 0)

**Format:** integer

**Chart:**

#### Default PGA_AGGREGATE_LIMIT and expected PGA vs PROCESSES

**Type:** line

**X:** processes

**From:** 200

**To:** 6000

**Steps:** 30

**Series:**

- pga_limit
- expected_pga

**Disclaimer:** A starting split, not a substitute for advisor data. Validate with V$SGA_TARGET_ADVICE, V$PGA_TARGET_ADVICE and AWR after a representative workload, and check the HugePages count with Oracle's hugepages_settings.sh script once the instance is running.

## Content

**Intro:** This calculator splits server memory into SGA and PGA for an Oracle Database 19c instance on Linux running an ERP such as JD Edwards, E-Business Suite or PeopleSoft. It also shows the default PGA_AGGREGATE_LIMIT Oracle will apply and the number of 2 MB HugePages the SGA needs.

**Sections:**

#### How to use it

**Body:** Enter the physical RAM, how much to keep back for the OS and other software, and what share of the rest belongs to this instance. Pick an SGA share: 70% suits most ERP OLTP databases, while batch heavy or reporting databases with large sorts and hash joins need more PGA. Enter the PROCESSES init parameter and a realistic average PGA per process. The calculator returns SGA_TARGET, PGA_AGGREGATE_TARGET, the default PGA_AGGREGATE_LIMIT, the expected PGA at full PROCESSES and the HugePages count. If the warning output shows 1, either PROCESSES is far higher than needed or PGA_AGGREGATE_TARGET is too small for the connection count.

**Bullets:**

- Reserve = max(4 GB, RAM x reserve %).
- Instance memory = (RAM - reserve) x share.
- SGA_TARGET = instance memory x SGA share; PGA_AGGREGATE_TARGET = the rest.
- HugePages = ceil(SGA in MB / 2).

#### The PGA_AGGREGATE_LIMIT default rule

**Body:** In 19c, when MEMORY_TARGET is not set, PGA_AGGREGATE_LIMIT defaults to 200% of PGA_AGGREGATE_TARGET, but never less than 2 GB and never less than 3 MB times PROCESSES (5 MB times PROCESSES for a RAC instance). If MEMORY_TARGET is set, the default is MEMORY_MAX_TARGET. When the limit is reached, Oracle terminates the calls or sessions using the most untunable PGA, so ERP batch jobs can fail with ORA-04036. With a high PROCESSES value the 3 MB rule can push the default limit well above what the server can supply, which the chart shows as PROCESSES grows. Set the limit explicitly if the default is unrealistic for your RAM.

#### HugePages and AMM on Linux

**Body:** Automatic Memory Management (MEMORY_TARGET) is not compatible with Linux HugePages, so use Automatic Shared Memory Management: set SGA_TARGET and PGA_AGGREGATE_TARGET and leave MEMORY_TARGET and MEMORY_MAX_TARGET unset. Configure vm.nr_hugepages in /etc/sysctl.conf, raise the memlock limit for the oracle user in /etc/security/limits.conf, and consider USE_LARGE_PAGES=ONLY so the instance refuses to start rather than silently using small pages. Oracle also recommends disabling Transparent HugePages for database servers. Check the alert log at startup: it reports how much of the SGA was allocated in large pages.

#### Worked example and how to check it

**Body:** A 256 GB server with a 10% reserve leaves 230.4 GB for one instance. At 70% SGA that is about 161 GB SGA_TARGET and 69 GB PGA_AGGREGATE_TARGET. With PROCESSES=1500 the default limit is max(2, 138, 4.4) = about 138 GB, which is more than the server can give, so set PGA_AGGREGATE_LIMIT explicitly, for example near 1.2 to 1.5 times the target. HugePages needed: 82,576. After a week of real load, query V$SGA_TARGET_ADVICE and V$PGA_TARGET_ADVICE: if ESTD_DB_TIME in the SGA advice drops for a larger size, or ESTD_OVERALLOC_COUNT in the PGA advice is above zero at the current target, move memory accordingly.

**Cta:** If you want your DBAs to ask the database and AWR these questions in plain English on your own servers, we can set up a private AI layer for that.

**Faq:**

#### What is the default PGA_AGGREGATE_LIMIT in Oracle 19c?

**Answer:** Without MEMORY_TARGET, it is 200% of PGA_AGGREGATE_TARGET, with a floor of 2 GB and a floor of 3 MB times PROCESSES (5 MB times PROCESSES on RAC). If PGA_AGGREGATE_TARGET is explicitly 0 it is 90% of physical memory minus the SGA. With MEMORY_TARGET set it equals MEMORY_MAX_TARGET.

#### Should I use MEMORY_TARGET for an ERP database on Linux?

**Answer:** Usually not. MEMORY_TARGET (AMM) cannot use HugePages on Linux, and an ERP database with a large SGA benefits from HugePages through lower page table overhead and no SGA swapping. Use ASMM with SGA_TARGET and PGA_AGGREGATE_TARGET instead, and size from advisor views after a real workload.

#### How do I calculate the number of HugePages for Oracle?

**Answer:** Divide the total SGA of all instances on the host, in MB, by the HugePage size (normally 2 MB, check Hugepagesize in /proc/meminfo) and round up, then add a little headroom. Oracle's hugepages_settings.sh script calculates it from the running instances' shared memory segments, which is the safest final check.

#### How much memory should I leave for the operating system?

**Answer:** A common practice is around 10% of RAM with a minimum of a few GB, more if backup agents, monitoring or ERP application tiers share the server. Watch free memory and swap activity with vmstat or sar after go live; any regular swapping means the reserve or the PGA is too small.

## Search terms

oracle database 19c administration, oracle database performance tuning guide, oracle database 19c architecture, oracle database 19c linux, oracle 19c sga pga sizing, pga_aggregate_limit default 19c, oracle hugepages calculation, sga_target pga_aggregate_target calculator

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
