Sunday, 29 November 2026

Oracle RAC Startup Sequence: From Boot to Service Ready

After a RAC server reboot, seeing the operating system back online does not mean the database is ready for application traffic. Oracle Clusterware still has to rebuild the node's cluster membership, access shared storage, start and monitor resources, bring database instances online, register services, and restore client connectivity.

A sequence such as OS → OHASD → CSSD → CRSD → ASM → Listener → Database → Services is useful for remembering the major components, but it should not be treated as a rigid startup script. RAC startup is better understood as a dependency-driven recovery process where Clusterware determines which resources can start, which must wait, and which can progress in parallel.



When ORA-04036 Is Not Caused by Application SQL: Tracing PGA Growth to the Optimizer Statistics Advisor

The alert appeared during a maintenance window: ORA-04036: PGA memory used by the instance exceeds PGA_AGGREGATE_LIMIT. Application activity was low, no large reporting batch was running, and the usual PGA consumers such as parallel queries, hash joins, sorts, and PL/SQL collections did not explain the increase.

One Oracle process was still growing. Its module pointed to DBMS_SCHEDULER, and the action belonged to Oracle's automatic optimizer statistics framework. The incident trace later placed the failing allocation inside the Optimizer Statistics Advisor, around the AvoidOutOfRange rule.

This is where a routine ORA-04036 investigation can go in the wrong direction. Increasing the PGA limit may stop the immediate alert, but it can also give a runaway internal task more room to consume memory. The safer approach is to identify the process, separate SQL workarea usage from private memory, correlate the event with automatic maintenance, and preserve the trace before changing anything.


Why This Matters in Production

A quiet application workload does not mean the database is quiet. Maintenance windows often bring statistics collection, advisors, backups, segment work, and application housekeeping together. A system that has plenty of headroom during business hours can come under pressure when these activities overlap.

There is another complication. Oracle automatic tasks can execute through job queue processes. Most SYS and background processes are protected from the normal PGA_AGGREGATE_LIMIT enforcement actions, but job queue processes are an explicit exception. An Oracle-maintained activity can therefore have its call or session terminated when it becomes a major untunable PGA consumer.

The error tells us that Oracle enforced the memory boundary. It does not tell us why the memory grew.


PGA Target and PGA Limit Are Not the Same

PGA_AGGREGATE_TARGET guides automatic workarea sizing for operations such as sorts, hash joins, and bitmap processing. It is a target, not a guarantee that total PGA will remain below the configured value.

PGA_AGGREGATE_LIMIT is the instance-level guardrail. When the limit is crossed, Oracle first terminates calls from sessions using the most untunable PGA. If the instance remains above the limit, Oracle can terminate those sessions. Parallel query processes are treated as one unit for this enforcement.

This distinction changes the troubleshooting path. If SQL workareas account for most of the memory, SQL tuning, parallelism, and concurrency are likely relevant. If workarea usage is modest while one process has a large and growing private allocation, the investigation must move toward PL/SQL, Java, internal metadata structures, or an Oracle maintenance task.


Start With Process Attribution

Do not begin by changing a parameter. Capture the parameter values, the percentage of the limit already consumed, the largest Oracle processes, and active SQL workareas. On RAC, use the global views so that a consumer on another instance is not missed.

SELECT inst_id, name, display_value
FROM   gv$parameter
WHERE  name IN ('pga_aggregate_target', 'pga_aggregate_limit')
ORDER BY inst_id, name;

WITH pga AS ( SELECT inst_id, MAX(CASE WHEN name = 'total PGA allocated' THEN value END) allocated, MAX(CASE WHEN name = 'total PGA inuse' THEN value END) inuse, MAX(CASE WHEN name = 'maximum PGA allocated' THEN value END) max_allocated, MAX(CASE WHEN name = 'total PGA used for auto workareas' THEN value END) auto_workarea FROM   gv$pgastat GROUP BY inst_id
+),
+lim AS (

* SELECT inst_id, TO_NUMBER(value) limit_bytes
* FROM   gv$parameter
* WHERE  name = 'pga_aggregate_limit'
  +)
  +SELECT p.inst_id,

    ROUND(p.allocated / 1024 / 1024) allocated_mb,
    ROUND(p.inuse / 1024 / 1024) inuse_mb,
    ROUND(p.max_allocated / 1024 / 1024) max_allocated_mb,
    ROUND(p.auto_workarea / 1024 / 1024) auto_workarea_mb,
    ROUND(l.limit_bytes / 1024 / 1024) limit_mb,
    ROUND(100 * p.allocated / NULLIF(l.limit_bytes, 0), 1) limit_used_pct


FROM   pga p
JOIN   lim l ON l.inst_id = p.inst_id
ORDER BY p.inst_id;

