Monday, April 20, 2009

Get all DB objects

Get all DB objects including: table, view, stored procedure, function
SELECT OBJECT_ID, OBJECT_NAME, OBJECT_TYPE, OWNER
FROM all_objects
WHERE OBJECT_TYPE IN ('TABLE', 'VIEW', 'PROCEDURE', 'FUNCTION')
ORDER BY OBJECT_TYPE, OBJECT_NAME

If you want to exclude system objects:
SELECT OBJECT_ID, OBJECT_NAME, OBJECT_TYPE, OWNER
FROM all_objects
WHERE OBJECT_TYPE IN ('TABLE', 'VIEW', 'PROCEDURE', 'FUNCTION')
AND OWNER NOT IN ('SYS', 'SYSTEM')
ORDER BY OBJECT_TYPE, OBJECT_NAME

No comments:

Post a Comment