传智播客_ORACLE经典视频教程 学习记录
sqlplus lanjh/lanjh
disconn lanjh;
conn lanjh;
3个默认的用户
sys
system
scott
系统权限
grant create session to lanjh;
grant create table to lanjh;
grant unlimited tablespace to lanjh;
revoke create session from lanjh;
revoke create table from lanjh;
revoke unlimited tablespace from lanjh;
grant create session to public;
select * from user_sys_privs;
对象权限
grant select on mytab to lanjh;
grant all on mytab to lanjh;
revoke select on mytab from lanjh;
revoke all on mytab from lanjh;
select * from user_tab_privs;
对象权限可以控制到列
grant update (name) on mytab to lanjh;
grant insert (id) on mytab to lanjh;
select * from user_col_privs;
注意:查询和删除不能控制到列。
ddl数据定义语言 dml数据操纵语言 dcl数据控制语言
权限的传递
grant alter any table to lanjh with admin option;
grant select on A to lanjh with grant option;
角色
create role myrole;
grant create session to myrole;
drop role myrole;
注意 有些系统权限无法直接赋予角色的
create table create any table
[alter table] alter any table
[drop table] drop any table
表是属于某一个用户的。
角色不属于某个