oracle 可grant/revoke的系统权限与对象权限—汇(英文)

With the GRANT statement you can grant: 

  • System privileges to users and roles.
  • Roles to users and roles. Both privileges and roles are either local, global, or external.
  • Object privileges for a particular object to users, roles, and PUBLIC.

To grant a system privilege, you must either have been granted the system privilege with the ADMIN OPTION or have been granted the GRANT ANY PRIVILEGE system privilege.  

To grant a role, you must either have been granted the role with the ADMIN OPTION or have been granted the GRANT ANY ROLE system privilege, or you must have created the role.  

To grant an object privilege, you must own the object, or the owner of the object must have granted you the object privileges with the GRANT OPTION, or you must have been granted the GRANT ANY OBJECT PRIVILEGE system privilege. If you have the GRANT ANY OBJECT PRIVILEGE, then you can grant the object privilege only if the object owner could have granted the same object privilege. In this case, the GRANTOR column of the DBA_TAB_PRIVS view displays the object owner rather than the user who issued the GRANT statement.  

Syntax

System privileges
grant (system privilege/role/ALL PRIVILEGES) to (user/role/PUBLIC) [with admin option];
For example: grant create table to user1; grant  

Object privileges
For example: grant select on emp to user1; grant select,insert,update,delete on emp to user2; grant select on emp to public;  

To undo a granted privilege, you can use the REVOKE statement. Syntax: revoke (system privilege/role/ALL PRIVILEGES) from (user/role/PUBLIC);
revoke select,delete on emp from user2; revoke all on emp from user2;  

System Privileges

The following system privileges can be granted:

ADVISORAccess the advisor framework through PL/SQL packages such as DBMS_ADVISOR and DBMS_SQLTUNE.
ADMINISTER SQL TUNING SETCreate, drop, select (read), load (write), and delete a SQL tuning set owned by the grantee through the DBMS_SQLTUNE package.
ADMINISTER ANY SQL TUNING SETCreate, drop, select (read), load (write), and delete a SQL tuning set owned by any user through the DBMS_SQLTUNE package.
CREATE ANY SQL PROFILEAccept a SQL Profile recommended by the SQL Tuning Advisor, which is accessed through Enterprise Manager or by the DBMS_SQLTUNE package.
DROP ANY SQL PROFILEDrop an existing SQL Profile.
ALTER ANY SQL PROFILEAlter the attributes of an existing SQL Profile.
CREATE CLUSTERCreate clusters in the grantee’s schema.
CREATE ANY CLUSTERCreate a cluster in any schema. Behaves similarly to CREATE ANY TABLE.
ALTER ANY CLUSTERAlter clusters in any schema.
DROP ANY CLUSTERDrop clusters in any schema.
CREATE ANY CONTEXTCreate any context namespace.
DROP ANY CONTEXTDrop any context namespace.
ALTER DATABASEAlter the database.
ALTER SYSTEMIssue ALTER SYSTEM statements.
AUDIT SYSTEMIssue AUDIT statements.
CREATE DATABASE LINKCreate private database links in the grantee’s schema.
CREATE PUBLIC DATABASE LINKCreate public database links.
DROP PUBLIC DATABASE LINKDrop public database links.
DEBUG CONNECT SESSIONConnect the current session to a debugger.
DEBUG ANY PROCEDUREDebug all PL/SQL and Java code in any database object. Display information on all SQL statements executed by the application. Note: Granting this privilege is equivalent to granting the DEBUG object privilege on all applicable objects in the database.
CREATE DIMENSIONCreate dimensions in the grantee’s schema.
CREATE ANY DIMENSIONCreate dimensions in any schema.
ALTER ANY DIMENSIONAlter dimensions in any schema.
DROP ANY DIMENSIONDrop dimensions in any schema.
CREATE ANY DIRECTORYCreate directory database objects.
DROP ANY DIRECTORYDrop directory database objects.
CREATE INDEXTYPECreate an indextype in the grantee’s schema.
CREATE ANY INDEXTYPECreate an indextype in any schema and create a comment on an indextype in any schema.
ALTER ANY INDEXTYPEModify indextypes in any schema.
DROP ANY INDEXTYPEDrop an indextype in any schema.
EXECUTE ANY INDEXTYPEReference an indextype in any schema.
CREATE ANY INDEXCreate in any schema a domain index or an index on any table in any schema.
ALTER ANY INDEXAlter indexes in any schema.
DROP ANY INDEXDrop indexes in any schema.
 
