@@ -609,8 +609,17 @@ class UtplsqlDao {
609609 * gets dependencies of a given object.
610610 *
611611 * The result can be used as input for the includeObjectList in htmlCodeCoverage
612- * The scope is reduced to the current schema.
613- * This is useful when test packages are installed in the code schema.
612+ * The scope is reduced to non-oracle maintained schemas.
613+ *
614+ * Oracle introduced the column ORACLE_MAINTAINED in 12.1.
615+ * To simplify the query and compatibility the result of the following
616+ * query is included
617+ *
618+ * SELECT '''' || listagg(username, ''', ''') || '''' AS oracle_maintained_users
619+ * FROM dba_users
620+ * WHERE oracle_maintained = 'Y'
621+ * ORDER BY username;
622+ *
614623 * The result may include test packages
615624 *
616625 * @param name test package name
@@ -622,7 +631,15 @@ class UtplsqlDao {
622631 from «IF dbaViewAccessible»dba«ELSE»all«ENDIF»_dependencies
623632 WHERE owner = user
624633 AND name = upper(?)
625- AND referenced_owner = user
634+ AND referenced_owner NOT IN (
635+ ' SYS ' , ' SYSTEM ' , ' XS $NULL ' , ' OJVMSYS ' , ' LBACSYS ' , ' OUTLN ' , ' SYS $UMF ' ,
636+ ' DBSNMP ' , ' APPQOSSYS ' , ' DBSFWUSER ' , ' GGSYS ' , ' ANONYMOUS ' , ' CTXSYS ' ,
637+ ' SI_INFORMTN_SCHEMA ' , ' DVF ' , ' DVSYS ' , ' GSMADMIN_INTERNAL ' , ' ORDPLUGINS ' ,
638+ ' MDSYS ' , ' OLAPSYS ' , ' ORDDATA ' , ' XDB ' , ' WMSYS ' , ' ORDSYS ' , ' GSMCATUSER ' ,
639+ ' MDDATA ' , ' REMOTE_SCHEDULER_AGENT ' , ' SYSBACKUP ' , ' GSMUSER ' , ' APEX_PUBLIC_USER ' ,
640+ ' SYSRAC ' , ' AUDSYS ' , ' DIP ' , ' SYSKM ' , ' ORACLE_OCM ' , ' APEX_INSTANCE_ADMIN_USER ' ,
641+ ' SYSDG ' , ' FLOWS_FILES ' , ' ORDS_METADATA ' , ' ORDS_PUBLIC_USER ' , ' APEX_180100 '
642+ )
626643 AND referenced_type IN (' PACKAGE ' , ' TYPE ' , ' PROCEDURE ' , ' FUNCTION ' , ' TRIGGER ' )
627644 ' ' '
628645 val jdbcTemplate = new JdbcTemplate (new SingleConnectionDataSource (conn, true ))
0 commit comments