oracle中常用到的权限

来源:互联网 发布:iis php mysql 编辑:程序博客网 时间:2024/05/16 08:03

grant create user to 用户名----------把创建用户权限给  用户名

grant alter user to 用户名   ----------把修改用户权限给  用户名

grant drop user to 用户名----------把删除用户权限给  用户名

 

grant connect  to 用户名  -----------把连接权限给  用户名

grant create session to 用户名----把连接数据库权限给  用户名

 

grant create tablespace to 用户名-------------把创建表空间权限给  用户名

grant alter tablespace to 用户名--------------把修改表空间权限给  用户名

grant drop tablespace to 用户名-------------把删除表空间权限给  用户名

grant unlimited tablespace to 用户名-------把无限使用表空间权限给  用户名

 

grant create table to 用户名--------------------把创建表的权限给  用户名

grant insert any table to 用户名---------------把插入表的权限给  用户名

grant update any table to 用户名------------把修改表的权限给  用户名

grant unlimited table to 用户名-------------把使用表的权限给  用户名

 

grant select on 对象名to用户名  ------------把查询  对象名  的权限给  用户名

grant insert on 对象名to用户名  -----------把插入数据  对象名  的权限给  用户名

grant all on 对象名to用户名  --------------把  对象名  上的所有权限给  用户名

grant insert on 对象名to public  ---------把插入数据  对象名  的权限给  所有人        

grant all on 对象名to public  ------------把所有对于  对象名  的权限给  所有人       (不包括删除权限)

-------对象名可以是表名比如:

 grant select on scott.emp to haha---------把查询 scott用户下的emp表的权限给haha用户

 

 grant update 列名on表名to   用户名-----------把修改  表名  下的  列名  的权限给  用户名

 grant insert 列名on表名to   用户名-----------把在  表名  下插入列的权限给  用户名

 *selectdelete权限不能控制到列级别

 

 select * from user_tab_privs ----------------查看当前用户所有权限

 grant 权限to用户名with admin option----------用户名  得到的权限可以分配给别人

 revoke 权限from用户名-----------------------解除  用户名  的指定权限

 

 Grant create any trigger to 用户名------------------把创建任何触发器的权限给  用户名

 

 

 create role  角色名称----------------------------------创建角色

 grant 权限to角色名称-------------------------------------给角色赋予权限

 grant select on scott.emp to 角色名称-------------给角色赋予查看scott用户下emp表权限

 grant 角色名称to用户名-----------------------------为  用户名  赋予角色(并获得角色所拥有的权限)

 drop role 角色名称-----------------------------------删除角色

 DBA--------------------------------------------------拥有系统最高权限的角色