CREATE JOBCreate jobs, schedules, or programs in the grantee’s schema.
CREATE ANY JOBCreate, alter, or drop jobs, schedules, or programs in any schema. Note: This extremely powerful privilege allows the grantee to execute code as any other user. It should be granted with caution.
CREATE EXTERNAL JOBCreate in the grantee’s schema an executable scheduler job that runs on the operating system.
EXECUTE ANY PROGRAMUse any program in a job in the grantee’s schema.
EXECUTE ANY CLASSSpecify any job class in a job in the grantee’s schema.
MANAGE SCHEDULERCreate, alter, or drop any job class, window, or window group.
CREATE LIBRARYCreate external procedure or function libraries in the grantee’s schema.
CREATE ANY LIBRARYCreate external procedure or function libraries in any schema.
DROP ANY LIBRARYDrop external procedure or function libraries in any schema.
CREATE MATERIALIZED VIEWCreate a materialized view in the grantee’s schema.
CREATE ANY MATERIALIZED VIEWCreate materialized views in any schema.
ALTER ANY MATERIALIZED VIEWAlter materialized views in any schema.
DROP ANY MATERIALIZED VIEWDrop materialized views in any schema.
QUERY REWRITEThis privilege has been deprecated. No privileges are needed for a user to enable rewrite for a materialized view that references tables or views in the user’s own schema.
GLOBAL QUERY REWRITEEnable rewrite using a materialized view when that materialized view references tables or views in any schema.
ON COMMIT REFRESHCreate a refresh-on-commit materialized view on any table in the database. Alter a refresh-on-demand materialized on any table in the database to refresh-on-commit.
FLASHBACK ANY TABLEIssue a SQL Flashback Query on any table, view, or materialized view in any schema. This privilege is not needed to execute the DBMS_FLASHBACK procedures.
CREATE OPERATORCreate an operator and its bindings in the grantee’s schema.
CREATE ANY OPERATORCreate an operator and its bindings in any schema and create a comment on an operator in any schema.
ALTER ANY OPERATORModify an operator in any schema.
DROP ANY OPERATORDrop an operator in any schema.
EXECUTE ANY OPERATORReference an operator in any schema.
CREATE ANY OUTLINECreate public outlines that can be used in any schema that uses outlines.
ALTER ANY OUTLINEModify outlines.
DROP ANY OUTLINEDrop outlines.
CREATE PROCEDURECreate stored procedures, functions, and packages in the grantee’s schema.
CREATE ANY PROCEDURECreate stored procedures, functions, and packages in any schema.
ALTER ANY PROCEDUREAlter stored procedures, functions, or packages in any schema.
DROP ANY PROCEDUREDrop stored procedures, functions, or packages in any schema.
EXECUTE ANY PROCEDUREExecute procedures or functions, either standalone or packaged.
CREATE PROFILECreate profiles.
ALTER PROFILEAlter profiles.
DROP PROFILEDrop profiles.
CREATE ROLECreate roles.
ALTER ANY ROLEAlter any role in the database.
DROP ANY ROLEDrop roles.
GRANT ANY ROLEGrant any role in the database.
CREATE ROLLBACK SEGMENTCreate rollback segments.
ALTER ROLLBACK SEGMENTAlter rollback segments.
DROP ROLLBACK SEGMENTDrop rollback segments.
CREATE SEQUENCECreate sequences in the grantee’s schema.
CREATE ANY SEQUENCECreate sequences in any schema.
ALTER ANY SEQUENCEAlter any sequence in the database.
DROP ANY SEQUENCEDrop sequences in any schema.
SELECT ANY SEQUENCEReference sequences in any schema.
CREATE SESSIONConnect to the database.
ALTER RESOURCE COSTSet costs for session resources.
ALTER SESSIONIssue ALTER SESSION statements.
RESTRICTED SESSIONLogon after the instance is started using the SQL*Plus STARTUP RESTRICT statement.
CREATE SYNONYMCreate synonyms in the grantee’s schema.
CREATE ANY SYNONYMCreate private synonyms in any schema.
CREATE PUBLIC SYNONYMCreate public synonyms.
DROP ANY SYNONYMDrop private synonyms in any schema.
DROP PUBLIC SYNONYMDrop public synonyms.
CREATE TABLECreate tables in the grantee’s schema.
CREATE ANY TABLECreate tables in any schema. The owner of the schema containing the table must have space quota on the tablespace to contain the table.
ALTER ANY TABLEAlter any table or view in any schema.
BACKUP ANY TABLEUse the Export utility to incrementally export objects from the schema of other users.
DELETE ANY TABLEDelete rows from tables, table partitions, or views in any schema.
DROP ANY TABLEDrop or truncate tables or table partitions in any schema.
INSERT ANY TABLEInsert rows into tables and views in any schema.
LOCK ANY TABLELock tables and views in any schema.
SELECT ANY TABLEQuery tables, views, or materialized views in any schema.
FLASHBACK ANY TABLEIssue a SQL Flashback Query on any table, view, or materialized view in any schema. This privilege is not needed to execute the DBMS_FLASHBACK procedures.
UPDATE ANY TABLEUpdate rows in tables and views in any schema.
CREATE TABLESPACECreate tablespaces.
ALTER TABLESPACEAlter tablespaces.
DROP TABLESPACEDrop tablespaces.
MANAGE TABLESPACETake tablespaces offline and online and begin and end tablespace backups.
UNLIMITED TABLESPACEUse an unlimited amount of any tablespace. This privilege overrides any specific quotas assigned. If you revoke this privilege from a user, then the user’s schema objects remain but further tablespace allocation is denied unless authorized by specific tablespace quotas. You cannot grant this system privilege to roles.
CREATE TRIGGERCreate a database trigger in the grantee’s schema.
CREATE ANY TRIGGERCreate database triggers in any schema.
ALTER ANY TRIGGEREnable, disable, or compile database triggers in any schema.
DROP ANY TRIGGERDrop database triggers in any schema.
ADMINISTER DATABASE TRIGGERCreate a trigger on DATABASE. You must also have the CREATE TRIGGER or CREATE ANY TRIGGER system privilege.
CREATE TYPECreate object types and object type bodies in the grantee’s schema.
CREATE ANY TYPECreate object types and object type bodies in any schema.
ALTER ANY TYPEAlter object types in any schema.
DROP ANY TYPEDrop object types and object type bodies in any schema.
EXECUTE ANY TYPEUse and reference object types and collection types in any schema, and invoke methods of an object type in any schema if you make the grant to a specific user. If you grant EXECUTE ANY TYPE to a role, then users holding the enabled role will not be able to invoke methods of an object type in any schema.
UNDER ANY TYPECreate subtypes under any nonfinal object types.
CREATE USERCreate users. This privilege also allows the creator to: Assign quotas on any tablespace. Set default and temporary tablespaces. Assign a profile as part of a CREATE USER statement.
ALTER USERAlter any user. This privilege authorizes the grantee to: Change another user’s password or authentication method. Assign quotas on any tablespace. Set default and temporary tablespaces. Assign a profile and default roles.
DROP USERDrop users
CREATE VIEWCreate views in the grantee’s schema.
CREATE ANY VIEWCreate views in any schema.
DROP ANY VIEWDrop views in any schema.
UNDER ANY VIEWCreate subviews under any object views.
FLASHBACK ANY TABLEIssue a SQL Flashback Query on any table, view, or materialized view in any schema. This privilege is not needed to execute the DBMS_FLASHBACK procedures.
MERGE ANY VIEWIf a user has been granted the MERGE ANY VIEW privilege, then for any query issued by that user, the optimizer can use view merging to improve query performance without performing the checks that would otherwise be performed to ensure that view merging does not violate any security intentions of the view creator. See also Oracle Database Reference for information on the OPTIMIZER_SECURE_VIEW_MERGING parameter and Oracle Database Performance Tuning Guide for information on view merging.
ANALYZE ANYAnalyze any table, cluster, or index in any schema.
AUDIT ANYAudit any object in any schema using AUDIT schema_objects statements.
CHANGE NOTIFICATIONCreate a registration on queries and receive database change notifications in response to DML or DDL changes to the objects associated with the registered queries. Please refer to Oracle Database Application Developer’s Guide – Fundamentals for more information on database change notification.
COMMENT ANY TABLEComment on any table, view, or column in any schema.
EXEMPT ACCESS POLICYBypass fine-grained access control. Caution: This is a very powerful system privilege, as it lets the grantee bypass application-driven security policies. Database administrators should use caution when granting this privilege.
FORCE ANY TRANSACTIONForce the commit or rollback of any in-doubt distributed transaction in the local database. Induce the failure of a distributed transaction.
FORCE TRANSACTIONForce the commit or rollback of the grantee’s in-doubt distributed transactions in the local database.
GRANT ANY OBJECT PRIVILEGEGrant any object privilege that the object owner is permitted to to grant. Revoke any object privilege that was granted by the object owner or by some other user with the GRANT ANY OBJECT PRIVILEGE privilege.
GRANT ANY PRIVILEGEGrant any system privilege.
RESUMABLEEnable resumable space allocation.
SELECT ANY DICTIONARYQuery any data dictionary object in the SYS schema. This privilege lets you selectively override the default FALSE setting of the O7_DICTIONARY_ACCESSIBILITY initialization parameter.
SELECT ANY TRANSACTIONQuery the contents of the FLASHBACK_TRANSACTION_QUERY view. Caution: This is a very powerful system privilege, as it lets the grantee view all data in the database, including past data. This privilege should be granted only to users who need to use the Oracle Flashback Transaction Query feature.
SYSDBAPerform STARTUP and SHUTDOWN operations.
CREATE DATABASE 
ARCHIVELOG and RECOVERY 
CREATE SPFILEIncludes the RESTRICTED SESSION privilege.
SYSOPERPerform STARTUP and SHUTDOWN operations.
ALTER DATABASEopen, mount, or back up.
ARCHIVELOG and RECOVERY. 
CREATE SPFILE.Includes the RESTRICTED SESSION privilege.
CONNECT, RESOURCE, and DBAThese roles are provided for compatibility with previous versions of Oracle Database. You can determine the privileges encompassed by these roles by querying the DBA_SYS_PRIVS data dictionary view. Note: Oracle recommends that you design your own roles for database security rather than relying on these roles. These roles may not be created automatically by future versions of Oracle Database.
DELETE_CATALOG_ROLE EXECUTE_CATALOG_ROLE SELECT_CATALOG_ROLEThese roles are provided for accessing data dictionary views and packages.
EXP_FULL_DATABASEprovided for convenience in using the export utility.
IMP_FULL_DATABASEprovided for convenience in using the import utility.
AQ_USER_ROLE 
AQ_ADMINISTRATOR_ROLEYou need these roles to use Oracle Advanced Queuing.
SNMPAGENTThis role is used by the Enterprise Manager Intelligent Agent.
RECOVERY_CATALOG_OWNERYou need this role to create a user who owns a recovery catalog.

