oracle創(chuàng)建用戶(hù)及授權(quán)創(chuàng)建表

--================================

創(chuàng)新互聯(lián)專(zhuān)注于蓬江網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠(chéng)為您提供蓬江營(yíng)銷(xiāo)型網(wǎng)站建設(shè),蓬江網(wǎng)站制作、蓬江網(wǎng)頁(yè)設(shè)計(jì)、蓬江網(wǎng)站官網(wǎng)定制、小程序制作服務(wù),打造蓬江網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供蓬江網(wǎng)站排名全網(wǎng)營(yíng)銷(xiāo)落地服務(wù)。

--Oracle 用戶(hù)、對(duì)象權(quán)限、系統(tǒng)權(quán)限

--================================

  1. 建立表空間和用戶(hù)的步驟:

  2. 用戶(hù)

  建立:create user 用戶(hù)名 identified by "密碼";

  授權(quán):grant create session to 用戶(hù)名;

  grant create table to  用戶(hù)名;

  grant create tablespace to  用戶(hù)名;

  grant create view to  用戶(hù)名;

grant resource to
grant connect,resource,dba to 用戶(hù);
select * from user_sys_privs;查詢(xún)當(dāng)前用戶(hù)權(quán)限
grant connect,resource,dba to 用戶(hù);給dba權(quán)限
grant connect,resource to 用戶(hù);
grant unlimited tablespace to 用戶(hù);
grant create database link to 用戶(hù);
grant select any sequence,create materialized view to 用戶(hù);
grant unlimited tablespace to 用戶(hù);//授予不限制的表空間
grant select any table to 用戶(hù);//授予查詢(xún)?nèi)魏伪?br />grant是關(guān)鍵字,select any table是權(quán)限,to后面是用戶(hù)賬號(hào)

[sql] view plain copy

  1. 表空間

  2. 建立表空間(一般建N個(gè)存數(shù)據(jù)的表空間和一個(gè)索引空間):

  3. create tablespace 表空間名

  4. datafile ' 路徑(要先建好路徑)\***.dbf  ' size *M

  5. tempfile ' 路徑\***.dbf ' size *M

  6. autoextend on  --自動(dòng)增長(zhǎng)

  7. --還有一些定義大小的命令,看需要

  8.  default storage(

  9.  initial 100K,

  10.  next 100k,

  11. );

[sql] view plain copy

  1. 例子:創(chuàng)建表空間

  2. create tablespace DEMOSPACE

  3. datafile 'E:/oracle_tablespaces/DEMOSPACE_TBSPACE.dbf'

  4. size 1500M

  5. autoextend on next 5M maxsize 3000M;

  6. 刪除表空間

  7. drop tablespace DEMOSPACE including contents and datafiles

 


[sql] view plain copy

  1. 用戶(hù)權(quán)限

  2. 授予用戶(hù)使用表空間的權(quán)限:

  3. alter user 用戶(hù)名 quota unlimited on 表空間;

  4. 或 alter user 用戶(hù)名 quota *M on 表空間;

完整例子:

[sql] view plain copy

  1. --表空間

  2. CREATE TABLESPACE sdt

  3. DATAFILE 'F:\tablespace\demo' size 800M

  4.          EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

  5. --索引表空間

  6. CREATE TABLESPACE sdt_Index

  7. DATAFILE 'F:\tablespace\demo' size 512M

  8.          EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

  9. --2.建用戶(hù)

  10. create user demo identified by demo

  11. default tablespace demo;

  12. --3.賦權(quán)

  13. grant connect,resource to demo;

  14. grant create any sequence to demo;

  15. grant create any table to demo;

  16. grant delete any table to demo;

  17. grant insert any table to demo;

  18. grant select any table to demo;

  19. grant unlimited tablespace to demo;

  20. grant execute any procedure to demo;

  21. grant update any table to demo;

  22. grant create any view to demo;

[sql] view plain copy

  1. --導(dǎo)入導(dǎo)出命令   

  2. ip導(dǎo)出方式: exp demo/demo@127.0.0.1:1521/orcl file=f:/f.dmp full=y

  3. exp demo/demo@orcl file=f:/f.dmp full=y

  4. imp demo/demo@orcl file=f:/f.dmp full=y ignore=y

    大臉貓運(yùn)維博客更多姿勢(shì)www.itlinux.cn

網(wǎng)站標(biāo)題:oracle創(chuàng)建用戶(hù)及授權(quán)創(chuàng)建表
網(wǎng)址分享:http://muchs.cn/article32/jcgppc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站設(shè)計(jì)、企業(yè)網(wǎng)站制作、全網(wǎng)營(yíng)銷(xiāo)推廣云服務(wù)器、建站公司、網(wǎng)站內(nèi)鏈

廣告

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

微信小程序開(kāi)發(fā)