创建用户和授权

                       
/*******************************创建用户***********************************/
create user admin identified by admin 
default tablespace users
quota 10m  on users
quota 10m  on temp
quota 10m  on indx
temporary  tablespace  temp
/*
create user 用户名 identified by 密码
default tablespace TS名
quota 10m  on TS名   //数据表空间配额
quota 10m  on TS名   //临时表空间配额
quota 10m  on TS名   //索引表空间配额
temporary  tablespace  TS名
profile  配置文件 
*/
/*********用户授权***********/
grant/revoke 权限 on 对象 to 用户
grant connect,resource to admin; 
 
/*********修改用户************/
alter user admin identified by aaa;
 
/********用户锁定**********/
alter user admin account lock
 
/*******用户解锁*********/
alter user admin account onlock
 
/*********设置密码过期**********/
alter user 用户 password expire
alter user admin password expire
 
/********删除用户************/
drop user 用户 cascade 
drop user admin cascade
注:当前用户在连接时不能删除。
 
/**********预定义角色***********/
connect: DML
resource:DML DDL DCL
dba:  ALL
 
/*********创建角色*************/
 
create  role 名
create role sa
 
/**********绑定授权***********/
grant 角色 TO 用户
grant sa to admin
 
/*********为角色设置口令**********/
create role 名 identified by 密码
create role accp identified by admin
 
 
 
posted @ 2009-04-28 23:43  温景良(Jason)  Views(229)  Comments(0Edit  收藏  举报