oracle用户管理、角色权限

  1. 创建用户账号
    简化版:create user rxs identified by mima;
    繁琐版:create user rxs identified by mima
    default tablespace userdb
    quota 10M on userdb
    quota 5M on system
    temporary tablespace temp
    password expire
    account unlock;
  2. 修改用户账户属性
    修改密码:alter user rxs identified by mima2;
    使用户密码过期:alter user rxs password expire;
    修改用户的临时表空间:alter user rxs tempory tablespace temp;
    修改用户的默认表空间:alter user rxs default tablespace userdb;
    修改用户的表空间限额:alter user rxs quota 50M on userdb;
  3. 对用户的锁定与解锁
    锁定:alter user rxs account lock;
    解锁:alter user rxs account unlock;
  4. 查看数据库账户属性
    查看用户账户信息:select * from dba_users;
    查看用户的表空间限额:select * from dba_ts_quotas;
  5. 删除用户
    查找用户相关会话:select sid,serial#,username from v$session;
    终止要被删除的用户相关的会话:alter system kill session '133,45357';
    查看该用户拥有的模式对象:select owner,object_name from dba_objects where owner = 'rxs';
    删除用户:drop user rxs;
    删除用户及对象:drop user rxs cascade;
  6. 查看当前登录数据库的用户
    select username from v$session where type='USER';
  7. 限制用户对资源的消耗-概要文件;

角色权限

connect角色包括的权限:create session、create table、create view、create synonym、create sequence、create database link、create cluster、alter session。

resource角色包括的权限:create table、create procedure、create sequence、create trigger、create type、create cluster、create indextype、create opeator。

posted on 2010-10-09 18:13  冉冉升起  阅读(298)  评论(0编辑  收藏  举报

导航