Here are examples of Oracle SQL queries to get invalid objects.
Get Invalid Objects of Current User in Oracle
To get the list of invalid objects for the current logged in user, run the following SQL query:
Select object_name, object_type, created, last_ddl_time From user_objects Where status != 'VALID'
The output would the database objects which are invalid.
To get the list of invalid objects for other users, run the following SQL query:
Select owner, object_type, object_name From dba_objects Where status != 'VALID' Order by owner, object_type;
The above SQL query will list out all the invalid objects from all the schemas.
To get the invalid database objects for a particular user, use the following SQL query:
Select object_type, object_name From dba_objects Where status != 'VALID' and owner = 'SCOTT' Order by object_type;
Leave a comment