SELECT *
FROM (

SELECT p.inst_id, p.spid, s.sid, s.serial#,
      NVL(s.username, '(background)') username,
      s.program, s.module, s.action, s.sql_id,
      ROUND(p.pga_used_mem / 1024 / 1024) used_mb,
      ROUND(p.pga_alloc_mem / 1024 / 1024) alloc_mb,
      ROUND(p.pga_freeable_mem / 1024 / 1024) freeable_mb,
      ROUND(p.pga_max_mem / 1024 / 1024) max_mb
 FROM   gv$process p
 LEFT JOIN gv$session s
      ON s.inst_id = p.inst_id
     AND s.paddr = p.addr
 ORDER BY p.pga_alloc_mem DESC
  WHERE ROWNUM <= 20;

SELECT inst_id, sid, sql_id, operation_type,

    ROUND(actual_mem_used / 1024 / 1024) actual_mb,
    ROUND(max_mem_used / 1024 / 1024) max_mb,
    ROUND(tempseg_size / 1024 / 1024) temp_mb,
    number_passes
FROM   gv$sql_workarea_active
ORDER BY actual_mem_used DESC;
+


A single snapshot is not enough. Record the same values again after one or two minutes. The growth rate often tells more than the current allocation. A large but stable process may be less urgent than a scheduler slave adding hundreds of megabytes during each sample.

A useful clue is the relationship between total PGA and auto-workarea memory. If total PGA allocated is high but total PGA used for auto workareas remains low, do not spend the first hour tuning sorts that are not responsible for the pressure.


When the Statistics Advisor Becomes the Suspect

The Optimizer Statistics Advisor does not gather a fresh set of statistics. It reviews statistics collection practices and the quality of existing statistics, then stores findings and recommendations. Oracle runs the predefined AUTO_STATS_ADVISOR_TASK once per day in a maintenance window as part of the automatic optimizer statistics collection client.


This distinction matters when choosing a workaround. Disabling the complete auto optimizer stats collection client also interrupts normal automatic statistics gathering. That can solve tonight's memory problem and create next week's plan-stability problem.


Build a timeline using the running scheduler jobs, automatic statistics executions, advisor executions, and finding volume:


+
SELECT client_name, status
FROM   dba_autotask_client
WHERE  client_name = 'auto optimizer stats collection';

SELECT owner, job_name, session_id, running_instance, elapsed_time
FROM   dba_scheduler_running_jobs
ORDER BY elapsed_time DESC;

SELECT opid, origin, status, start_time, end_time,
    completed, failed, timed_out, in_progress

FROM   dba_auto_stat_executions
ORDER BY start_time DESC
FETCH FIRST 30 ROWS ONLY;

SELECT task_name, execution_name, status,

    execution_start, execution_end, error_message


FROM   dba_advisor_executions
WHERE  task_name = 'AUTO_STATS_ADVISOR_TASK'
ORDER BY execution_start DESC
FETCH FIRST 30 ROWS ONLY;

SELECT execution_name, type, COUNT(*) finding_count
FROM   dba_advisor_findings
WHERE  task_name = 'AUTO_STATS_ADVISOR_TASK'
GROUP BY execution_name, type
ORDER BY finding_count DESC;

SELECT DBMS_STATS.REPORT_ADVISOR_TASK(
      'AUTO_STATS_ADVISOR_TASK',
      NULL,

      'TEXT',
      'ALL',
      'ALL'
    ) report

FROM dual;
+

View availability and columns vary across releases. Test the script on the database version you support. A scheduler action alone is only circumstantial evidence. A matching advisor execution, rising process PGA, and a trace from the same interval create a much stronger case.


Read the Trace Without Overclaiming


The alert log tells you that the memory boundary was crossed. The process trace shows what Oracle was doing near the failing allocation. Locate the trace directory and default trace file first:


+
SELECT name, value
FROM   v$diag_info
WHERE  name IN ('Diag Trace', 'Default Trace File');

-- Run from the relevant trace directory on the database host
grep -nE 'ORA-04036|ORA$AT_OS_OPT|qosadv|Just allocated' *.trc
+

In the production case behind this article, the trace recorded a 33,554,432-byte allocation, exactly 32 MB, immediately before Oracle prepared for a PGA limit error. The short stack included functions associated with generating an AvoidOutOfRange finding and creating an internal advisor object.


That is strong evidence for this incident, but it should not be turned into a universal rule. One captured 32 MB allocation does not prove that every heap extension was 32 MB. The conclusion becomes stronger only when repeated process samples or multiple trace entries show the same staircase pattern.


The qosadv* function names are undocumented implementation details and can change between Release Updates. Use them to support an Oracle Service Request, not as a stable interface or a shortcut to a final diagnosis.



Why AvoidOutOfRange Can Become Expensive

Column statistics store low and high values that help the optimizer estimate selectivity. After a bulk load or continuous insertion into a growing key, new values may sit outside the recorded range. For example, the stored high value may be 500000 while newly inserted rows already contain values above 700000.


The AvoidOutOfRange rule checks statistics practices that can leave the optimizer exposed to this estimation problem. The rule is useful. The risk is the amount of metadata it may need to evaluate in a large database.


The following conditions deserve review, but none of them should be declared the cause until evidence confirms it:


  • Large numbers of tables, partitions, and subpartitions.

  • Heavy DML or bulk loads after the last statistics collection.

  • Many objects with stale or missing statistics.

  • A large volume of advisor findings or retained advisor history.

  • A release-specific defect fixed by a later RU or one-off patch.


Gathering statistics more frequently across the entire database is not automatically the answer. It can increase CPU, I/O, maintenance duration, and cursor invalidation. Concentrate on volatile schemas, range-growing columns, and partition strategies that have been tested against the actual workload.


Containment and Long-Term Remediation

Containment should be narrow, reversible, and based on a confirmed consumer. If the Statistics Advisor task is currently executing, preserve the evidence and cancel that execution before disabling a broader automatic maintenance client.


+
-- Use only after confirming that AUTO_STATS_ADVISOR_TASK is executing
EXEC DBMS_STATS.CANCEL_ADVISOR_TASK('AUTO_STATS_ADVISOR_TASK');

+-- Confirm the exact rule name on this database release
SELECT rule_id, name, rule_type, description
FROM   v$stats_advisor_rules
WHERE  UPPER(name) = 'AVOIDOUTOFRANGE';

+-- Targeted workaround where supported and approved
VARIABLE cfg CLOB

BEGIN

:cfg := DBMS_STATS.CONFIGURE_ADVISOR_RULE_FILTER(

         task_name          => 'AUTO_STATS_ADVISOR_TASK',

         stats_adv_opr_type => 'EXECUTE',

         rule_name          => 'AvoidOutOfRange',

         action             => 'SHOW');


END;
/
PRINT cfg

BEGIN
cfg := DBMS_STATS.CONFIGURE_ADVISOR_RULE_FILTER(
         task_name          => 'AUTO_STATS_ADVISOR_TASK',
         stats_adv_opr_type => 'EXECUTE',
         rule_name          => 'AvoidOutOfRange',
         action             => 'DISABLE');

END;
/
PRINT cfg

+-- Re-enable after patch validation by repeating the call with action => 'ENABLE'.
+

These operations require the appropriate privileges and must be validated on the same database release and RU. Changes to the predefined SYS-owned task should follow change control and, for a suspected product defect, Oracle Support guidance.


If targeted control is unavailable, Oracle documents DBMS_AUTO_TASK_ADMIN.DISABLE for the complete automatic statistics client. Treat that as a broad emergency workaround. Define how statistics will be maintained while it is disabled and set a firm date for re-enabling it.


A sensible production sequence


  1. Preserve the alert log, process trace, PGA samples, advisor history, and exact RU details.

  2. Cancel only the confirmed running advisor execution.

  3. Use a rule-level or window-specific workaround where the release supports it.

  4. Check for a matching bug and patch recommendation through an Oracle SR.

  5. Test the fix under a representative maintenance workload.

  6. Remove the workaround, restore normal automation, and monitor several maintenance windows.


Raising PGA_AGGREGATE_LIMIT may buy time only when the host has verified memory headroom. It is not a repair for unbounded private memory growth. A larger limit can move the failure from an Oracle error to swap pressure or an operating-system kill.


Oracle and PostgreSQL Handle This Differently

PostgreSQL does not have an exact equivalent of Oracle's instance-wide PGA_AGGREGATE_LIMIT. Settings such as work_mem, maintenance_work_mem, and autovacuum_work_mem control important memory areas, but work_mem can apply to each plan operation and each parallel worker. Total memory can therefore be much larger than the parameter value suggests.


AreaOraclePostgreSQL
Private execution memoryPGA per Oracle processBackend process memory
Common tuning controlPGA_AGGREGATE_TARGETwork_mem
Database-wide hard ceilingPGA_AGGREGATE_LIMITNo exact built-in equivalent
Parallelism riskParallel query is treated as a unit during limit enforcementwork_mem can apply to the leader and each worker
Internal maintenanceScheduler and job queue tasksAutovacuum and maintenance workers
Final protectionOracle can terminate calls or sessionsOS, cgroup, container limit, or OOM killer may intervene

The shared lesson is that one memory parameter never describes the complete workload. SQL plan nodes, parallel workers, session concurrency, and maintenance activity must be sized together.


Mini Case Study: A Quiet-Window PGA Spike

Problem

Aggregate PGA increased quickly during a weekend maintenance window even though business throughput was low. ORA-04036 appeared in the alert log, and the largest process belonged to a scheduler slave running an Oracle automatic statistics action.


Investigation

Active SQL workareas did not explain the process allocation. Repeated snapshots showed staircase-like private memory growth. The Statistics Advisor execution overlapped the alert, while the trace placed a 32 MB allocation in a qosadv* path associated with AvoidOutOfRange finding generation.


Root cause and fix

The evidence supported excessive untunable PGA allocation while the Optimizer Statistics Advisor created internal finding objects. The running execution was canceled to stabilize the instance. Normal statistics gathering was retained, while a narrowly scoped rule workaround was used only after release-specific validation. The permanent path was to obtain Oracle's RU or one-off patch recommendation, test it, remove the workaround, and observe later maintenance windows.


Lessons From the Field

  • Treat ORA-04036 as the enforcement event, not the root-cause statement.

  • Capture process growth over time. One high-memory snapshot does not show whether the process is stable or still expanding.

  • Store instance ID, SPID, SID, serial number, module, action, SQL ID, allocation, and maximum allocation in the same monitoring record.

  • Monitor each RAC instance independently instead of averaging memory across the cluster.

  • Check maintenance overlap. Statistics, advisors, backups, and application batches can compete even when user traffic is low.

  • Preserve the trace before restarting the instance, purging advisor data, or terminating sessions.

  • Do not permanently solve internal PGA growth by repeatedly raising the limit.


Frequently Asked Questions

Does ORA-04036 always mean the PGA limit is too low?

No. The limit may be undersized for legitimate concurrency, but it may also be correctly stopping a runaway SQL statement, PL/SQL allocation, parallel workload, or internal task. Identify the consumer before resizing.


Can an Oracle automatic statistics task be terminated by the limit?

Yes. Job queue processes are not covered by the same enforcement exemption as most SYS and background processes. An automatic task running through a job queue process can be affected.


Should I disable automatic optimizer statistics collection?

Only as a short, approved emergency measure when narrower containment is unavailable. It disables more than the Statistics Advisor and can leave objects with stale statistics.


Does a 32 MB allocation prove an Oracle memory leak?

No. It proves that one 32 MB allocation was captured at that point. Repeated growth with the same stack and a matching advisor timeline strengthens the diagnosis, but Oracle Support should confirm the defect and patch.


Will increasing PGA_AGGREGATE_TARGET prevent ORA-04036?

Not necessarily. The target mainly guides tunable workareas. Untunable private allocations can continue growing, and hard enforcement still occurs at PGA_AGGREGATE_LIMIT.


Conclusion

ORA-04036 often receives a quick response: increase the limit and move on. That may restore service, but it does not answer the question that matters - which process consumed the untunable memory, and what was it doing?

When the consumer is the automatic Optimizer Statistics Advisor, the normal SQL-tuning workflow is incomplete. A reliable diagnosis connects four layers: instance PGA pressure, process-level growth, scheduler and advisor history, and the allocation stack in the trace. The AvoidOutOfRange and qosadv* evidence is meaningful when those layers agree. It should not be presented as the explanation for every ORA-04036.

Containment requires the same discipline. Cancel the confirmed execution before disabling the complete statistics client. Prefer a tested and reversible rule-level workaround where supported. Keep normal statistics collection working wherever possible, then use the evidence to check the RU level, open an Oracle SR, and test the recommended patch under realistic maintenance load.

Before the next maintenance window, review the monitoring. Capture the top PGA processes, their growth delta, module and action, workarea usage, and automatic task history for every RAC instance. The next ORA-04036 should start an evidence-led investigation, not another round of parameter guessing.


References


Have you encountered ORA-04036 from an Oracle maintenance task rather than application SQL? Share the database release and the evidence that helped you isolate the consumer.



Saturday, 28 November 2026

Why the Same SQL Can Be Slower on an Active Data Guard Standby Than on Primary

 A common complaint in Oracle environments is:

“This SQL runs fast on primary, but the same SQL is slow on standby. Nothing changed in the query, so why is standby taking longer?”

The first reaction is usually predictable. People start checking indexes, optimizer plans, stale statistics, CPU usage, I/O, or resource limits on the standby server.

Those checks are valid. But with Active Data Guard, they are not the full story.



Wednesday, 11 November 2026

OPatch -optimize: Dependency-Aware Conflict Handling

   A patch conflict is rarely limited to two patch IDs. In a long-lived Oracle Home, an installed one-off may be the base for an overlay, and another patch may depend on that overlay. Replacing the first patch can therefore create a chain of rollback dependencies that OPatch must process in the correct order.

The -optimize option is designed for this situation. When a supported OPatch version detects that an incoming patch conflicts with an installed patch, it can calculate the dependency-aware sequence, roll back the conflicting patch and its installed dependents recursively, and then continue with the incoming patch.



Saturday, 31 October 2026

PostgreSQL MVCC in Production: Beyond Nonblocking Reads

  An update-heavy PostgreSQL table can remain available while quietly becoming more expensive to operate. Transactions continue to commit, application response times initially look acceptable, and no major lock queue is visible. Meanwhile, the table grows, index scans perform more heap fetches, autovacuum runs repeatedly, and storage consumption refuses to settle.

The underlying issue is often not a single slow query. It is the lifecycle of row versions created by Multi-Version Concurrency Control, commonly known as MVCC.

MVCC is the reason PostgreSQL can provide consistent reads while other sessions modify the same tables. It is also the reason PostgreSQL needs vacuuming, transaction-age monitoring and careful handling of long-running snapshots. Understanding only the concurrency benefit gives an incomplete operational picture. A production DBA also needs to understand where old versions remain, when they can be removed, and what prevents that cleanup.



Saturday, 24 October 2026

High log file sync in Oracle RAC: When Redo Storage Is Not the Real Problem

  When commit response time suddenly becomes poor, seeing log file sync near the top of an AWR report naturally sends a DBA toward redo I/O, ASM, and the underlying storage path.

That is the right place to start, but not always the right place to stop.

A foreground session waiting on log file sync is waiting for its commit to complete. The physical redo write is only one part of that path. If LGWR cannot get CPU quickly enough, the application can experience slow commits even while redo writes themselves remain fast.



Tuesday, 20 October 2026

ORA-12514: Diagnose the Service, Not the Listener

  A database maintenance window had just ended. The instance was open, the listener process was running, and TNSPING returned successfully. Yet the application connection pool continued to report ORA-12514. The first suggestion on the incident bridge was predictable: restart the listener. That would have changed the system before anyone had established what was actually wrong.

ORA-12514 is not a generic network failure. It tells us something specific: the client reached an Oracle listener, but that listener could not map the requested service name to a registered database service. The gap may be in the client connection string, dynamic registration, PDB state, Clusterware service configuration, or database role after a Data Guard transition. Each cause requires a different response.

This guide treats ORA-12514 as a service-routing problem. We will trace the client descriptor, compare it with the listener registry and database service state, determine when ALTER SYSTEM REGISTER is useful, and examine the multitenant, RAC, and Data Guard cases that simple listener checklists often miss.


What ORA-12514 Actually Proves

The listener receives a client request containing a service name and searches its service registry for a handler capable of accepting the connection. If the requested service is absent, the listener returns ORA-12514.

The error therefore confirms two useful facts:

  • The client successfully reached an Oracle listener.
  • That listener did not recognize the requested service.

This distinction immediately narrows the investigation. The following error comparison is useful during an outage:

Error What It Normally Indicates
ORA-12154 The client could not resolve the supplied connect identifier.
ORA-12541 No listener was reachable at the resolved network address.
ORA-12514 The listener was reached, but the requested service was unknown.
ORA-12505 The requested SID was not known to the listener.
ORA-12516 or ORA-12520 The service was known, but no suitable handler was available.
ORA-01017 The request reached the database, but authentication failed.

Restarting the listener for every ORA-12514 can briefly interrupt new connections while leaving the actual problem untouched. It may also remove useful runtime evidence before the diagnosis is complete.

















                        

 Start With the Client's Actual Connect Descriptor

Do not begin with listener.ora. Begin with the connection information used by the failing client.

Applications frequently use a different Oracle Home, TNS_ADMIN location, DNS record, SCAN address, JDBC URL, or connection-pool configuration from the DBA workstation. A successful manual connection using another alias does not prove that the application configuration is correct.

Where possible, run the following checks from the affected application host:

which sqlplus
sqlplus -V
echo "$TNS_ADMIN"

tnsping PAY_RW

sqlplus -L app_probe@'//db-vip.example.com:1521/pay_rw.example.com'

tnsping displays the resolved address and the network configuration files used by the client. It confirms listener reachability, but it does not prove that the database is running or that the requested service can accept a login. An actual SQL*Plus connection is still required.

For a JDBC Thin client, a service-based URL normally looks like this:

jdbc:oracle:thin:@//db-vip.example.com:1521/pay_rw.example.com

Common application-side causes include:

  • A PDB service was renamed during migration, but the old JDBC URL remains deployed.
  • One connection pool uses a SID-style URL while another uses a service name.
  • A stale tnsnames.ora file is packaged inside an application container.
  • DNS directs the application to a listener different from the one checked by the DBA.
  • A load-balanced descriptor contains one outdated address.
  • Multiple Oracle Homes read different network configuration directories.

Before changing anything, record the host, port, protocol, and requested service used by the failed connection.


Compare Three Sources of Truth

A reliable ORA-12514 investigation compares three different views:

  1. What the client requests.
  2. What the listener has registered.
  3. What the database or Clusterware is currently offering.

Check the Exact Listener

Run the commands against the listener handling the failed endpoint:

lsnrctl status LISTENER
lsnrctl services LISTENER

lsnrctl status confirms endpoints and provides a service summary. lsnrctl services is usually more useful during diagnosis because it displays registered services, instances, and handlers.

Do not assume that the listener is named LISTENER. Verify the listener name, Oracle Home, host, and port. On RAC systems, distinguish between local listeners and SCAN listeners.

Check the Database and Service State

Connect locally as SYSDBA and compare defined services with services that are active in the instance:

SET LINESIZE 220
SET PAGESIZE 100

SELECT instance_name,
status,
database_status FROM   v$instance;

SELECT name,
db_unique_name,
database_role,
open_mode FROM   v$database;

SELECT name,
network_name,
pdb FROM   dba_services ORDER BY name;

SELECT name,
network_name,
pdb FROM   v$active_services ORDER BY name;

-- Run in a multitenant database SELECT name,
open_mode,
restricted FROM   v$pdbs ORDER BY con_id;

DBA_SERVICES shows service definitions, while V$ACTIVE_SERVICES shows services currently active in the instance. The difference between these views is often where the diagnosis becomes clear.

Observation Likely Investigation Path
Service missing from DBA_SERVICES Wrong client service name or a missing service definition.
Present in DBA_SERVICES, but absent from V$ACTIVE_SERVICES Service stopped, PDB closed, or Clusterware policy not satisfied.
Active in the database, but absent from lsnrctl services LREG registration problem or incorrect listener target.
Registered with another listener only Wrong host, port, VIP, SCAN address, or listener configuration.
Registered correctly, but the application still fails The application resolves another descriptor or retains stale pool configuration.
Available on only one RAC node Service placement, preferred-instance policy, or remote registration issue.


How Dynamic Service Registration Works

Modern Oracle releases use the Listener Registration process, LREG, to publish database services. Older explanations often attribute registration to PMON, but LREG is the relevant background process in current releases.

By default, LREG attempts to register with a local listener on TCP port 1521. LOCAL_LISTENER identifies non-default local endpoints, while REMOTE_LISTENER is commonly used for remote endpoints such as RAC SCAN listeners. Dynamic registration normally does not require a static database entry in listener.ora.

Check the current registration-related parameters:

SHOW PARAMETER local_listener
SHOW PARAMETER remote_listener
SHOW PARAMETER service_names

SELECT name,
value FROM   v$parameter WHERE  name IN ('local_listener',
'remote_listener',
'service_names');

If a single-instance database uses a listener on a non-default port, an explicit local listener address may be required:

ALTER SYSTEM SET local_listener =
  '(ADDRESS=(PROTOCOL=TCP)
            (HOST=db-vip.example.com)
            (PORT=1522))'
  SCOPE=BOTH;

