📜  oracle list grants on procedure - SQL (1)

📅  最后修改于: 2023-12-03 15:03:23.650000             🧑  作者: Mango

Oracle List Grants on Procedure - SQL

When working with Oracle database procedures, it is important to understand the access and privileges associated with them. This is especially important in cases where multiple users or roles have access to the same procedure.

To view the grants on a procedure in Oracle database, the following SQL command can be used:

SELECT grantee, grantor, privilege, grantable
FROM dba_tab_privs
WHERE owner = '&proc_owner'
AND table_name = '&proc_name';

This command will return a list of the users and roles that have been granted privileges on the specified procedure, along with information about the privileges that have been granted and whether they are grantable.

It is important to note that this command will only work for database administrators, as it requires access to the dba_tab_privs view. If you do not have access to this view, you can use the following alternative command:

SELECT grantee, privilege
FROM user_tab_privs_made
WHERE table_name = '&proc_name';

This command will return a list of the privileges that you have granted on the specified procedure, along with the users or roles that have been granted those privileges.

In both cases, the proc_owner and proc_name variables should be replaced with the owner and name of the procedure that you want to view grants for.

Overall, understanding permissions and access on database procedures is an important part of managing and securing an Oracle database. With the right SQL commands and tools, you can easily view and manage these grants as needed.