Oracle用户 角色 权限1.创建用户;
create user cheng identified by 123 ;
create user litao identified by 123 default tablespace users quota 10M on users;
2.赋予新用户权限;
grant create session to cheng ;
grant connect ,resource to cheng;
grant create session,create table,create view to cheng;
// 为用户赋予在某用户某张表中操作的权限:
grant select ,delete on scott.emp to cheng ;
// connect角色将允许用户连接数据库并在数据库中创建表或其它对角
grant connect to cheng ;
// resource角色将允许用户使用数据库中的空间
grant resource to cheng ;
// create sequence权限将允许用户创建序列,此权限包含在connect连接角色中
grant create sequence to cheng ;
3.修改用户密码;
alter user cheng identified by abc;
将用户密码设为过期:
alter user cheng password expire ;
4.为用户加锁(锁定用户);
alter user cheng account lock;
为用户解锁:
alter user cheng account unlock ;
5.收回用户权限;
revoke select on scott.emp from cheng;
6.连接用户;
connect sys/123 as sysdba; // 以DBA的身份连接到sys用户
在DOS下,以匿名的身份进入到sqlplus:
sqlplus.exe / as sysdba;
sqlplus/nolog
注意:该登录方式经常用于用户名/密码错误,无法登陆时,进入到sqlplus中进行用户的修改操作。