Oracle EE

As part of a general clean up of a legacy application prior to a migration I'm trying to determine what objects are actually in use.

There are some 230 JAVA class objects in my database. I can look at DBA_DEPENDENCIES to see where the dependencies between the java classes exist. I can look at DBA_SOURCE to find what packages include the phrase 'AS LANGUAGE JAVA' to find packages that wrap JAVA classes. I am auditing the execution of all the packages owned by our application schema. But as far as I know you can't audit what procedures are called inside of a package.

Is there a way to audit the execution of the java class itself? Can JAVA classes be called without being wrapped in a PL/SQL procedure?

I'm not a JAVA programmer (if that isn't obvious).


Doc https://docs.oracle.com/database/121/SQLRF/statements_4007.htm#SQLRF01107 for AUDIT statement says "Java schema objects (sources, classes, and resources) are considered the same as procedures for purposes of auditing SQL statements." So I assume that you can audit these Java objects with AUDIT statement (but I have not tested this).

  • For auditing procedures I use: ALTER EXECUTE ON SCHEMA1.PROCEDURE1 BY ACCESS; Mar 13 '20 at 18:22
  • 1
    Figured it out. Thanks! AUDIT EXECUTE ON JAVA CLASS OWNER."/shortname" BY ACCESS; The short name can be found in dba_objects and the double quotes are required. Mar 13 '20 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.