oracle建立使用者、授權、匯入、匯出命令總結

來源:互聯網
上載者:User

標籤:data   blank   alter   使用者名稱   許可權   buffer   mail   dex   命令   

1、建立使用者

需要先用system使用者登入資料庫,因為system使用者具有建立其他使用者的許可權。

文法[建立使用者]: create user 使用者名稱 identified by 口令[即密碼];

例子: create user dhjw identified by 123456;

文法[更改使用者]: alter user 使用者名稱 identified by 口令[改變的口令];

例子: alter user dhjw identified by dhjw ;

 

2、刪除使用者

文法:drop user 使用者名稱;

例子:drop user dhjw;

若使用者擁有對象,則不能直接刪除,否則將返回一個錯誤值。指定關鍵字cascade,可刪除使用者所有的對象,然後再刪除使用者。

文法: drop user 使用者名稱 cascade;

例子: drop user dhjw cascade;

 

3.授權使用者具有某些角色

oracle提供預設三種標準角色connect(串連角色)、resource(資源角色)、dba(資料庫管理員角色),當然使用者還可以建立自己的角色,這裡不再細說。

 

授權命令:

文法: grant connect, resource to 使用者名稱;

 例子: grant connect, resource to dhjw;

撤銷許可權命令

文法: revoke connect, resource from 使用者名稱;

列子: revoke connect, resource from dhjw;

 

4.匯入匯出命令

匯入:imp 使用者名稱/密碼@執行個體名 file=要匯入的dmp檔案的絕對路徑 log=日誌存放路徑 full=y ignore=y

例子:imp dhjw/[email protected] file=C:\Users\DELL\Desktop\ziyue_dh_20180308120000.dmp log=C:\data\dh_jw.log full=y ignore=y

匯出:

將資料庫TEST完全匯出,使用者名稱system 密碼manager 匯出到D:\daochu.dmp中
   exp system/[email protected]   rows=y  indexes=y compress=n buffer=65536   feedback=100000full=y  file=d:\daochu.dmp  log=d:\daochulog.txt   owner=(ECC_BIZ,ECC_CUSTOMER)

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.