oracle逐步學習總結之許可權和角色(基礎六)

2021-09-07 20:37:48 字數 1745 閱讀 3899

原創作品,**請註明出處:

繼續上節的索引,這次主要總結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、授予許可權的同時希望該使用者可以同時將該許可權授予其他使用者

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、自定義角色

暫時不總結,後面總結

oracle資料庫逐步學習總結之基本命令(基礎一)

一 oracle的基本命令 1 連線命令 用法 conn 使用者名稱 密碼 網路服務名 as sysdba sysoper 2 disc onnection 斷開與當前資料庫的連線 3 passw ord 修改使用者密碼,修改其他使用者密碼,需要sys system使用者 4 show user 顯...

Oracle學習之許可權管理

直接授予使用者許可權 grant 許可權 to 使用者 先將許可權授予角色,再將角色授予使用者 grant 許可權 to 角色 grant 角色 to 使用者 revoke 許可權 from 注意 當多個使用者向同一使用者授予許可權,其中乙個使用者授予的許可權被 後,不影響其他被授予的許可權 若要收...

Oracle許可權總結

1.系統許可權管理 scott triger 預設為鎖定。應該解鎖 alter user account lock unlock sys oracle 網路管理員。全域性的管理員 system 普通管理員 scott 普通使用者 oracle使用條件 啟用監聽 lsnrctl start 啟用資料庫...