六分鐘學(xué)會(huì)創(chuàng)建Oracle表空間的實(shí)現(xiàn)步驟
經(jīng)過(guò)長(zhǎng)時(shí)間學(xué)習(xí)創(chuàng)建Oracle表空間,于是和大家分享一下,看完本文你肯定有不少收獲,希望本文能教會(huì)你更多東西。
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ù)文件路徑,即上面查詢出來(lái)的路徑
'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表空間,在這里拿出來(lái)和大家分享一下,希望對(duì)大家有用。
- oracle創(chuàng)建表的方法和一些常用命令
- shell腳本操作oracle刪除表空間、創(chuàng)建表空間、刪除用戶
- oracle存儲(chǔ)過(guò)程創(chuàng)建表分區(qū)實(shí)例
- Oracle中創(chuàng)建和管理表詳解
- oracle 創(chuàng)建表空間步驟代碼
- Oracle創(chuàng)建主鍵自增表(sql語(yǔ)句實(shí)現(xiàn))及觸發(fā)器應(yīng)用
- oracle 創(chuàng)建表空間詳細(xì)介紹
- Oracle 創(chuàng)建用戶及數(shù)據(jù)表的方法
- Oracle 查看表空間的大小及使用情況sql語(yǔ)句
- Oracle數(shù)據(jù)庫(kù)如何創(chuàng)建第一張表
相關(guān)文章
oracle數(shù)據(jù)庫(kù)排序后如何獲取第一條數(shù)據(jù)
這篇文章主要介紹了oracle數(shù)據(jù)庫(kù)排序后如何獲取第一條數(shù)據(jù)問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-02-02
Oracle?sysaux表空間異常增長(zhǎng)的完美解決方法
sysaux表空間會(huì)因?yàn)槎喾N情況而增大,下面這篇文章主要給大家介紹了關(guān)于Oracle?sysaux表空間異常增長(zhǎng)的完美解決方法,文中通過(guò)實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2022-04-04
Oracle導(dǎo)出文本文件的三種方法(spool,UTL_FILE,sqluldr2)
這篇文章主要介紹了Oracle導(dǎo)出文本文件的三種方法(spool,UTL_FILE,sqluldr2),需要的朋友可以參考下2023-05-05
如何在Oracle數(shù)據(jù)庫(kù)中更新CLOB字段
在Oracle數(shù)據(jù)庫(kù)中,Blob和Clob分別是兩種用來(lái)存儲(chǔ)大數(shù)據(jù)的字段類型,下面這篇文章主要給大家介紹了關(guān)于如何在Oracle數(shù)據(jù)庫(kù)中更新CLOB字段的相關(guān)資料,需要的朋友可以參考下2024-05-05
Oracle系統(tǒng),即是以O(shè)racle關(guān)系數(shù)據(jù)庫(kù)為數(shù)據(jù)存儲(chǔ)和管理作為構(gòu)架基礎(chǔ),構(gòu)建出的數(shù)據(jù)庫(kù)管理系統(tǒng)。世界第一個(gè)支持SQL語(yǔ)言的商業(yè)數(shù)據(jù)庫(kù),定位于高端工作站,以及作為服務(wù)器的小型計(jì)算機(jī),Oracle公司的整個(gè)產(chǎn)品線包括數(shù)據(jù)庫(kù)服務(wù)器、企業(yè)商務(wù)應(yīng)用套件、應(yīng)用開(kāi)發(fā)和決策支持工具2014-08-08
oracle復(fù)習(xí)筆記之PL/SQL程序所要了解的知識(shí)點(diǎn)
本文主要是前篇文章的續(xù)篇,主要來(lái)復(fù)習(xí)PL/SQL的基本語(yǔ)法、記錄類型、流程控制、游標(biāo)的使用、異常處理機(jī)制、存儲(chǔ)函數(shù)/存儲(chǔ)過(guò)程、觸發(fā)器。好記性不如爛筆頭,古人誠(chéng)不欺我~2014-08-08
Linux 自動(dòng)備份oracle數(shù)據(jù)庫(kù)詳解
這篇文章主要介紹了Linux 自動(dòng)備份oracle數(shù)據(jù)庫(kù)詳解方法的相關(guān)資料,數(shù)據(jù)庫(kù)的備份的重要性,不言而喻,希望能幫到大家,需要的朋友可以參考下2016-10-10

