简体   繁体   中英

Grant Tables and Views privileges in Oracle SQL

So I know how to grant privileges on tables:

GRANT SELECT, INSERT, UPDATE, DELETE ON table TO person;

But I was told to grant privileges to 'person' for all tables and views and I was wondering if the above code also grants privileges for views as well or is there another way to do that?

Thanks a ton!

The same code also can be used for views and even stored procedures. Commonly you would want access to update data in a table:

GRANT SELECT, INSERT, UPDATE, DELETE ON table TO person;

just SELECT on a view:

GRANT SELECT ON view TO person;

and EXECUTE on a procedure:

GRANT EXECUTE ON proc TO person;

There is some nuance in that. For instance, you can have updatable views (or views with triggers), and you may choose to assign only select and/or insert access to table.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM