This is more of a theoritical question but I need help ASAP. Here it is:
With the appropriate use of SQL queries, grant as system administrators the required access privileges to a database user named STD01, so he can create a view of a table named CUSTOMER, which belongs to another database user STD00.
Can anyone help me with this?
I know that I have to grant him with the system privilege of CREATE (ANY) VIEW and also give him all the object privileges (SELECT, INSERT, UPDATE & DELETE) on the CUSTOMER table, but I have no idea how can I do that by using SQL...
-
2Is this some kind of homework?Philᵀᴹ– Philᵀᴹ2012年02月01日 18:19:14 +00:00Commented Feb 1, 2012 at 18:19
-
Its a kind of a possible question for an exam I'm having tomorrow, can you help?lephleg– lephleg2012年02月01日 18:42:16 +00:00Commented Feb 1, 2012 at 18:42
1 Answer 1
To grant privilege to create a view:
GRANT CREATE VIEW TO STD01;
To grant the DML privileges:
GRANT SELECT,UPDATE,INSERT,DELETE ON STD00.CUSTOMER TO STD01;
But that's not all of the object privileges. If you did:
GRANT ALL ON STD00.CUSTOMER TO STD01;
you would also give other privileges such as ALTER
, INDEX
, FLASHBACK
, etc.
-
If I grant him only the SELECT privilege, would it still work?lephleg– lephleg2012年02月02日 00:03:30 +00:00Commented Feb 2, 2012 at 0:03
-
2If you just
grant select
andcreate view
then, yes, it will allow you to create a view on thecustomer
table.John Doyle– John Doyle2012年02月02日 00:11:12 +00:00Commented Feb 2, 2012 at 0:11 -
I've just tested this and worked fine, so thats why Im asking. But I guess I'll better write the whole command tomorrow as you did above. You just never know with professors.. Thanks for the help!:)lephleg– lephleg2012年02月02日 00:17:52 +00:00Commented Feb 2, 2012 at 0:17