oracle 許可權 命令

來源:互聯網
上載者:User

 

 oracle許可權命令 收藏

 

Oracle9i中預設使用者及密碼:

sys/change_on_install [as sysdba],

system/manager

scott/tiger

 

 

1、許可權管理

 

dba登陸                             conn / as sysdba

 

建立使用者                             create user myusername identified by mypassword 

授權會話                             grant create session to myusername

授權建立表                          grant create table to myusername

授權資料表空間                          grant unlimited /default/template tablespace to myusername

 

撤銷使用者權限                       revoke create table from myusername

 

查看目前使用者系統許可權           select * from user_sys_privs

 

2、對象許可權

 

授權查詢                            grant select on tb to myusername

授權插入                            grant insert on tb to myusername

授權所有許可權                      grant all on tb to myusername

撤銷所有許可權                      revoke all on tb to myusername

 

授權許可權給所有人                grant create any table to public 

 

授權列許可權                         grant update(name) on tb to myusername

 

查看目前使用者對象許可權          select * from user_tb_privs 

查看當權使用者列許可權             select * from user_col_privs

 

3、許可權傳遞

 

傳遞使用者權限                      grant alter ant table to myusername

傳遞系統管理使用者許可權                grant alter any table to myusername with admin option

grant alter any table to myusername with grant option

 

 

4、角色(許可權的集合)

 

建立角色                            create role myrole 

為角色添加許可權                   grant create table to myrole 

                                        grant create session to myrole 

                                        ……………………… 

角色授予使用者                      grant myrole to myusername

刪除角色                            drop role myrole

 

5、三種登陸驗證機制

 

· 作業系統驗證 

· 密碼檔案驗證 

· 資料庫驗證

 

修改非管理使用者密碼        alter user myusername identified by bbb

 

使用者加鎖                          alter user myusername account lock 

使用者解鎖                          alter user myusername account unlock

 

使用者口令即刻失效              alter user myusername password expire

 

管理員密碼丟失                 orapwd file=c:/oracle/ora92/database/pwdora9i.ora password=kkk entries=10

 

刪除使用者,並串聯刪除該使用者下的所有資源:drop user myusername cascade;

 

【啟動Oracle監聽程式,啟動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.