六分鐘學(xué)會創(chuàng)建Oracle表空間的實現(xiàn)步驟
經(jīng)過長時間學(xué)習(xí)創(chuàng)建Oracle表空間,于是和大家分享一下,看完本文你肯定有不少收獲,希望本文能教會你更多東西。
1、先查詢空閑空間
select tablespace_name,file_id,block_id,bytes,blocks from dba_free_space;
2、增加Oracle表空間
先查詢數(shù)據(jù)文件名稱、大小和路徑的信息,語句如下:
select tablespace_name,file_id,bytes,file_name from dba_data_files;
3、修改文件大小語句如下
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ū)的大小由隨表的大小自動動態(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)建字典管理臨時表空間
create temporary tablespace sales
tempfile '/home/app/oracle/oradata/oracle8i/sales01.dbf' size 800M
autoextend on
next 50M
maxsize 1000M
創(chuàng)建本地管理臨時表空間,如果是臨時表空間,所有語句中的datafile都換為tempfile
8i系統(tǒng)默認(rèn)創(chuàng)建字典管理臨時表空間,要創(chuàng)建本地管理臨時表空間要加temporary tablespace關(guān)鍵字
創(chuàng)建本地管理臨時表空間時,不得使用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)建本地管理臨時Oracle表空間,如果是臨時表空間,所有語句中的datafile都換為tempfile8i系統(tǒng)默認(rèn)創(chuàng)建字典管理臨時表空間,要創(chuàng)建本地管理臨時表空間要加temporary tablespace關(guān)鍵字創(chuàng)建本地管理臨時表空間時,不得使用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、更改自動擴(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表空間,在這里拿出來和大家分享一下,希望對大家有用。
- oracle創(chuàng)建表的方法和一些常用命令
- shell腳本操作oracle刪除表空間、創(chuàng)建表空間、刪除用戶
- oracle存儲過程創(chuàng)建表分區(qū)實例
- Oracle中創(chuàng)建和管理表詳解
- oracle 創(chuàng)建表空間步驟代碼
- Oracle創(chuàng)建主鍵自增表(sql語句實現(xiàn))及觸發(fā)器應(yīng)用
- oracle 創(chuàng)建表空間詳細(xì)介紹
- Oracle 創(chuàng)建用戶及數(shù)據(jù)表的方法
- Oracle 查看表空間的大小及使用情況sql語句
- Oracle數(shù)據(jù)庫如何創(chuàng)建第一張表
相關(guān)文章
oracle數(shù)據(jù)庫排序后如何獲取第一條數(shù)據(jù)
這篇文章主要介紹了oracle數(shù)據(jù)庫排序后如何獲取第一條數(shù)據(jù)問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-02-02
Oracle導(dǎo)出文本文件的三種方法(spool,UTL_FILE,sqluldr2)
這篇文章主要介紹了Oracle導(dǎo)出文本文件的三種方法(spool,UTL_FILE,sqluldr2),需要的朋友可以參考下2023-05-05
如何在Oracle數(shù)據(jù)庫中更新CLOB字段
在Oracle數(shù)據(jù)庫中,Blob和Clob分別是兩種用來存儲大數(shù)據(jù)的字段類型,下面這篇文章主要給大家介紹了關(guān)于如何在Oracle數(shù)據(jù)庫中更新CLOB字段的相關(guān)資料,需要的朋友可以參考下2024-05-05
oracle復(fù)習(xí)筆記之PL/SQL程序所要了解的知識點
本文主要是前篇文章的續(xù)篇,主要來復(fù)習(xí)PL/SQL的基本語法、記錄類型、流程控制、游標(biāo)的使用、異常處理機(jī)制、存儲函數(shù)/存儲過程、觸發(fā)器。好記性不如爛筆頭,古人誠不欺我~2014-08-08
Linux 自動備份oracle數(shù)據(jù)庫詳解
這篇文章主要介紹了Linux 自動備份oracle數(shù)據(jù)庫詳解方法的相關(guān)資料,數(shù)據(jù)庫的備份的重要性,不言而喻,希望能幫到大家,需要的朋友可以參考下2016-10-10

