create user [username] identified by [password] 創(chuàng)建新的用戶
成都創(chuàng)新互聯(lián)公司是一家專業(yè)提供富民企業(yè)網(wǎng)站建設(shè),專注與網(wǎng)站建設(shè)、成都網(wǎng)站建設(shè)、H5技術(shù)、小程序制作等業(yè)務(wù)。10年已為富民眾多企業(yè)、政府機構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站設(shè)計公司優(yōu)惠進行中。
grant 權(quán)限1、權(quán)限2...to 用戶 給創(chuàng)建用戶權(quán)限
ex:grant create session to [username] 此時只能連接到數(shù)據(jù)庫
grant connect,resource to [username] 此時權(quán)限能滿足要求
alter user [username] identified by [password] 修改用戶密碼
alter user [username] password expired 下次登錄時提示修改密碼
alter user [username] account lock 鎖住用戶
alter user [username] account unlock 解鎖鎖用戶
grant select,delete on scott.emp to [username] 把scott下emp表的兩個權(quán)限給用戶
revoke select ,delete on scott.emo from [username] 回收權(quán)限
//創(chuàng)建用戶并指定表空間
create user username identified by password
default tablespace user_data
temporary tablespace user_temp;
//給用戶授予權(quán)限
grant connect,resource to username;
//以后以該用戶登錄,創(chuàng)建的任何數(shù)據(jù)庫對象都屬于user_temp 和user_data表空間,
這就不用在每創(chuàng)建一個對象給其指定表空間了
撤權(quán):
revoke 權(quán)限... from 用戶名;
刪除用戶命令
drop user user_name cascade;
在進行procedure執(zhí)行的時候,用的是PL/SQL工具中的test,調(diào)試方法進行執(zhí)行,因為有輸入?yún)?shù),但是報了個錯:
“note:debugging requires the debug connect session system privilege”.
原因是用戶權(quán)限不夠,使用以下命令授予權(quán)限:
GRANT debug any procedure, debug connect session TO username
其實只需要授予debug connect session 就可以了,已經(jīng)過測試。
1、點擊windows中的運行,輸入cmd,進入命令提示符的界面
2、進入cmd后,首先連接oracle數(shù)據(jù)庫
3、創(chuàng)建數(shù)據(jù)庫新用戶,shop為數(shù)據(jù)庫用戶,123456為密碼
4、給新建的數(shù)據(jù)庫用戶授權(quán)
5、連接新的數(shù)據(jù)庫用戶
6、顯示數(shù)據(jù)庫用戶為shop,到此數(shù)據(jù)庫用戶創(chuàng)建及驗證成功
在sys下建,scott,沒有創(chuàng)建用戶的權(quán)限。
建用戶:
create
user
user_name
identified
by
password;
賦權(quán)限:
grant
resource,connect
to
user_name;
現(xiàn)在就可以登陸了:sqlplus
user_name/password
oracle中創(chuàng)建用戶用語句就可以,然后需要賦予相應(yīng)的權(quán)限。
1、創(chuàng)建用戶:
create?user?shopping?identified?by?123456;--創(chuàng)建一個shopping用戶,密碼為123456
2、賦權(quán):
grant?connect,resource,dba?to?shopping;--賦予shopping用戶connect,resource,dba權(quán)限
一般來說,oracle數(shù)據(jù)庫安裝后,里面有很多個默認賬號和密碼,比較常用的是:賬號:scott 密碼:tiger 賬號:system 密碼:manager 賬號:sys 密碼:任意字符。
當(dāng)我們想創(chuàng)建一個賬號時,可以使用sys登錄sysdba后,創(chuàng)建用戶(需要授權(quán)),代碼如下
create user 用戶名 identified by "密碼";
授權(quán):grant create session to 用戶名;
grant create table to 用戶名;
grant create tablespace to 用戶名;
grant create view to 用戶名;
我們一般使用的是用scott登錄sysdba,這時候有可能出現(xiàn)賬戶未解鎖的狀態(tài),這時候可以用
alter user scott account unlock;
來解鎖賬戶。解鎖之后可能會要求你改密碼:可以用
alter user scott identified by tiger;
再登錄
conn scott/tiger;
新聞名稱:oracle帳戶如何創(chuàng)建 注冊一個oracle賬戶
網(wǎng)頁路徑:http://jinyejixie.com/article4/hpccoe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)建站、網(wǎng)站排名、網(wǎng)站設(shè)計、服務(wù)器托管、網(wǎng)站設(shè)計公司、
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)