在Oracle 10g中,如何列出模式对象以及我可以授予它们的权限?

时间:2021-07-19 12:56:34

Using SQL, I would like to create a list of certain schema objects (3-4 of them, tables and views) and the privileges I can grant them as the SYS user, or any other user I may be logged in as.

使用SQL,我想创建一个特定模式对象的列表(其中3-4个,表和视图)以及我可以授予它们作为SYS用户或我可能登录的任何其他用户的权限。

2 个解决方案

#1


2  

Here is a list of pre-defined Oracle Object privileges available for different type of schema objects. http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9013.htm#i2077938

以下是可用于不同类型的架构对象的预定义Oracle Object权限的列表。 http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9013.htm#i2077938

In order for a user to grant object privileges (any one of the pre-defined object privileges mentioned above) to other users, the user must be the owner of the object or the user must have been granted the object privileges WITH GRANT OPTION. Otherwise, the user must have been given "GRANT ANY OBJECT PRIVILEGE" system privilege.

为了使用户将对象权限(上面提到的任何一个预定义对象权限)授予其他用户,用户必须是该对象的所有者,或者必须已授予用户WITH GRANT OPTION对象权限。否则,必须为用户授予“GRANT ANY OBJECT PRIVILEGE”系统特权。

Suppose, when user U1 logs in,

假设,当用户U1登录时,

1) To get a list of objects owned by the user which could be granted to other users

1)获取用户拥有的对象列表,该列表可以授予其他用户

SELECT object_name FROM user_objects;

2) To get the list of object grants given to user U1, that could be granted to other users by U1.

2)获取给予用户U1的对象授权列表,可以由U1授予其他用户。

SELECT grantor, grantee, table_name, owner 
  FROM user_tab_privs 
 WHERE grantee = 'U1' and grantable = 'YES'

3) To see whether U1 has GRANT ANY OBJECT PRIVILEGE, query

3)要查看U1是否具有GRANT ANY OBJECT PRIVILEGE,请查询

SELECT * FROM user_sys_privs where privilege = 'GRANT ANY OBJECT PRIVILEGE';

#2


0  

sys can grant anything.

sys可以授予任何东西。

and the object themselves will come from one or more of the oracle data dictionary objects.

对象本身将来自一个或多个oracle数据字典对象。

#1


2  

Here is a list of pre-defined Oracle Object privileges available for different type of schema objects. http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9013.htm#i2077938

以下是可用于不同类型的架构对象的预定义Oracle Object权限的列表。 http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9013.htm#i2077938

In order for a user to grant object privileges (any one of the pre-defined object privileges mentioned above) to other users, the user must be the owner of the object or the user must have been granted the object privileges WITH GRANT OPTION. Otherwise, the user must have been given "GRANT ANY OBJECT PRIVILEGE" system privilege.

为了使用户将对象权限(上面提到的任何一个预定义对象权限)授予其他用户,用户必须是该对象的所有者,或者必须已授予用户WITH GRANT OPTION对象权限。否则,必须为用户授予“GRANT ANY OBJECT PRIVILEGE”系统特权。

Suppose, when user U1 logs in,

假设,当用户U1登录时,

1) To get a list of objects owned by the user which could be granted to other users

1)获取用户拥有的对象列表,该列表可以授予其他用户

SELECT object_name FROM user_objects;

2) To get the list of object grants given to user U1, that could be granted to other users by U1.

2)获取给予用户U1的对象授权列表,可以由U1授予其他用户。

SELECT grantor, grantee, table_name, owner 
  FROM user_tab_privs 
 WHERE grantee = 'U1' and grantable = 'YES'

3) To see whether U1 has GRANT ANY OBJECT PRIVILEGE, query

3)要查看U1是否具有GRANT ANY OBJECT PRIVILEGE,请查询

SELECT * FROM user_sys_privs where privilege = 'GRANT ANY OBJECT PRIVILEGE';

#2


0  

sys can grant anything.

sys可以授予任何东西。

and the object themselves will come from one or more of the oracle data dictionary objects.

对象本身将来自一个或多个oracle数据字典对象。