ALTER SYSTEM REGISTER;

Confirm the result afterward with lsnrctl services. Do not copy this parameter change blindly into RAC. Clusterware normally manages local listener and SCAN-related configuration, and manual changes can conflict with the cluster configuration.

What ALTER SYSTEM REGISTER Does Not Do

ALTER SYSTEM REGISTER asks LREG to publish the database's currently active services immediately. It does not:

  • Create a missing service.
  • Start a stopped service.
  • Open a PDB.
  • Correct the client's service name.
  • Change a Data Guard service role.
  • Override a disabled Clusterware resource.
  • Repair an unreachable listener address.

If the service is absent from V$ACTIVE_SERVICES, repeatedly forcing registration will not solve the underlying problem.

Starting with Oracle Database 19c, customer use of the SERVICE_NAMES initialization parameter is deprecated. Application services should be managed through tools such as SRVCTL, GDSCTL, or DBMS_SERVICE. In high-availability environments, SERVICE_NAMES should not be treated as the service-management mechanism.


SERVICE_NAME, SID, and Database Name Are Different

Many ORA-12514 incidents begin with the assumption that the database name, instance SID, and application service must be identical. They represent different layers of the database architecture.

Name Purpose
SERVICE_NAME Logical workload endpoint used by clients.
SID Identifier for one Oracle database instance.
DB_NAME Database identity recorded in the control file.
DB_UNIQUE_NAME Unique database identity used in configurations such as Data Guard.
PDB name Name of a pluggable container, which is not necessarily the preferred application service.

