• oracle逐步学习总结之权限和角色(基础六)


    原创作品,转自请注明出处:https://www.cnblogs.com/sunshine5683/p/10236129.html

    继续上节的索引,这次主要总结oracle数据库的权限问题!(在总结的过程中,后续会不断完善)

    一、索引

    1、单列索引:基于单个列建立的索引

    创建单列索引:create index index_name on student(name);

    2、复合索引

    二、权限

    1、授予某用户登录权限

    grant create session to user_name 

    2、授予某个用户创建表和创建视图权限

    grant create table,create view to user_name 

    3、授予权限的同时希望该用户可以同时将该权限授予其他用户

    grant create table to user_name with admin option

    4、授予用户只修改scott.emp表的sal列

    grant update on emp(sal) to user_name

    5、授予某用户只可以查询scott.emp表的ename,sal数据

    grant select on scott.emp(ename,sal) to user_name

    6、授予index权限

    如果想在别的方案的表上建立索引,则必须具有index对象权限,如:希望ken用户可以在scott.emp表上建立索引,就给其index的对象权限

    grant index on scott.emp to ken

    同时也可以使用with grant option选项(对象权限,如果是系统权限,则:with admin option)

    三、角色

    角色可以将权限的授予步骤(权限授完一般需要12个)

    1、预定义角色

    (1)connect角色

    connect角色具有一般引用开发人员需要的大部分权限,当建立一个用户后,多数情况下只要授予用户connect和resource角色就够了,其中connect角色具有的用户权限如下

    alter session

    create cluster

    create database link

    create session

    create table

    create view

    create sequence

    (2)resource角色

    resource角色具有应用开发人员所需的其他权限,比如建立存储过程,触发器等。这里需要注意的是,resource角色隐含了unlimited tablespace系统权限。其中resource角色具有的用户权限如下:

    create cluster

    create indextype

    create table

    create sequence

    create type

    create procedure

    create trigger

    (3)dba角色

    dba角色具有所有的系统权限,以及with admin option选项,默认的dba用户为sys和system,他们可以将任何系统权限授予其他用户,但是dba角色不具备sysdba和sysoper的特权(启动和关闭数据库)

    2、自定义角色

    暂时不总结,后面总结

  • 相关阅读:
    【33】避免遮掩继承而来的名称
    调用异步方法
    Python 调用C++
    【37】绝不重新定义继承而来的缺省参数值
    【36】绝不重新定义继承而来的non-virtual方法
    【38】通过复合塑模出Has-A 或根据某物实现出
    【转】C++ function、bind以及lamda表达式
    mongodb
    mongodb
    mongodb
  • 原文地址:https://www.cnblogs.com/sunshine5683/p/10236129.html
Copyright © 2020-2023  润新知