###3个默认用户
sys change_on_install[as sysdba]
system manager
scott tiger
###登陆oracle
sqlplus / as sysdba
###创建用户
create user userName
identified by userPwd;
###查询权限
select * from user_sys_privs;
select * from user_tab_privs;
###系统权限
grant create session to userName;
grant create table to userName;
grant unlimited tablespace to userName;
revoke create session from userName;
revoke create tablespace from userName;
revoke unlimited tablespace from userName;
//把create session权限给所有用户
grant create session to public;
//查询权限
select * from user_sys_privs;
对象权限
//查询
select * from user_tab_privs;
grant select on user.db to user2;
//把user.db的所有权限给user2
grant all on user.db to user2;
revoke select on user.db from user2;
//撤销user.db的所有权限
revoke all on user.db from user2;
###对象权限可以控制到列
grant update(name) on mydb to user2;
grant insert(name) on mydb to user2;
注意:查询和删除不能控制到列!
revoke update on mydb from user2;
revoke insert on mydb from user2;