select owner, name, type, '"'||listagg(distinct replace(text, chr(10), ''), ';') within group (order by text)||'"' as errors
from dba_errors where (owner, name) in (
  SELECT 
    owner, object_name
  FROM dba_objects 
  WHERE 
      owner IN (SELECT username FROM dba_users WHERE oracle_maintained <> 'Y') 
  AND status='INVALID' 
  AND object_type IN ('PACKAGE BODY', 'TYPE', 'SYNONYM', 'TRIGGER', 'PROCEDURE', 'VIEW', 'FUNCTION')
)
group by owner, name, type
order by owner, name, type;

-- indexes
SELECT 
*--owner, index_name, table_name
FROM dba_indexes 
WHERE 
  owner IN (SELECT username FROM dba_users WHERE oracle_maintained <> 'Y') 
AND status<>'VALID' 
; 

-- ods
select  
owner, name, type, 
listagg(distinct referenced_type||' '||referenced_owner||'.'||referenced_name, ';')  as referenced_object --||'"'
from dba_dependencies where owner in (select username from dba_users where oracle_maintained = 'N') 
and name in (
'SP_SPACEMANAGER', 'V_ALL_ASSETS', 'V_ALL_ASSETS_ADD_GUARANTOR', 'V_ALL_ASSETS_FXSC', 'V_ALL_ASSETS_IAB', 
'V_ALL_ASSETS_IRSP', 'V_ALL_ASSETS_LSP', 'V_ALL_ASSETS_ORIGINATOR', 'V_ALL_ASSETS_SERVICER', 'V_LM_FORECAST', 
'DBA_OBJECTS', 'DBA_USERS', 'DBA_OBJECTS', 'DBA_USERS'
)
group by owner, name, type
order by owner, name
;

-- mopdb
select  
owner, name, type, 
listagg(distinct referenced_type||' '||referenced_owner||'.'||referenced_name, ';')  as referenced_object --||'"'
from dba_dependencies where owner in (select username from dba_users where oracle_maintained = 'N') --('SYS', 'APEX_230200', 'CTXSYS', 'GSMADMIN_INTERNAL', 'LBACSYS', 'AUDSYS')
and name in (
'SET_OR_UNSET_CACHING', 'STANDINGFACILITIESPROC', 'SET_OR_UNSET_CACHING', 'CHARTPACK_AG_CODES', 'CHARTPACK_ASSET_GROUPS', 
'PKG_CORR_WITH_EADB', 'SET_OR_UNSET_CACHING', 'SNAPSHOT_DATES', 'SNAPSHOT_DATES_MONTHLY', 'SNAPSHOT_DATES_QUARTERLY', 
'V_BANKGROUPS', 'V_BANKGROUPS_CURRENT', 'V_STANDING_FACILITIES', 'SP_SPACEMANAGER', 'LOAD_CHANGES_INSIDE_MOS_LAB', 
'SET_OR_UNSET_CACHING', 'EV_MFI_REQUEST', 'LOAD_MFI_DATA', 'MANAGE_JOB_TEMPLATE', 'PARTITION_ADMIN', 
'SET_OR_UNSET_CACHING', 'V_CL_CURRENT', 'MANAGE_JOB_TEMPLATE', 'CURR_MPECS', 'GRANTXX', 
'LOAD_CHANGES_INSIDE_MOS_LAB', 'MANAGE_JOB_TEMPLATE', 'PARTITION_ADMIN', 'SET_OR_UNSET_CACHING' 
)
group by owner, name, type
order by owner, name
;