新聞中心
經(jīng)過長(zhǎng)時(shí)間學(xué)習(xí)創(chuàng)建Oracle表空間,于是和大家分享一下,看完本文你肯定有不少收獲,希望本文能教會(huì)你更多東西。

成都創(chuàng)新互聯(lián)公司是一家集網(wǎng)站建設(shè),尼瑪企業(yè)網(wǎng)站建設(shè),尼瑪品牌網(wǎng)站建設(shè),網(wǎng)站定制,尼瑪網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營(yíng)銷,網(wǎng)絡(luò)優(yōu)化,尼瑪網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。
1、先查詢空閑空間
- select tablespace_name,file_id,block_id,bytes,blocks from dba_free_space;
2、增加Oracle表空間
先查詢數(shù)據(jù)文件名稱、大小和路徑的信息,語(yǔ)句如下:
- select tablespace_name,file_id,bytes,file_name from dba_data_files;
3、修改文件大小語(yǔ)句如下
- alter database datafile
- '需要增加的數(shù)據(jù)文件路徑,即上面查詢出來的路徑
- 'resize 800M;
4、創(chuàng)建Oracle表空間
- create tablespace test
- datafile '/home/app/oracle/oradata/oracle8i/test01.dbf' size 8M
- autoextend on
- next 5M
- maxsize 10M;
- create tablespace sales
- datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
- autoextend on
- next 50M
- maxsize unlimited
- maxsize unlimited 是大小不受限制
- create tablespace sales
- datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
- autoextend on
- next 50M
- maxsize 1000M
- extent management local uniform;
- unform表示區(qū)的大小相同,默認(rèn)為1M
- create tablespace sales
- datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
- autoextend on
- next 50M
- maxsize 1000M
- extent management local uniform size 500K;
- unform size 500K表示區(qū)的大小相同,為500K
- create tablespace sales
- datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
- autoextend on
- next 50M
- maxsize 1000M
- extent management local autoallocate;
- autoallocate表示區(qū)的大小由隨表的大小自動(dòng)動(dòng)態(tài)改變,大表使用大區(qū)小表使用小區(qū)
- create tablespace sales
- datafile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
- autoextend on
- next 50M
- maxsize 1000M
- temporary;
- temporary創(chuàng)建字典管理臨時(shí)表空間
- create temporary tablespace sales
- tempfile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
- autoextend on
- next 50M
- maxsize 1000M
- 創(chuàng)建本地管理臨時(shí)表空間,如果是臨時(shí)表空間,所有語(yǔ)句中的datafile都換為tempfile
- 8i系統(tǒng)默認(rèn)創(chuàng)建字典管理臨時(shí)表空間,要?jiǎng)?chuàng)建本地管理臨時(shí)表空間要加temporary tablespace關(guān)鍵字
- 創(chuàng)建本地管理臨時(shí)表空間時(shí),不得使用atuoallocate參數(shù),系統(tǒng)默認(rèn)創(chuàng)建uniform管理方式
- 為表空間增加數(shù)據(jù)文件:
- alter tablespace sales add
- datafile '/home/app/oracle/oradata/oracle8i/sales02.dbf' size 800M
- autoextend on next 50M
- maxsize 1000M;
創(chuàng)建本地管理臨時(shí)Oracle表空間,如果是臨時(shí)表空間,所有語(yǔ)句中的datafile都換為tempfile8i系統(tǒng)默認(rèn)創(chuàng)建字典管理臨時(shí)表空間,要?jiǎng)?chuàng)建本地管理臨時(shí)表空間要加temporary tablespace關(guān)鍵字創(chuàng)建本地管理臨時(shí)表空間時(shí),不得使用atuoallocate參數(shù),系統(tǒng)默認(rèn)創(chuàng)建uniform管理方式
為表空間增加數(shù)據(jù)文件:
- alter tablespace sales add
- datafile '/home/app/oracle/oradata/oracle8i/sales02.dbf' size 800M
- autoextend on next 50M
- maxsize 1000M;
5、更改自動(dòng)擴(kuò)展屬性:
- alter database datafile
- '/home/app/oracle/oradata/oracle8i/sales01.dbf',
- '/home/app/oracle/oradata/oracle8i/sales02.dbf'
- '/home/app/oracle/oradata/oracle8i/sales01.dbf
- autoextend off;
以上介紹創(chuàng)建Oracle表空間,在這里拿出來和大家分享一下,希望對(duì)大家有用。
網(wǎng)站題目:六分鐘學(xué)會(huì)創(chuàng)建Oracle表空間的步驟
路徑分享:http://www.dlmjj.cn/article/dpphsps.html


咨詢
建站咨詢