A service can run across several RAC instances, relocate during maintenance, or start only when a Data Guard database has a particular role. A SID cannot provide that abstraction.

A good service name should describe workload intent. For example:

  • orders_rw.example.com for primary read-write traffic.
  • orders_ro.example.com for reporting on an Active Data Guard standby.
  • batch.example.com for scheduled processing with separate placement rules.

Using one generic service for every workload makes draining, placement, failover, load balancing, and maintenance considerably harder.


Multitenant Problems: The CDB Is Open but the PDB Is Not

One of the easiest ways to misdiagnose ORA-12514 is to check only V$DATABASE.OPEN_MODE. The CDB may be open while the target PDB remains mounted. A service associated with that PDB may therefore be unavailable even though the instance appears healthy.

For a routine single-instance environment, check the PDB and its active services:

SHOW PDBS

ALTER PLUGGABLE DATABASE orders_pdb OPEN;

-- Consider this for restart persistence in a suitable non-Data Guard design ALTER PLUGGABLE DATABASE orders_pdb SAVE STATE;

SELECT name,
network_name,
pdb FROM   v$active_services WHERE  pdb = 'ORDERS_PDB';

Saved PDB state is useful in straightforward deployments, but it should not replace role-aware service management in Data Guard. For high-availability applications, use a named application service associated with the correct PDB and database role.

Avoid relying on an automatically created PDB default service for an HA application. A separately managed application service provides proper control over placement, database role, failover behavior, and workload management.


RAC and Data Guard Require Clusterware-Level Checks

In RAC, Oracle Restart, and Data Guard environments, an active instance does not automatically mean that an application service should run there. Clusterware decides service placement based on configuration, management policy, preferred instances, PDB association, and database role.

Use the Grid Infrastructure version of SRVCTL and check both configuration and runtime state:

srvctl status database -db PROD_A -verbose

srvctl config service -db PROD_A 
-service orders_rw -verbose

srvctl status service -db PROD_A 
-service orders_rw -verbose

srvctl status listener -listener LISTENER -verbose
srvctl status scan_listener -verbose

The service configuration should answer the following questions:

  • Is the service enabled?
  • Is its management policy automatic?
  • Which PDB owns the service?
  • Which RAC instances or server pool can run it?
  • Is it configured for the PRIMARY role, PHYSICAL_STANDBY role, or both?
  • Is the service currently running?

For Data Guard, verify the database role and broker configuration as well:

dgmgrl /

DGMGRL> SHOW CONFIGURATION VERBOSE;
DGMGRL> SHOW DATABASE VERBOSE 'PROD_A';
DGMGRL> VALIDATE DATABASE VERBOSE 'PROD_A';

