| Lesson 3 | Initialization changes |
| Objective | Identify changes to initialization parameters. |
In Oracle 23c the database is multitenant by default: a Container Database (CDB) hosts one or more Pluggable Databases (PDBs). Initialization parameters therefore have scope (CDB or PDB) and persistence (memory and/or server parameter file). This lesson shows how to view, change, and govern parameters safely in modern environments.
SPFILE for persistent, centralized configuration. A PFILE is static text, typically used only to bootstrap an SPFILE.ALTER SYSTEM/ALTER SESSION at runtime. Static parameters require a restart of the affected container.SCOPE=MEMORY, SCOPE=SPFILE, or SCOPE=BOTH control whether a change is immediate, persistent on next restart, or both.Use data dictionary views to see the effective and inherited values.
-- From CDB$ROOT to see container-aware values
SELECT name, value, isses_modifiable, issys_modifiable, con_id
FROM v$system_parameter
ORDER BY name;
-- From within a PDB to see its effective values
SHOW parameter pga_aggregate_target;
-- List parameters that can be set at PDB level
SELECT name FROM v$parameter WHERE pdb_modifiable = 'TRUE' ORDER BY name;
CDB-level settings are inherited by PDBs unless overridden. Use CONTAINER=ALL in the root to apply to all open PDBs (for dynamic parameters that support it).
-- In CDB$ROOT (dynamic param, immediate and persistent)
ALTER SYSTEM SET pga_aggregate_target = 8G SCOPE=BOTH;
-- Apply a dynamic parameter to all currently open PDBs
ALTER SYSTEM SET optimizer_adaptive_features = TRUE
CONTAINER=ALL SCOPE=BOTH;
-- Persist only (effective after restart)
ALTER SYSTEM SET processes = 2000 SCOPE=SPFILE;
For parameters marked PDB_MODIFIABLE=TRUE, connect to the target PDB and set the value there. The PDB value overrides the root value for that PDB only.
-- Connect to the PDB and override a PDB-modifiable parameter
ALTER SESSION SET container = salespdb;
ALTER SYSTEM SET pga_aggregate_target = 2G SCOPE=BOTH;
-- Revert to inheritance by resetting in the PDB
ALTER SYSTEM RESET pga_aggregate_target SCOPE=BOTH;
Use ALTER SESSION for temporary tuning or controlled testing without changing system-wide configuration.
ALTER SESSION SET sql_trace = TRUE;
ALTER SESSION SET optimizer_mode = FIRST_ROWS_10;
pga_aggregate_target, sga_target) instead of many discrete memory knobs. Consider Auto Memory when appropriate.DBMS_STATS) and adaptive features unless you have a baseline/SQL Plan Management requirement.ALTER SESSION or in a non-prod PDB. Validate with AWR/ASH/SQL Monitor where applicable.SCOPE=BOTH for immediate + persistent where safe; otherwise SCOPE=SPFILE and schedule a restart.SPFILE and ALTER SYSTEM operations.-- See pending (SPFILE) vs in-memory differences
SELECT name, value, isdefault, isspecified, con_id
FROM v$system_parameter
WHERE name IN ('pga_aggregate_target','sga_target')
ORDER BY con_id, name;
-- Identify who changed what (if auditing enabled)
SELECT * FROM dba_audit_trail WHERE obj_name = 'SYSTEM_PARAMETER' ORDER BY timestamp DESC;
-- Show effective optimizer features (example)
SELECT name, value FROM v$parameter WHERE name LIKE 'optimizer%';
Modern parameter management is about scope, safety, and repeatability. Use CDB inheritance for baseline behavior, apply PDB overrides sparingly, and capture every change in versioned automation to keep fleets consistent.
Next lesson: OCI Database Configuration Tools - how the Console, CLI, and APIs streamline common post-provision steps compared to legacy DBCA-only workflows.