The following object privileges are possible:

ALTERChange the table/sequence definition with the ALTER TABLE/ALTER SEQUENCE statement.
DELETERemove rows from the table/view with the DELETE statement. Note: You must grant the SELECT privilege on the table along with the DELETE privilege if the table is on a remote database.
DEBUGAccess, through a debugger
INDEXCreate an index on the table with the CREATE INDEX statement.
INSERTAdd new rows to the table/view with the INSERT statement.
REFERENCESCreate a constraint that refers to the table/view. You cannot grant this privilege to a role.
SELECTQuery the table/view/sequence/materialized view with the SELECT statement.
UPDATEChange data in the table/view with the UPDATE statement.
UNDERCreate a subview under this view. You can grant this object privilege only if you have the UNDER ANY VIEW privilege WITH GRANT OPTION on the immediate superview of this view.
EXECUTEExecute the procedure/function/object/indextype/operator directly, or access any program object declared in the specification of a package, or compile the object implicitly during a call to a currently invalid or uncompiled function or procedure. This privilege does not allow the grantee to explicitly compile using ALTER PROCEDURE or ALTER FUNCTION. For explicit compilation you need the appropriate ALTER system privilege.
ON COMMIT REFRESHCreate a refresh-on-commit materialized view on the specified table.
QUERY REWRITECreate a materialized view for query rewrite using the specified table.
READRead files in the directory.
WRITEWrite files in the directory. This privilege is useful only in connection with external tables. It allows the grantee to determine whether the external table agent can write a log file or a bad file to the directory. Restriction: This privilege does not allow the grantee to write to a BFILE.

转载自:http://blog.csdn.net/galdys/article/details/6362501

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值