DataGrip unable to get DDL for Stored Procedures in a Package


When I try to view the a stored procedure I instead get the following text:

-- auto-generated definition
-- No source text available

Right clicking the package and copying the DDL to clipboard outputs nothing. I have "Introspect using JDBC metadata" checked and all sources (excluding system schemas) are supposed to be loaded.When I try to copy the DDL of a procedure from the package I get the below text instead:

-- we don't know how to generate routine EFFECTIVENESSCHECK_Q1 (class PackageRoutine) :(
-- comment on routine EFFECTIVENESSCHECK_Q1 not supported: Packaged procedure

Does anyone know any fixes that could get the DDL for the package and its stored procedures to be displayed properly?


Comment actions Permalink

@Spencer Underwood Do work with Oracle?
Could you disable `Introspect using JDBC metadata` option and then invoke `Database tools...` -> `Forget cached schemas` and resync?

Comment actions Permalink

@vasily_chernov I am indeed working with an oracle 10g database.

I have disabled the "Introspect using JDBC metadata" option, forgottten the schema and then re-sync'd but when I try to view the procedure it still shows the error messages from before. One new unusual behavior though is that I can right click the stored procedure in the package and "Request and copy Original DDL" and the stored procedure is copied perfectly into the clipboard, even though it's not shown properly,

I also get a new oracle error which might be the root of the problem:

Error encountered when performing Introspect the schema <<SCHEMA>> stuff completely: ORA-01652: unable to extend temp segment by 128 in TEMP03
ORA-01652: unable to extend temp segment by 128 in tablespace TEMP03 (1 m 33 s 229 ms)

I'll contact our DB team next and see if the DB has enough resources for this task.


Comment actions Permalink

Hello Spencer,


could you please turn the introspector logs ON, then reproduce the error ORA-01652 and provide us with the log files?

In order to turn logging ON, just select item "Debug Log Settings" from the menu Help, and add the following string:


(including the leading sharp sign).

For locating the log files you can select item "Show Log in Explorer". You can also move existing logs to another location, to get a log file containing entries related this problem only.


Comment actions Permalink

Greetings @Leonid ,

