Oracle Database / Editorial solution guide
Diagnose service context and object access failures
Separate listener routing, PDB destination, naming and stored-code authorization before proposing a change.
Read-only knowledge base · No public comments
Recognize the symptoms
The application reports ORA-12514 before connecting, or ORA-00942 after connection. A developer can query the table interactively, but the runtime account or a stored procedure cannot. Preserve the exact stage and error; these symptoms do not all mean an incorrect password.
Understand the likely causes
- A requested service can be absent from listener registration, a connection can reach the wrong PDB, or name resolution can identify another owner. Object access can also differ between an interactive role-enabled session and stored code with specific rights and direct-grant requirements.
Classify the failing layer
Collect a redacted connection descriptor, client location, service name, server release and account role from approved deployment evidence. A SID and service name are different identifiers, so replacing one with the other by trial can obscure the intended target. If connection never reaches a database session, catalog queries cannot diagnose that attempt. Ask the endpoint owner to compare the documented service with existing registration evidence; do not restart listeners or weaken authentication as an exploratory step.
Compare an authorized session fingerprint
For an existing authorized session, compare identity, container and current schema with the intended runtime configuration. CURRENT_SCHEMA affects names but grants no authority. A successful administrator session is not a substitute for evidence from the application principal. The query is illustrative and no connection was made during authoring. Keep actual infrastructure names private when escalating the diagnosis.
SELECT SYS_CONTEXT('USERENV','SESSION_USER') AS session_user,
SYS_CONTEXT('USERENV','CURRENT_SCHEMA') AS current_schema,
SYS_CONTEXT('USERENV','CON_NAME') AS container_name
FROM dual;
Compare actual values with the approved service-to-PDB and account mapping.
Inspect the named object within visible scope
Search ALL_TABLES for the expected uppercase table name and owner, remembering that quoted identifiers preserve case. A zero-row result can indicate inaccessible objects as well as an absent object. Inspect synonyms through the approved dictionary scope if the application uses aliases, then identify the underlying owner. Creating a replacement table in the runtime schema can make the error disappear while sending writes to the wrong data, so it is not a valid diagnostic repair.
SELECT owner, table_name FROM all_tables
WHERE table_name = 'SHIPMENTS'
ORDER BY owner;
Returns only visible matches. It does not prove that an absent row is absent from every container.
Resolve stored-code authority deliberately
If direct SQL works but a package fails, inspect AUTHID, owner-qualified dependencies and the compilation diagnostics available to the owner. Definer-rights compilation and execution can require appropriate direct grants rather than the role used interactively. Invoker-rights behavior has its own runtime rules. Have the authorized owner propose the narrow object or interface grant matching the intended design. Do not grant DBA or ANY privileges to make a symptom disappear.
Verify the fix
Confirm the runtime principal reaches the intended service and container, resolves the documented owner and performs the permitted synthetic operation. Verify that direct writes remain denied when the API design requires it. Record the exact failing and successful paths separately; no engine verification was performed by this guide.
Keep it from recurring
- Review service-to-PDB mappings, schema-qualified dependencies and least-privilege runtime grants with each release. Keep client tooling versions separate from server facts, and include the actual runtime account in authorization tests.