Reputation: 5976
I have two users : Schema1 and Schema2
How to grant Create Table privilege On Schema2 to Schema1 ?
I have been turning around and I got confused. I tried :
From Schema2 I tried,
GRANT CREATE TABLE TO SCHEMA1 WITH ADMIN OPTION;
But it seems like this grants Creating table to Schema1 in its own Schema and not in the Schema2.
Any ideas please ?
Thank you.
Upvotes: 13
Views: 144302
Reputation: 4158
The only other way to allow a non-DBA user to create a table in another schema is to give the user the CREATE ANY TABLE
system privilege.
This privilege can only be given to SCHEMA1 by a user having the CREATE ANY PRIVILEGE
privilege.
Upvotes: 22
Reputation: 41
Better solution (minimizes the security threat that comes with CREATE ANY TABLE
privilege...)
GRANT EXECUTE ON schema2.procedure_name TO schema1;
It's a simple concept ... I've used such concepts in my previous job.
Upvotes: 4
Reputation: 40603
You want to grant create ANY table
:
grant create any table to schema1;
The any
"modifier" allows to create tables in other than own schemas.
Upvotes: 7