方法1
創(chuàng)新互聯(lián)公司2013年開創(chuàng)至今,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項目做網(wǎng)站、網(wǎng)站制作網(wǎng)站策劃,項目實(shí)施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元康縣做網(wǎng)站,已為上家服務(wù),為康縣各地企業(yè)和個人服務(wù),聯(lián)系電話:13518219792
1
雙擊運(yùn)行PLSQL Developer軟件,連接oracle數(shù)據(jù)庫服務(wù)器
PLSQL:[3]PLSQL怎么創(chuàng)建oracle數(shù)據(jù)庫用戶步驟閱讀
PLSQL:[3]PLSQL怎么創(chuàng)建oracle數(shù)據(jù)庫用戶
2
在“對象”下,找到users,右擊選擇“新建”
PLSQL:[3]PLSQL怎么創(chuàng)建oracle數(shù)據(jù)庫用戶步驟閱讀
3
在彈出的“創(chuàng)建用戶”窗口中,輸入新用戶的名稱、口令,默認(rèn)表空間、臨時表空間等
PLSQL:[3]PLSQL怎么創(chuàng)建oracle數(shù)據(jù)庫用戶
4
賦予新用戶權(quán)限,賦予其角色權(quán)限:connect、resource,這樣用戶才能登錄操作數(shù)據(jù)庫
END
方法2
通過sql語句創(chuàng)建用戶:依次單擊“文件”--“新建”--“SQL窗口”
輸入sql語句:
-- Create the user
create user USER2 --用戶名 identified by user2 --口令 default tablespace USERS --默認(rèn)表空間 temporary tablespace TEMP --臨時表空間
單擊執(zhí)行按鈕或按快捷鍵F8,執(zhí)行sql語句,創(chuàng)建用戶
輸入sql語句:
-- Grant/Revoke role privileges grant connect to USER2;grant resource to USER2;
給用戶賦予權(quán)限,按F8執(zhí)行語句
運(yùn)行plsql,輸入新建用戶的用戶名和口令登錄
一般來說,oracle數(shù)據(jù)庫安裝后,里面有很多個默認(rèn)賬號和密碼,比較常用的是:賬號: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;
create user [username] identified by [password] 創(chuàng)建新的用戶
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;
在進(jìn)行procedure執(zhí)行的時候,用的是PL/SQL工具中的test,調(diào)試方法進(jìn)行執(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
其實(shí)只需要授予debug connect session 就可以了,已經(jīng)過測試。
當(dāng)前標(biāo)題:怎么創(chuàng)建oracle密碼 oracle密碼
網(wǎng)頁網(wǎng)址:http://jinyejixie.com/article0/hpccoo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供Google、App開發(fā)、營銷型網(wǎng)站建設(shè)、全網(wǎng)營銷推廣、關(guān)鍵詞優(yōu)化、靜態(tài)網(wǎng)站
聲明:本網(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)