| Lesson 3 | Initialization file |
| Objective | Identify what lives in the Oracle initialization file (PFILE/SPFILE), how to manage it safely, and which parameters are legacy. |
The initialization configuration for an Oracle instance lives in either:
initORCL.ora) - edited with a text editor; changes take effect at next startup.spfileORCL.ora) - preferred; make persistent changes with ALTER SYSTEM.Parameters broadly cover:
db_name, control_files).Example snippets (legacy text PFILE style):
db_name = devl
db_files = 1024
control_files =
(/m01oracle/oradata/ORCL/control01.ctl,
/m21/oradata/ORCL/control02.ctl,
/m57/oradata/ORCL/control03.ctl)
db_block_size = 8192
-- See if the instance started with an SPFILE
SHOW PARAMETER spfile
-- Change that persists across restarts
ALTER SYSTEM SET processes = 600 SCOPE=SPFILE;
-- Change now and persist (when allowed)
ALTER SYSTEM SET session_cached_cursors = 200 SCOPE=BOTH;
-- Change for current memory only (lost on restart)
ALTER SYSTEM SET optimizer_index_cost_adj = 50 SCOPE=MEMORY;
Tip: Keep a text export for change control: CREATE PFILE='/tmp/init_backup.ora' FROM SPFILE;
SGA_TARGET/SGA_MAX_SIZE; Oracle auto-distributes buffer cache, shared pool, etc.PGA_AGGREGATE_TARGET (or MEMORY_TARGET for AMM); Oracle sizes sort/hash areas per session automatically (WORKAREA_SIZE_POLICY=AUTO).SHOW PARAMETER sga_target
SHOW PARAMETER pga_aggregate_target
SHOW PARAMETER workarea_size_policy
Use the LOG_ARCHIVE_DEST_n family and (optionally) the Fast Recovery Area (FRA).
ARCHIVE LOG LIST
SHOW PARAMETER db_recovery_file_dest
SHOW PARAMETER log_archive_dest_1
SHOW PARAMETER log_archive_min_succeed_dest
Note: LOG_ARCHIVE_DUPLEX_DEST is deprecated; define multiple LOG_ARCHIVE_DEST_n entries instead.
The original slide deck used nine short captions. Here’s the correctness status and modernized guidance:
SELECT name FROM v$database;
db_files limits the maximum datafiles for the database. It does not count control files or online redo logs. Set it a bit above current datafile count to allow growth without restart.
DB_16K_CACHE_SIZE).
DB_CACHE_SIZE). With ASMM, size is auto-tuned via SGA_TARGET.
SHARED_POOL_SIZE can be auto-managed.
SGA_TARGET). Manual settings are rarely needed.
SORT_AREA_SIZE for normal operations. Prefer automatic PGA management with PGA_AGGREGATE_TARGET (or MEMORY_TARGET) and WORKAREA_SIZE_POLICY = AUTO.
SORT_AREA_RETAINED_SIZE is legacy. With automatic PGA, workareas expand/contract automatically; manage with PGA targets/limits.SCOPE=MEMORY), but others require a restart (SCOPE=SPFILE).-- Quick health checks
SHOW PARAMETER open_cursors
SHOW PARAMETER processes
SHOW PARAMETER audit_trail
-- Persisted config snapshot
CREATE PFILE='/tmp/init_&&ORACLE_SID..ora' FROM SPFILE;
db_name, control_files, db_create_file_dest (OMF).processes, sessions, db_files (datafiles cap).sga_target/sga_max_size, pga_aggregate_target, optional memory_target/memory_max_target.workarea_size_policy=AUTO (don’t rely on the old SORT_* parameters).db_recovery_file_dest(_size), log_archive_dest_n, log_archive_min_succeed_dest.Take a safe snapshot and review key settings:
-- Snapshot SPFILE to a text PFILE for review
CREATE PFILE='/tmp/init_review.ora' FROM SPFILE;
-- Grep common items (OS shell)
# grep -E 'db_name|control_files|sga_|pga_|workarea|log_archive_dest' /tmp/init_review.ora