Oracle: get a list of functions for a user

How do I get a list of all the functions for a specific user?

EDIT to clarify the question:

When (like USER1) I run

select * from all_objects where owner = 'USER2' and object_type = 'FUNCTION'; 

it does not return all functions that, as I know, belong to USER2. I suspect that it only returns functions that USER1 is allowed to view / execute.

Is this suspicion right?

Also, if so, is there a way around this?

+4
source share
3 answers

Yes, your suspicion is true. The ALL_OBJECTS view will list only those items that the current user has access to.

If you can log in as USER2, you can request USER_OBJECTS as this user to view all objects belonging to this user.

If you can log in as SYSTEM, you will have access to all objects regardless of the owner, so the list provided by ALL_OBJECTS (or DBA_OBJECTS) will be completed.

If you cannot log in as a user with access to all USER2 objects, then you cannot list all USER2 objects.

+4
source

If you mean a list of functions belonging to a specific user, then:

 select object_name from all_objects where owner = 'WHOEVER' and object_type = 'FUNCTION'; 

This will return only stand-alone functions, not procedures or functions in packages that belong to the WHOEVER scheme.

To get a list of all functions that the current user can access:

 select object_name from all_objects where object_type = 'FUNCTION'; 
+3
source

select * from dba_objects where owner = 'USER2' and object_type = 'FUNCTION';

0
source

Source: https://habr.com/ru/post/1311521/


All Articles