select name from v$tablespace
;--使用資料字典檢視表空間狀
create
tablespace data01
size 100m;
-- 表空間有四種狀態, 通過alter指令可以更改表空間的狀態
/* online狀態
offline狀態
read only狀態
read write狀態
*/alter
tablespace data01 online;
alter
tablespace data01 rename
to data02;
-- 查詢表空間的空閒空間資訊
select tablespace_name,bytes,blocks from dba_free_space
where tablespace_name=
'data02'
;-- 檢視表空間的資料檔案資訊
select tablespace_name, file_name, bytes
from dba_data_files
where tablespace_name=
'data02'
;--增加表空間的資料檔案
alter
tablespace data02
size 100m;
--修改表空間所對應的資料檔案的自動擴充套件性
alter
database
autoextend on
next
10m maxsize unlimited;
-- 移動表空間中的資料檔案
/*1. 修改表空間為offline狀態
2. 手動移動檔案
3. 命令修改data02.dbf的位置
4. 修改tablespace online
*/-- 1. 修改表空間為offline狀態
alter
tablespace data02 offline;
-- 3. 命令修改data02.dbf的位置
alter
tablespace data02
to'd:data02.dbf'
;
drop
tablespace data02 including contents and datafiles;
Oracle 表空間管理
一 建立表空間f create tablespace mytablespace datafile 建立乙個名為mytablesapce的表空間 path filename1.dbf size 2048m autoextend off,指明資料檔案在存放地點,並關閉檔案的自動擴充套件功能,如果開啟了這...
oracle 表空間管理
表空間是資料庫的邏輯組成部分,從物理上講資料庫資料存放在資料檔案中 從邏輯上講,資料庫則是存放在表空間中,表空間是由乙個或者多個資料檔案組成。oracle資料庫邏輯結構組成部分 資料庫是由表空間組成,而表空間又是由段構成,段是由區構成,而區是又oracle資料庫的塊組成這樣的一種結構,這樣可以提高資...
ORACLE 表空間管理
1.create tablespaces sql create tablespace tablespace name datafile c oracle oradata file1.dbf size 100m,sql c oracle oradata file2.dbf size 100m mini...