A read-write application service should normally be configured with the PRIMARY role on both Data Guard sites. A reporting service can be configured separately for the PHYSICAL_STANDBY role.

A role-related service correction might look like this:

srvctl modify service -db PROD_B \
  -service orders_rw \
  -role PRIMARY \
  -policy AUTOMATIC \
  -pdb ORDERS_PDB

srvctl start service -db PROD_B -service orders_rw

Service changes can affect placement and existing sessions. Confirm the syntax supported by the installed Grid Infrastructure release and apply the change through the normal production change process.


Performance and Monitoring Considerations

ORA-12514 itself is generally returned quickly and is not usually a database performance problem. The secondary effect can still be serious.

An application pool may retry failed connections without sufficient delay. Hundreds of application processes then create a connection storm as soon as the service returns. Listener logs grow rapidly, monitoring floods the support channel, and the restored database receives a sudden authentication and session-creation spike.

Production monitoring should therefore go beyond checking whether the listener process is running:

  • Confirm that each required application service is registered.
  • Run a controlled synthetic login through the application endpoint.
  • Check service availability after database and listener restarts.
  • Validate every RAC or SCAN path used by the application.
  • Test application services after Data Guard switchovers, not only before them.
  • Alert when a required service remains absent beyond the expected registration interval.
  • Configure application retries with delay, backoff, and sensible limits.

When an ORA-12514 message contains a CONNECTION_ID, preserve it. The identifier can help correlate the failed request with Oracle listener diagnostics. The lsnrctl status output also reports the active listener log location.


Oracle Versus PostgreSQL Connection Routing

PostgreSQL does not have an Oracle-style listener service registry. High-availability routing is normally provided through a proxy, virtual IP, DNS record, operator, or client connection string.

Oracle PostgreSQL
The client requests a logical database service. The client specifies a host, port, and database.
LREG registers services with listeners. The PostgreSQL server process accepts connections directly.
Services can map to PDBs, RAC instances, and database roles. External HA components normally route clients to the correct server role.
An unknown service can return ORA-12514. A missing database normally returns a PostgreSQL FATAL error.
tnsping checks listener reachability. pg_isready checks PostgreSQL server status.
SQL*Plus validates an actual service login. psql validates an actual database login.

The testing principle is similar on both platforms. pg_isready can report server status without proving that a specific user can connect to a valid database. It should not replace an actual psql connection test.

