[ Pobierz całość w formacie PDF ]
.Oracle defines two types ofprivileges that can be granted to users: system privileges and object privileges.(SeeTables 12.1 and 12.2.)System privileges apply systemwide.The syntax used to grant a system privilege is asfollows:SYNTAX:GRANT system_privilege TO {user_name | role | PUBLIC}[WITH ADMIN OPTION];WITH ADMIN OPTION enables the grantee to grant this privilege to someone else.User Access to ViewsThe following command permits all users of the system to have CREATE VIEW accesswithin their own schema.INPUT:SQL> GRANT CREATE VIEW2 TO PUBLIC;OUTPUT:Grant succeeded.ANALYSIS:The public keyword means that everyone has CREATE VIEW privileges.Obviously,these system privileges enable the grantee to have a lot of access to nearly all thesystem settings.System privileges should be granted only to special users or to userswho have a need to use these privileges.Table 12.1 shows the system privileges you willfind in the help files included with Personal Oracle7.WARNING: Use caution when granting privileges to public.Grantingpublic gives all users with access to the database privileges you may notwant them to have.Table 12.1.System privileges in Oracle7.System Privilege Operations PermittedALTER ANY INDEXAllows the grantees to alter any index in anyschema.ALTER ANY PROCEDUREAllows the grantees to alter any storedprocedure, function, or package in any schema.ALTER ANY ROLEAllows the grantees to alter any role in thedatabase.ALTER ANY TABLEAllows the grantees to alter any table or viewin the schema.ALTER ANY TRIGGERAllows the grantees to enable, disable, orcompile any database trigger in any schema.ALTER DATABASEAllows the grantees to alter the database.ALTER USERAllows the grantees to alter any user.Thisprivilege authorizes the grantee to changeanother user's password or authenticationmethod, assign quotas on any tablespace, setdefault and temporary tablespaces, and assign aprofile and default roles.CREATE ANY INDEXAllows the grantees to create an index on anytable in any schema.CREATE ANY PROCEDUREAllows the grantees to create stored procedures,functions, and packages in any schema.CREATE ANY TABLEAllows the grantees to create tables in anyschema.The owner of the schema containing thetable must have space quota on the tablespace tocontain the table.CREATE ANY TRIGGERAllows the grantees to create a database triggerin any schema associated with a table in anyschema.CREATE ANY VIEWAllows the grantees to create views in anyschema.CREATE PROCEDUREAllows the grantees to create stored procedures,functions, and packages in their own schema.CREATE PROFILEAllows the grantees to create profiles.CREATE ROLEAllows the grantees to create roles.CREATE SYNONYMAllows the grantees to create synonyms in theirown schemas.CREATE TABLEAllows the grantees to create tables in theirown schemas.To create a table, the grantees mustalso have space quota on the tablespace tocontain the table.CREATE TRIGGERAllows the grantees to create a database triggerin their own schemas.CREATE USERAllows the grantees to create users.Thisprivilege also allows the creator to assignquotas on any tablespace, set default andtemporary tablespaces, and assign a profile as partof a CREATE USER statement.CREATE VIEWAllows the grantees to create views in their ownschemas.DELETE ANY TABLEAllows the grantees to delete rows from tablesor views in any schema or truncate tables in anyschema.DROP ANY INDEXAllows the grantees to drop indexes in anyschema.DROP ANY PROCEDUREAllows the grantees to drop stored procedures,functions, or packages in any schema.DROP ANY ROLEAllows the grantees to drop roles.DROP ANY SYNONYMAllows the grantees to drop private synonyms inany schema.DROP ANY TABLEAllows the grantees to drop tables in any schema.DROP ANY TRIGGERAllows the grantees to drop database triggers inany schema.DROP ANY VIEWAllows the grantees to drop views in any schema.DROP USERAllows the grantees to drop users.EXECUTE ANY PROCEDUREAllows the grantees to execute procedures orfunctions (standalone or packaged) or referencepublic package variables in any schema
[ Pobierz całość w formacie PDF ]