--================================
創(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)限
--================================
建立表空間和用戶(hù)的步驟:
用戶(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
表空間
建立表空間(一般建N個(gè)存數(shù)據(jù)的表空間和一個(gè)索引空間):
create tablespace 表空間名
datafile ' 路徑(要先建好路徑)\***.dbf ' size *M
tempfile ' 路徑\***.dbf ' size *M
autoextend on --自動(dòng)增長(zhǎng)
--還有一些定義大小的命令,看需要
default storage(
initial 100K,
next 100k,
);
[sql] view plain copy
例子:創(chuàng)建表空間
create tablespace DEMOSPACE
datafile 'E:/oracle_tablespaces/DEMOSPACE_TBSPACE.dbf'
size 1500M
autoextend on next 5M maxsize 3000M;
刪除表空間
drop tablespace DEMOSPACE including contents and datafiles
[sql] view plain copy
用戶(hù)權(quán)限
授予用戶(hù)使用表空間的權(quán)限:
alter user 用戶(hù)名 quota unlimited on 表空間;
或 alter user 用戶(hù)名 quota *M on 表空間;
完整例子:
[sql] view plain copy
--表空間
CREATE TABLESPACE sdt
DATAFILE 'F:\tablespace\demo' size 800M
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
--索引表空間
CREATE TABLESPACE sdt_Index
DATAFILE 'F:\tablespace\demo' size 512M
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
--2.建用戶(hù)
create user demo identified by demo
default tablespace demo;
--3.賦權(quán)
grant connect,resource to demo;
grant create any sequence to demo;
grant create any table to demo;
grant delete any table to demo;
grant insert any table to demo;
grant select any table to demo;
grant unlimited tablespace to demo;
grant execute any procedure to demo;
grant update any table to demo;
grant create any view to demo;
[sql] view plain copy
--導(dǎo)入導(dǎo)出命令
ip導(dǎo)出方式: exp demo/demo@127.0.0.1:1521/orcl file=f:/f.dmp full=y
exp demo/demo@orcl file=f:/f.dmp full=y
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)