1、創(chuàng)建用戶
create user KD identified by 123456;
2、授予連接數(shù)據(jù)庫(kù)的權(quán)限
grant connect to KD;
3、將Scott用戶的emp表授權(quán)給KD可以查詢
grant select on scott.emp to KD;grant create table to KD;
4、回收權(quán)限
revoke select on scott.emp from KD;
5、表的增刪改權(quán)限授權(quán)
grant select,inset,delete,update on scott.emp to KD;revoke select,inset,delete,update on scott.emp from KD;
6、刪除用戶
SQL 錯(cuò)誤: ORA-01940: 無法刪除當(dāng)前連接的用戶
退出已經(jīng)連接得KD用戶后再執(zhí)行
drop user KD;
會(huì)提示:錯(cuò)誤: ORA-01922: 必須指定 CASCADE 以刪除 'KD'
drop user KD cascade;
7、查看當(dāng)前用戶所擁有的權(quán)限
select * from session_privs;
8、查看當(dāng)前用戶所擁有的角色
select * from user_role_privs;
9、查看角色所有的權(quán)限
select * from dba_sys_privs;select * from dba_sys_privs where grantee='CONNECT';--create sessionselect * 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';--有最高權(quán)限 所有的權(quán)限都有
創(chuàng)建一個(gè)開發(fā)人員并授權(quán):
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的用戶、角色以及權(quán)限相關(guān)操作,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)VeVb武林網(wǎng)網(wǎng)站的支持!
新聞熱點(diǎn)
疑難解答
圖片精選