oracle用户操作

来源:互联网 发布:apache性能监控 编辑:程序博客网 时间:2024/05/21 12:42

------------------------------oracle 用户解锁

alter user scott account unlock;

解锁后要改密码

alter user scott identified by tiankong;


-----------------------------创建用户

创建用户和密码

create user a179952270identified by tiankong

设置默认的表间
default tablespace qis_data  

设置默认的临时表空间
temporary tablespace qis_temp;  


---------------------------用户授权

1、默认的普通用户scott默认未解锁,不能进行那个使用,新建的用户也没有任何权限,必须授予权限

grant create session to zhangsan;//授予zhangsan用户创建session的权限,即登陆权限

grant unlimited tablespace to zhangsan;//授予zhangsan用户使用表空间的权限

grant create table to zhangsan;//授予创建表的权限

grante drop table to zhangsan;//授予删除表的权限

grant insert table to zhangsan;//插入表的权限

grant update table to zhangsan;//修改表的权限

grant all to public;//这条比较重要,授予所有权限(all)给所有用户(public)



2、oralce对权限管理比较严谨,普通用户之间也是默认不能互相访问的,需要互相授权

grant select on tablename to zhangsan;//授予zhangsan用户查看指定表的权限

  grant drop on tablename to zhangsan;//授予删除表的权限

  grant insert on tablename to zhangsan;//授予插入的权限

  grant update on tablename to zhangsan;//授予修改表的权限

  grant insert(id) on tablename to zhangsan;

  grant update(id) on tablename to zhangsan;//授予对指定表特定字段的插入和修改权限,注意,只能是insert和update

  grant alert all table to zhangsan;//授予zhangsan用户alert任意表的权限






0 0