pg_isready -h pg-vip.example.com -p 5432

psql "host=pg-vip.example.com port=5432 dbname=orders 
user=app_probe connect_timeout=5"

For both platforms, an endpoint health check is weaker than a real application-path login test.


Quick Takeaways

  • ORA-12514 normally proves that the client reached a listener.
  • Check the application's resolved service name, host, and port first.
  • TNSPING success does not prove that the database service is available.
  • Compare DBA_SERVICES, V$ACTIVE_SERVICES, and lsnrctl services.
  • ALTER SYSTEM REGISTER publishes active services; it does not start them.
  • In RAC and Data Guard, use SRVCTL as the service-management source of truth.
  • Monitor actual application service logins, not only listener availability.


Lessons From the Field: DBA Takeaways

The Wrong Listener Is Checked Surprisingly Often

Multi-home servers, custom ports, SCAN listeners, VIPs, and stale DNS records can make a healthy listener irrelevant to the failed application path. Always reproduce the connection from the same network path used by the application.

Restarts Can Hide Weak Service Design

If every incident is closed after restarting the listener or database, delayed registration, incorrect role policies, and closed PDBs remain in place for the next maintenance window.

Application Retries Need Control

A missing service can become a connection storm when thousands of pool retries arrive after recovery. Retry intervals and backoff settings should be reviewed as part of the database service design.

Default Services Are Poor HA Contracts

Define application services according to workload and database role instead of exposing the raw database or PDB identity directly.

Data Guard Testing Must Include Services

A successful broker switchover does not prove that the application service started on the new primary. The runbook should include service checks and a real application connection test.


Mini Case Study: Service Missing After Switchover

Problem

After a planned Data Guard switchover, the new primary opened successfully and the broker reported a healthy configuration. The SCAN endpoint was reachable, but the application received ORA-12514 for orders_rw.

Investigation

lsnrctl services confirmed that orders_rw was missing. Running ALTER SYSTEM REGISTER made no difference.

DBA_SERVICES showed that the service existed, but it was absent from V$ACTIVE_SERVICES. The decisive check was:

srvctl config service -db PROD_B \
  -service orders_rw -verbose

The service on the second site had been configured with the PHYSICAL_STANDBY role during an earlier build. Clusterware therefore did exactly what its configuration required and did not start the service when that database became primary.

Root Cause

The service definition was inconsistent between the two Data Guard sites. Database switchover had been tested, but application service relocation had not.

Fix

The service was changed to the PRIMARY role, associated with the correct PDB, enabled with an automatic management policy, and started through SRVCTL. The service then appeared in the listener registry and the application connection succeeded.

The permanent remediation was to add service-role validation and an application login test to the switchover runbook.


Frequently Asked Questions

1. Why does TNSPING succeed while SQL*Plus returns ORA-12514?

TNSPING proves that the resolved listener can be reached. It does not establish a database session or confirm that the requested service is registered. Check lsnrctl services and perform an actual SQL*Plus connection.

2. Will Restarting the Listener Fix ORA-12514?

It may appear to help when registration is temporarily delayed, but it is rarely the correct first action. Verify the service name, active database services, PDB state, and registration targets before restarting anything.

3. When Should I Run ALTER SYSTEM REGISTER?

Use it when the required service is active in the database and the listener endpoint is correct, but the listener has not yet received the registration. It is particularly useful after starting or reconfiguring a listener.

4. Why Can ORA-12514 Occur After a PDB Restart?

The CDB may be open while the target PDB remains mounted, or the PDB-associated application service may not have restarted. Check V$PDBS, V$ACTIVE_SERVICES, and the relevant SRVCTL service state.

5. Can ORA-12514 Affect Performance?

The error itself is normally returned quickly. Poorly configured application retries can still cause connection storms, rapid listener-log growth, and a session-creation spike when the service becomes available again.


Conclusion

ORA-12514 becomes easier to diagnose once it is treated as a failed service mapping rather than a vague Oracle Net problem. The client reached a listener. The DBA's task is to identify the service it requested, confirm whether that exact listener knows the service, and determine why the database or Clusterware is not offering it.

The most reliable workflow is consistent: capture the resolved connection descriptor, run lsnrctl services against the correct listener, compare DBA_SERVICES with V$ACTIVE_SERVICES, and verify the instance, PDB, and Data Guard role. ALTER SYSTEM REGISTER is useful when LREG has an active service to publish. It cannot create a service, open a PDB, correct a stale client alias, or override a Clusterware role policy.

Modern Oracle environments need disciplined service management. Use named application services, manage RAC and Oracle Restart services through SRVCTL, associate PDB services explicitly, and configure Data Guard services by role. Do not use the PDB default service as the foundation of a production failover design.

Review one critical application's connection path. Record its host or SCAN address, port, service, PDB, preferred placement, Data Guard role, and monitoring check. Then test it after a restart and during the next planned role transition. A service that works only during normal operations is not yet production-ready.


Official Oracle References

  1. Oracle Error Help: ORA-12514 - Official explanation, causes, and recommended actions for an unknown or unregistered service.
  2. Configuring and Administering Oracle Net Listener - Covers LREG, dynamic service registration, LOCAL_LISTENER, REMOTE_LISTENER, and listener administration.
  3. Oracle Database 19c SRVCTL Reference - Reference for managing RAC, Oracle Restart, PDB, and role-based application services.


Have you encountered ORA-12514 after a PDB restart, RAC service relocation, or Data Guard switchover? Share the symptom and the check that exposed the real cause. Production patterns are often more useful than another listener restart checklist.


