Oracle的使用者、角色以及許可權相關操作

來源:互聯網
上載者:User

標籤:提示   date   資料庫   scott   count   user   lock   tab   roc   

1、建立使用者
create user KD identified by 123456;
2、授予串連資料庫的許可權
grant connect to KD;
3、將Scott使用者的emp表授權給KD可以查詢
grant select on scott.emp to KD;
grant create table to KD;
4、回收許可權
revoke select on scott.emp from KD;
5、表的增刪改許可權授權
grant select,inset,delete,update on scott.emp to KD;
revoke select,inset,delete,update on scott.emp from KD;
6、刪除使用者
SQL 錯誤: ORA-01940: 無法刪除當前串連的使用者
退出已經串連得KD使用者後再執行
drop user KD;
會提示:錯誤: ORA-01922: 必須指定 CASCADE 以刪除 ‘KD‘
drop user KD cascade;
7、查看目前使用者所擁有的許可權
select * from session_privs;
8、查看目前使用者所擁有的角色
select * from user_role_privs;
9、查看角色所有的許可權
select * from dba_sys_privs;
select * from dba_sys_privs where grantee=‘CONNECT‘;
--create session

select * from dba_sys_privs where grantee=‘RESOURCE‘;

/*
create trigger
create sequence
create type
create procedure
create cluster
create operator
create indextype
create table
*/

select * from dba_sys_privs where grantee=‘DBA‘;
--有最高許可權 所有的許可權都有

建立一個開發人員並授權:
create user CURRY identified by 123456;
create connet,resource to CURRY;

10、使用者解鎖
alter user HR account unlock;
11、修改使用者密碼
alter user HR identified by 123456;

Oracle的使用者、角色以及許可權相關操作

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.