Oracle's rookie Grant Grant

Source: Internet
Author: User

<pre name= "code" class= "SQL" >1, grant to database user (object to User table) Grant privilege[, ...] On object[, ...] to {public | GROUP group| Username}privilege:select: Querying insert: Inserting update: Updating delete: Deleting Rule:all: All Grant Select,insert,update on TableName to public ; Grant all users the ability to query, insert, UPDATE tablename tables revoke select,insert,update on TableName from public;//retract all user queries, inserts, Permissions to update tablename tables object:table: Table view: View sequence: Sequence index: Index grant select,insert,update on Tablename,viewname, Sequencename,indexname to Public;public: Open permissions for all Users group groupname: Open permissions for all users of the group username: Open permissions to the specified user 2, to the database user authorization (more objects are system tables, such as the table that the DBA can view) grant DBA to username; without granting DBA authority to users, users will not be able to view system tables such as V$datafile,dba_data_files revoke DBA from username;// Reclaim DBA Authority for user username Note: If you use PL/SQL to log in, you need to re-login (initial understanding, error) after authentication, do not need to re-login, only need to reopen a session to understand: All permissions operations of the database are in session units, If the current session does not have DBA authority, even if the permission has been re-assigned, it will not work in the current session and if the current session has DBA authority and the latter cancels the permissions, then the DBA authority of the current session does not disappear. Grant connect to username; Do not grant connect permission to new users, new users cannot connect to the DB instance through SIDs or SERVICE_NAME, that is, they cannot log on to the database revoke connect to username;// Reclaim connect rights to user username grant resource To username with admin option;grant Unlimited tablespace to username with admin option; New user cannot create TABLE resource without granting revoke permission to new user Esource from username;//resource permissions for user Reclaim 3, to see what system permissions are available for a specified user select * from Dba_role_privs where Grantee=upper (' username '); 4, View the object permissions for the specified user select * from Dba_tab_privs where Grantee=upper (' username '); possible problems: 1, when creating a table on a new database user fails, You can view system permissions on the current user to perform a select * from Dba_role_privs where Grantee=upper (' username '), or if it cannot be performed (the hint table or view does not exist), Description There is no DBA Authority WORKAROUND: You can log on to the SYS account to give DBA authority login Sys:sqlplus/as SYSDBA to username: Grant DBA to username, or you can log in to the SYS account directly, select * FROM Dba_role_privs where Grantee=upper (' username '), if the value of Granted_role does not have a DBA, indicates that there is no DBA authority permission related to the query and given: All permissions are given to the user under the given permission, The authorized user here is SYS user 1, select * from Dba_role_privs where Grantee=upper (' Luyongpeng '), where admin_option is by adding with admin at authorization The option option defines the grant DBA to Luyongpeng with admin option;//admin_option as yes, and if no with the admin option option, admin_option for no uses grant DBA to Luyongpeng; cannot overwrite previous permissions but Grant DBA to Luyongpeng with admin option can override Grant DBA to Luyongpeng;
<pre name= "code" class= "SQL" >2, select * from Dba_sys_privs where Grantee=upper (' Luyongpeng '), this permission can be performed by executing the grant DBA to Luyongpeng; When automatically added, but admin_option defaults to No by Grant unlimited tablespace to luyongpeng with admin option; admin_ option is modified to Yes when revoke DBA from Luyongpeng is executed, the system reclaims both DBA authority and Unlimite tablespace permissions if you want to preserve DBA authority, but Reclaim unlimited tablespace permissions, Can be revoke unlimited tablespace from Luyongpeng;


<pre name= "code" class= "SQL" >3, select * from Dba_tab_privs where Grantee=upper (' Luyongpeng '); This permission shows what permissions the current user has on which tables of owner, and the Grantable field value Yes indicates that Luyongpeng users can continue to open signtest tables to other users


<pre name= "code" class= "SQL" > Execute grant Insert on Signtest to Luyongpeng with Grant Option;grant Delete on Signtest to Luyongpeng with GRANT option, re-query the Dba_tab_privs table information as follows, and you can see that the Grantable field value is yes when the WITH GRANT option is added




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.