Unfortunately I am no longer able to replicate this issue :(

The DBA team indicated this morning that they have allocated additional temp space to the user I was trying to connect with, and ever since then the DataGrip has been working great.

My apologies,

Spencer Underwood

Comment actions Permalink

@ Spencer Underwood 
Let me know if there are any updates.


Comment actions Permalink

@Vasily Chernov.


I got the same issue introspecting an Oracle v
Introspecting with "Introspect using JDBC metadata" set to true, results in "Not supported facility" (see stacktrace below) when introspecting source code.

Introspecting with "Introspect using JDBC metadata" set to false, results in "ORA-0942 - table or view not found", when trying to select from sys.obj$.
That requires permissions, that most users does not have.

2018-11-06 10:53:59,920 [1042931692] WARN - lij.database.util.ErrorHandler - Ikke-understøttet facilitet
java.sql.SQLException: Ikke-understøttet facilitet
at oracle.jdbc.OracleDatabaseMetaData.getAttributes(
at com.intellij.database.remote.jdbc.impl.RemoteDatabaseMetaDataImpl.getAttributes(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at sun.rmi.server.UnicastServerRef.dispatch(
at sun.rmi.transport.Transport$
at sun.rmi.transport.Transport$
at Method)
at sun.rmi.transport.Transport.serviceCall(
at sun.rmi.transport.tcp.TCPTransport.handleMessages(
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(
at Method)
at sun.rmi.transport.tcp.TCPTransport$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(
at sun.rmi.transport.StreamRemoteCall.executeCall(
at sun.rmi.server.UnicastRef.invoke(
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(
at java.rmi.server.RemoteObjectInvocationHandler.invoke(
at com.sun.proxy.$Proxy213.getAttributes(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.intellij.execution.rmi.RemoteUtil.invokeRemote(
at com.intellij.execution.rmi.RemoteUtil.access$300(
at com.intellij.execution.rmi.RemoteUtil$RemoteInvocationHandler.invoke(
at com.sun.proxy.$Proxy214.getAttributes(Unknown Source)
at com.intellij.database.introspection.jdbcMetadataWrappers.DatabaseMetaDataWrapper.userDefinedTypeAttributesInner(
at com.intellij.database.introspection.jdbcMetadataWrappers.DatabaseMetaDataWrapper.userDefinedTypeAttributes(
at com.intellij.database.introspection.GenericIntrospector.introspectTypeAttributesInSchema(
at com.intellij.database.introspection.GenericIntrospector.lambda$introspectSchemasByCatalogs$9(
at java.lang.Iterable.forEach(
at com.intellij.database.introspection.GenericIntrospector.lambda$forEachSchemaInCatalog$15(
at com.intellij.database.introspection.GenericIntrospector.forEachCatalog(
at com.intellij.database.introspection.GenericIntrospector.forEachSchemaInCatalog(
at com.intellij.database.introspection.GenericIntrospector.introspectSchemasByCatalogs(
at com.intellij.database.introspection.GenericIntrospector.introspectSchemas(
at com.intellij.database.introspection.GenericIntrospector.lambda$null$0(
at org.jetbrains.dekaf.core.BaseFacade.inSession(
at com.intellij.database.introspection.GenericIntrospector.lambda$introspectAuto$1(
at com.intellij.database.model.impl.BaseModel.modify(
at com.intellij.database.model.impl.BaseModel.modify(
at com.intellij.database.model.impl.BaseModel.modify(
at com.intellij.database.introspection.GenericIntrospector.introspectAuto(
at com.intellij.database.dataSource.DatabaseModelLoader$IntrospectionSession.introspectDatabases(
at com.intellij.database.dataSource.DatabaseModelLoader$IntrospectionSession.lambda$null$2(
at com.intellij.database.dataSource.DatabaseModelLoader$IntrospectionSession.withFacade(
at com.intellij.database.dataSource.DatabaseModelLoader$IntrospectionSession.lambda$introspect$3(
at com.intellij.database.dataSource.DataSourceSyncManager.lambda$null$0(
at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.perform(
at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.lambda$sync$2(
at com.intellij.database.dataSource.AsyncUtil.withAsyncFriendly(
at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.sync(
at com.intellij.database.dataSource.DatabaseConnectionManager$Builder.sync(
at com.intellij.database.dataSource.DataSourceSyncManager.lambda$static$1(
at com.intellij.database.dataSource.DataSourceSyncManager$SyncProcessor$1.perform(
at com.intellij.database.dataSource.DatabaseModelLoader$IntrospectionSession.introspect(
at com.intellij.database.dataSource.DatabaseModelLoader$IntrospectionSession.lambda$run$0(
at com.intellij.database.dataSource.LocalDataSource.performBatch(
at com.intellij.database.dataSource.DatabaseModelLoader$
at com.intellij.database.dataSource.DataSourceSyncManager$SyncProcessor.performSync(
at com.intellij.database.dataSource.AsyncUtil.lambda$null$6(
at com.intellij.database.dataSource.AsyncUtil.lambda$underProgress$14(
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(
at com.intellij.database.dataSource.AsyncUtil.underProgress(
at com.intellij.database.dataSource.AsyncUtil.underProgress(
at com.intellij.database.dataSource.AsyncUtil.lambda$captureIndicator$7(
at java.util.concurrent.CompletableFuture$
at com.intellij.openapi.application.impl.ApplicationImpl$
at java.util.concurrent.Executors$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$


Best regards

Otto Jacobsen

Comment actions Permalink

The root cause of this issue seem to be this heavy query:

with O1 as ( select object_id,
from sys.all_objects
where owner = ?
-- and last_ddl_time >= :since
-- and object_name in ( :[*major_object_names] )
and object_type in ('TYPE', 'TYPE BODY', 'PACKAGE', 'PACKAGE BODY',
O2 as ( select object_id as referenced_id,
owner as referenced_schema_name,
object_type as referenced_type,
object_name as referenced_name
from sys.all_objects ), -- don't use #CAT here
DE as ( select type as object_type,
name as object_name,
referenced_owner as referenced_schema_name,
from sys.all_dependencies
where owner = ?
and not (owner = referenced_owner and name = referenced_name and type = referenced_type || ' BODY')
and not (referenced_owner = 'SYS' and referenced_type = 'PACKAGE' and referenced_name = 'STANDARD')
and referenced_type not like 'JAVA%' )
select object_id, referenced_id /* O1.object_id, O2.referenced_id *//* object_id, referenced_id */
from O1 natural join DE natural join O2;

Package sources cannot be loaded for any of our customer oracle installations - so I would consider this a "bug".
It should be possible to rewrite the sql to be less heavy on temporary storage.
Is this the correct place to report this request for improvement? Currently my colleagues want to use DataGrip but since they still have to use other tools to view package sources, they refrain from using it instead.

Comment actions Permalink

I should add that in our case - the customer installations have between 6000 and 12.000 packages. These packages are quite large... 
I'd rather have an  option for datagrip to lazy load sources as you request them:

select text from all_source where name = 'ABC_CLASS_API'
and type = 'PACKAGE BODY'
order by line;

Please consider! :)

Comment actions Permalink

@Aron thank you for root cause investigation


Please sign in to leave a comment.