'Oracle Privileges to Use Global Temporary Table via Definer's Rights Stored Procedure

Please assume:

User A creates global temporary table gtt.

User A creates stored procedure sp with definer's rights AUTHID DEFINER. For simplicity, assume this sp simply inserts a row into gtt and selects a value from the row in gtt.

User A grants user B execute on sp.

What additional grants, if any, need to be given to users A and B so that B can successfully execute sp?

I've heard that when a global temporary table is used (e.g. data inserted), that the user using the global temporary table needs create table privilege to create the instance of the globaly temporary table in their session's memory (even though the global temporary table itself was already created). Is that true? I assumed granting select and insert on the global temporary table would have been sufficient.

Because sp is defined by A does this mean A needs create any table, so the row of data can be inserted and selected from user B's session memory?

Sorry, I don't currently have access to an Oracle instance where I have enough privileges to try this myself.

Please note, I am not trying to create the global temporary table in the stored procedure.

Using Oracle 19c Enterprise Edition.

Thank you in advance for helping me understand the privileges involved here.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source