权限最大的用户是: sysdba和sysoper
create user zhangsan identified by mima; 创建完的用户没有任何权限,包括登录的权限都没有。
grant create tablespace,connect to zhangsan;
创建会话:grant create session to 用户名; 创建表:grant create table to 用户名; 创建视图: 创建序列: 创建过程:
alter user scott identified by tiger;
①授予在emp表上进行查询的权限: grant select on emp to sue,rich;
②为用户和角色授予dept表上的某些列的修改权限: grant update(dname, loc) on dept to jack,john;
③with grant option: 被授权的用户还能把权限给其他人。 grant insert, select on dept to tom with grant option;
④to public : 允许系统中所有用户访问Alice的dept表: grant select on alice.dept to public;
revoke select, insert on dept from scott;
注意: 假设Scott把权限给了A,A把权限给了B,那么Scott只能收回A的权限,而不能收回B的权限。 如果Scott收回了A的权限,相应的B的权限也不存在了。
Oracle用角色来简化对权限的管理。
create role manage;
grant create table,create view to manage;
grant connect, resource to 开发者;
其中,connect和resource是dba默认的角色。
