說起oracle ,很多人只知道它是數(shù)據(jù)庫的一種,對其真正的功能了解的并不多。例如,如何用oracle 創(chuàng)建表空間?oracle 簡單的說是有數(shù)據(jù)文件、控制文件和LOGFILE構(gòu)成三個(gè)文件構(gòu)成的,而它的表,當(dāng)然也是一張存儲數(shù)據(jù)的表。而數(shù)據(jù)表空間則是存放數(shù)據(jù)的空間。我們可以在oracle創(chuàng)建很多個(gè)空間來保存我們想要的數(shù)據(jù),當(dāng)然這些數(shù)據(jù)的存放形式是以文件的形式存儲在磁盤上的。今天我們要講的就是如果利用oracle來創(chuàng)建表空間的問題。
如何用oracle 創(chuàng)建表空間?
/*分為四步 */
/*第1步:創(chuàng)建臨時(shí)表空間 */
代碼如下:
create temporary tablespace user_temp
tempfile 'D:oracleoradataOracle9iuser_temp.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
/*第2步:創(chuàng)建數(shù)據(jù)表空間 */
代碼如下:
create tablespace user_data
logging
datafile 'D:oracleoradataOracle9iuser_data.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
/*第3步:創(chuàng)建用戶并指定表空間 */
代碼如下:
create user username identified by password
default tablespace user_data
temporary tablespace user_temp;
/*第4步:給用戶授予權(quán)限 */
代碼如下:
grant connect,resource,dba to username;
以上就是關(guān)于如何用oracle 創(chuàng)建表空間的全部內(nèi)容介紹,想了解更多關(guān)于oracle數(shù)據(jù)庫的信息,請繼續(xù)關(guān)注中培偉業(yè)。