Created
May 20, 2014 17:37
-
-
Save mujahidk/be1008d2178ebb9f3030 to your computer and use it in GitHub Desktop.
Oracle: Script to find invalid objects, errors and way to compile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Query to find the invalid user objects in Oracle DB | |
SELECT OBJECT_NAME, | |
OBJECT_TYPE, | |
STATUS | |
FROM USER_OBJECTS | |
WHERE object_type IN ('PROCEDURE', 'TRIGGER', 'TABLE', 'VIEW', 'FUNCTION', 'INDEX') | |
AND STATUS ='INVALID'; | |
--Query to find database view errors in the Oracle DB. | |
SELECT * FROM ALL_ERRORS WHERE TYPE = 'VIEW' ORDER BY SEQUENCE ASC; | |
-- Recompile a view | |
ALTER VIEW <VIEW_NAME> COMPILE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment