oracle用戶創(chuàng)建及權(quán)限設(shè)置

權(quán)限:

巴林左旗ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為成都創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書合作)期待與您的合作!

create session

create table

unlimited tablespace

connect

resource

dba

例:

#sqlplus /nolog

SQL> conn / as sysdba;

SQL>create user username identified by password

SQL> grant dba to username;

SQL> conn username/password

SQL> select * from user_sys_privs;

我們將從創(chuàng)建Oracle用戶權(quán)限表開始談起,然后講解登陸等一般性動作,使大家對Oracle用戶權(quán)限表有個深入的了解。

一、創(chuàng)建

sys;         //系統(tǒng)管理員,擁有最高權(quán)限

system;   //本地管理員,次高權(quán)限

scott;    //普通用戶,密碼默認(rèn)為tiger,默認(rèn)未解鎖

二、登陸

sqlplus / as sysdba;       //登陸sys帳戶

sqlplus sys as sysdba;    //同上

sqlplus scott/tiger;        //登陸普通用戶scott

三、管理用戶

create user zhangsan;                     //在管理員帳戶下,創(chuàng)建用戶zhangsan

alert user scott identified by tiger;    //修改密碼

四、授予權(quán)限

1、默認(rèn)的普通用戶scott默認(rèn)未解鎖,不能進(jìn)行那個使用,新建的用戶也沒有任何權(quán)限,必須授予權(quán)限

     grant create session to zhangsan;            //授予zhangsan用戶創(chuàng)建session的權(quán)限,即登陸權(quán)限

grant unlimited tablespace to zhangsan;    //授予zhangsan用戶使用表空間的權(quán)限

grant create table to zhangsan;              //授予創(chuàng)建表的權(quán)限

grante drop table to zhangsan;              //授予刪除表的權(quán)限

grant insert table to zhangsan;             //插入表的權(quán)限

grant update table to zhangsan;           //修改表的權(quán)限

grant all to public;                             //這條比較重要,授予所有權(quán)限(all)給所有用戶(public)

    2、oralce對權(quán)限管理比較嚴(yán)謹(jǐn),普通用戶之間也是默認(rèn)不能互相訪問的,需要互相授權(quán)

     grant select on tablename to zhangsan;       //授予zhangsan用戶查看指定表的權(quán)限

grant drop on tablename to zhangsan;         //授予刪除表的權(quán)限

grant insert on tablename to zhangsan;       //授予插入的權(quán)限

grant update on tablename to zhangsan;      //授予修改表的權(quán)限

grant insert(id) on tablename to zhangsan;

grant update(id) on tablename to zhangsan;    //授予對指定表特定字段的插入和修改權(quán)限,注意,只能是insert和update

grant alert all table to zhangsan;              //授予zhangsan用戶alert任意表的權(quán)限

五、撤銷權(quán)限

基本語法同grant,關(guān)鍵字為revoke

六、查看權(quán)限

select * from user_sys_privs;   //查看當(dāng)前用戶所有權(quán)限

select * from user_tab_privs;   //查看所用用戶對表的權(quán)限

 七、操作表的用戶的表

 select * from zhangsan.tablename

 八、權(quán)限傳遞

即用戶A將權(quán)限授予B,B可以將操作的權(quán)限再授予C,命令如下:

grant alert table on tablename to zhangsan with admin option;   //關(guān)鍵字 with admin option

grant alert table on tablename to zhangsan with grant option;  //關(guān)鍵字 with grant option效果和admin類似

九、角色

角色即權(quán)限的集合,可以把一個角色授予給用戶

create role myrole;                      //創(chuàng)建角色

grant create session to myrole;   //將創(chuàng)建session的權(quán)限授予myrole

grant myrole to zhangsan;         //授予zhangsan用戶myrole的角色

drop role myrole;                    //刪除角色

本文標(biāo)題:oracle用戶創(chuàng)建及權(quán)限設(shè)置
網(wǎng)站URL:http://bm7419.com/article30/psojso.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制網(wǎng)站、網(wǎng)頁設(shè)計(jì)公司電子商務(wù)域名注冊、移動網(wǎng)站建設(shè)、網(wǎng)站維護(hù)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)