one, user sys;//system administrator, with the highest authority system;//Local Administrator, sub-high privilege Scott;//Normal user, password default to Tiger, default unlocked
Second, landingSqlplus/ asSysdba//Login sys account sqlplus sys asSysdba//Ditto Sqlplus Scott/Tiger//Login to General user Scott
Third, manage usersCreate UserZhangsan;//under Administrator account, create user Zhangsan alertUserScott identified byTiger//Change Passwordfour, granting permissions1, the default ordinary user Scott is not unlocked by default, cannot do that use, the new user does not have any permissions, must be granted permissions/*Administrator Authorization*/ Grant CreateSession toZhangsan;//Grant Zhangsan user permission to create session, that is, login permissionGrantUnlimited session toZhangsan;//granting Zhangsan users permission to use tablespacesGrant Create Table toZhangsan;//granting permissions to create tables GranteDrop Table toZhangsan;//granting permission to delete a tableGrant Insert Table toZhangsan;//permissions to insert tablesGrant Update Table toZhangsan;//permissions to modify tablesGrant All to Public;//This one is more important, giving all permissions ( All) to all Users ( Public) 2, Oralce strict rights management, ordinary users are also the default can not access each other, need to authorize each other/*Oralce more strict rights management, ordinary users are also the default can not access each other*/ Grant Select onTableName toZhangsan;//Grant Zhangsan users permission to view the specified tableGrant Drop onTableName toZhangsan;//granting permission to delete a tableGrant Insert onTableName toZhangsan;//Grant the Insert permissionGrant Update onTableName toZhangsan;//granting permissions to modify tablesGrant Insert(ID) onTableName toZhangsan;Grant Update(ID) onTableName toZhangsan;//Grant Insert and Modify permissions on specific fields of the specified table, note that only insert and updateGrantAlert All Table toZhangsan;//Grant Zhangsan user alert permission to any tablev. Revoke permissions basic syntax with Grant, the keyword is revoke VI, view permissionsSelect * fromUser_sys_privs;//View all permissions for the current userSelect * fromUser_tab_privs;//to view the permissions used by the user on the tablevii. Table of users of the action table/*You need to precede the table name with a user name, as follows*/ Select * fromZhangsan.tablenameEight, permission pass that is, user A will grant B,B permission to grant the permission of the operation to C again, the command is as follows:GrantAlertTable onTableName toZhangsan withAdminoption;//Key words withAdminoption GrantAlertTable onTableName toZhangsan with Grant option;//Key words with Grantthe option effect is similar to adminNine, role role is a set of permissions, you can give a role to the userCreateRole Myrole;//Create a roleGrant CreateSession toMyrole;//Grant Myrole permission to create sessionGrantMyrole toZhangsan;//roles granted to Zhangsan user MyroleDroprole myrole; deleting roles/*However, some permissions are not granted to the role, such as the unlimited tablespace and the Any keyword*/
Oracle Privilege Grant