Saturday, 17 October 2026

Oracle DBA in 2030: What Will the Role Look Like?

A production database alert arrives at 2:00 a.m. The monitoring platform detects increased commit latency, correlates it with storage response time and suggests several corrective actions. That is useful automation. The difficult part begins when someone must decide whether to wait, change the workload, fail over the database or accept the risk of an emergency configuration change.

This is why I do not expect AI to eliminate the Oracle DBA role by 2030. It will, however, remove a significant amount of repetitive administration. The DBA who only performs standard checks manually may struggle. The DBA who understands Oracle internals, automates routine work and makes sound production decisions will remain valuable.


Oracle Automation Is Not New

Oracle databases have provided automated diagnostics and recommendations for years. AWR, ADDM, SQL Tuning Advisor, Automatic Workload Repository baselines and automatic memory management already reduce the amount of manual analysis required. AutoUpgrade, Fleet Patching and Provisioning, Enterprise Manager and cloud-managed database services continue the same direction.

AI extends this capability by processing more operational data, identifying patterns and presenting possible causes more quickly. It may summarise an incident, compare execution plans, identify unusual workload behaviour or generate a first version of a remediation script.

The output still needs validation. Oracle recommendations are based on the information available to the tool. They may not include application release activity, business priorities, licensing restrictions, downstream dependencies or the recovery limitations of a particular environment.


The Work Most Likely to Change

Work Area Likely Direction DBA Responsibility
Health checks and routine reporting Largely automated Define thresholds, validate exceptions and improve coverage
SQL performance analysis AI-assisted diagnosis and recommendations Assess workload-wide impact before implementation
Backup and recovery validation Automated checks and anomaly detection Prove recoverability through restore and recovery testing
Patching and provisioning Policy-driven orchestration Control compatibility, rollback and operational risk
Outage and disaster recovery decisions AI-supported but human-led Own the decision, coordination and business impact


Where Production Experience Still Matters

Consider a Data Guard environment where transport lag suddenly increases. An AI-assisted platform may identify network latency, an archive destination error or heavy redo generation as possible causes. That helps reduce investigation time, but the operational decision is more complicated.

A DBA must determine whether the standby is still suitable for failover, whether the defined RPO is at risk, whether the lag is temporary and whether the application can reconnect correctly after a role transition. The decision may also depend on broker configuration, standby redo logs, protection mode, Fast-Start Failover settings and the availability of application and infrastructure teams.

The same applies to SQL tuning. Creating an index may improve one expensive query while increasing DML latency, storage consumption and maintenance time. Accepting a SQL profile may stabilise a plan but can also hide an underlying statistics or data-distribution problem. AI can suggest an action; the DBA must evaluate its wider effect.


The Oracle DBA Will Become a Platform Engineer

By 2030, managing databases one server at a time will be difficult to justify. Database estates are already moving towards standardised platforms, infrastructure as code, policy-based controls and self-service provisioning.

Oracle expertise will remain the foundation, but it will need to be combined with broader engineering skills:

  • Oracle RAC, Data Guard, RMAN and multitenant architecture
  • Exadata, Exadata Cloud@Customer and Oracle Cloud Infrastructure
  • Shell or Python scripting for operational automation
  • Ansible and Terraform for repeatable configuration and provisioning
  • APIs, Git and CI/CD practices for database changes
  • Security controls, encryption, auditing and access governance
  • Observability across the database, operating system, storage and application layers

This does not mean every DBA must become an expert in every tool. The practical goal is to stop treating database administration as a collection of manual server activities and start treating it as an engineered service.


Common Mistakes DBAs Should Avoid

Trusting Recommendations Without Testing

An AI-generated script should be reviewed like any other production change. Check its scope, privileges, locking behaviour, failure handling and rollback path. Test it with representative data before running it against a critical database.

Automating a Broken Process

Automation makes a good process faster, but it can also repeat a bad decision consistently. Before automating patching, failover or cleanup, define the prerequisites, safety checks, stopping conditions and evidence required after completion.

Ignoring Database Fundamentals

AI assistance does not remove the need to understand wait events, execution plans, locking, undo, redo, checkpoints, recovery and Oracle memory structures. Without that foundation, it is difficult to recognise when a recommendation is incomplete or unsafe.


Frequently Asked Questions

Will junior Oracle DBA positions disappear?

Entry-level work will change because many routine checks and standard requests can be automated. Junior DBAs will need earlier exposure to scripting, cloud platforms, observability and incident analysis instead of relying only on repetitive operational tasks.

Should Oracle DBAs move completely into cloud roles?

Cloud knowledge is valuable, but many enterprises will continue operating hybrid environments. Experience with on-premises Oracle, Exadata, Exadata Cloud@Customer and OCI can be more useful than focusing on only one deployment model.

Can AI make production database changes automatically?

Technically, automation can execute approved changes. For critical systems, organisations should still use access controls, testing, change approval, audit trails, rollback procedures and human oversight. The level of autonomy should depend on the risk and reversibility of the operation.


Final Thoughts

AI is unlikely to replace the Oracle DBA by 2030, but it will expose inefficient ways of working. Tasks based on predictable inputs and repeatable steps will increasingly move to automation. Architecture decisions, complex recovery, performance trade-offs, security and business-critical incident handling will continue to require experienced engineers.

The safest career strategy is not to compete with automation. Use it to remove repetitive work, then invest the saved time in Oracle internals, platform engineering, cloud architecture and recovery design. The future Oracle DBA will manage fewer individual tasks but carry greater responsibility for the reliability of the entire database service.