ora-942 when Accessing dba_registry_sqlpatch View (Doc ID 2180541.1)

Last updated on SEPTEMBER 07, 2016

Applies to:

JDBC - Version 12.1.0.2.0 and later
Information in this document applies to any platform.

Symptoms

From within a Java program using JDBC 12.1.0.2 when running the query below, the table is not found.
It works on all 12c database environments, but it does not work in any of the 11g environments.

select VERSION, PATCH_ID, DESCRIPTION from sys.dba_registry_sqlpatch

 

Exception in thread "main" java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:30)
at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:762)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:925)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1111)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1309)
at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:422)
at getDBpatchset.main(getDBpatchset.java:82)

ERROR
-----------------------
ORA-00942: table or view does not exist


STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1. Create a Java program that executes the query select VERSION, PATCH_ID, DESCRIPTION from sys.dba_registry_sqlpatch.
2.Run the java program against an 11g database.
It will fail with ORA-00942: table or view does not exist

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms