0

在 Oracle 中,表“MyTable”归“User1”所有,如何将表访问权限授予另一个用户,比如“User2”?

在 SQL Server 中,我们有一些应用程序访问权限,Oracle 有吗?

4

1 回答 1

2

You can grant SELECT privileges (or INSERT, UPDATE, DELETE, and a few others like REFERENCES) to a user

GRANT SELECT 
   ON user1.MyTable
   TO user2

It would be more common, though, to create a role, grant the privileges to the role, and then grant the role to whatever users need it, i.e.

CREATE ROLE user1_select;

GRANT SELECT 
   ON user1.MyTable
   TO user1_select;

GRANT user1_select
   TO user2;

That makes it easier in the future to grant a single role to more users and to ensure that all the users with a specific job function have the same set of roles rather than trying to make sure that you've granted everyone access to exactly the same set of objects.

于 2012-05-23T20:26:49.687 回答