說(shuō)起oracle ,很多人只知道它是數(shù)據(jù)庫(kù)的一種,對(duì)其真正的功能了解的并不多。例如,如何用oracle 創(chuàng)建表空間?oracle 簡(jiǎn)單的說(shuō)是有數(shù)據(jù)文件、控制文件和LOGFILE構(gòu)成三個(gè)文件構(gòu)成的,而它的表,當(dāng)然也是一張存儲(chǔ)數(shù)據(jù)的表。而數(shù)據(jù)表空間則是存放數(shù)據(jù)的空間。我們可以在oracle創(chuàng)建很多個(gè)空間來(lái)保存我們想要的數(shù)據(jù),當(dāng)然這些數(shù)據(jù)的存放形式是以文件的形式存儲(chǔ)在磁盤(pán)上的。今天我們要講的就是如果利用oracle來(lái)創(chuàng)建表空間的問(wèn)題。
如何用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)建用戶(hù)并指定表空間 */
代碼如下:
create user username identified by password
default tablespace user_data
temporary tablespace user_temp;
/*第4步:給用戶(hù)授予權(quán)限 */
代碼如下:
grant connect,resource,dba to username;
以上就是關(guān)于如何用oracle 創(chuàng)建表空間的全部?jī)?nèi)容介紹,想了解更多關(guān)于oracle數(shù)據(jù)庫(kù)的信息,請(qǐng)繼續(xù)關(guān)注中培偉業(yè)。