国产成人精品18p,天天干成人网,无码专区狠狠躁天天躁,美女脱精光隐私扒开免费观看

Oracle新創(chuàng )建用戶(hù)和創(chuàng )建表教程,附完整sql語(yǔ)句

發(fā)布時(shí)間:2022-10-24 07:18 來(lái)源:群英 閱讀:134 作者:群英 欄目: 主機資訊 歡迎投稿:712375056

對于初學(xué)oracle的童鞋來(lái)說(shuō),如何快速的利用快速創(chuàng )建一個(gè)表和數據用戶(hù),是必須先要掌握的重要知識點(diǎn)之一。下面給大家附上oracle創(chuàng )建用戶(hù)和數據庫表的代碼,希望對你們有所幫助,直接上代碼:
[sql]  
 
建立表空間和用戶(hù)的步驟:  
用戶(hù)  
建立:create user 用戶(hù)名 identified by "密碼";  
授權:grant create session to 用戶(hù)名;  
            grant create table to  用戶(hù)名;  
            grant create tablespace to  用戶(hù)名;  
            grant create view to  用戶(hù)名;  
 
[sql]  
 
表空間  
建立表空間(一般建N個(gè)存數據的表空間和一個(gè)索引空間):  
create tablespace 表空間名  
datafile ' 路徑(要先建好路徑)***.dbf  ' size *M  
tempfile ' 路徑***.dbf ' size *M  
autoextend on  --自動(dòng)增長(cháng)  
--還有一些定義大小的命令,看需要  
 default storage(  
 initial 100K,  
 next 100k,  
);  
[sql]  
 
例子:創(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]  
 
用戶(hù)權限  
授予用戶(hù)使用表空間的權限:  
alter user 用戶(hù)名 quota unlimited on 表空間;  
或 alter user 用戶(hù)名 quota *M on 表空間;  

看完上面的代碼,有沒(méi)有覺(jué)得不好理解掌握呢?看我已經(jīng)替大家想到了,下面再給大家舉一個(gè)完整的例子:能幫大吉快速消化上面的知識點(diǎn)。
[sql]  
 
--表空間  
CREATE TABLESPACE sdt  
DATAFILE 'F:tablespacedemo' size 800M  
         EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;   
--索引表空間  
CREATE TABLESPACE sdt_Index  
DATAFILE 'F:tablespacedemo' size 512M           
         EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;       
  
--2.建用戶(hù)  
create user demo identified by demo   
default tablespace demo;  
   
--3.賦權  
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]  
 
--導入導出命令     
ip導出方式: 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  

來(lái)源鏈接:https://www.qy.cn/zx/idc/831.html

本站聲明:網(wǎng)站內容來(lái)源于網(wǎng)絡(luò ),如有侵權,請聯(lián)系我們,我們將及時(shí)處理。

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。

久久精品国产亚洲AV无码麻豆| 99国产精品国产精品九九| 热RE99久久6国产精品免费| 精品人妻少妇一区二区三区不卡| 国产偷久久久精品专区| 好男人视频在线观看免费看片|