oracle 10g表空間操作
1.建立表空間:
create tablespace tablespace_name datafile 'filepath' size filesize autoextend on next autosize maxsize filemaxsize [unlimited]
eg:
create tablespace sales datafile 'c:\1.txt' size 10m autoextend on next 1m maxsize 100m
2.為表空間增加資料檔案:
alter tablespace tablespace_name add datafile 'filepath' size filesize autoextend on next autosize maxsize filemaxsize[unlimited]
eg:
alter tablespace sales datafile 'c:\2.txt' size 10m autoextend on next 1m maxsize unlimited
3.調整表空間:
alter database datafile 'filepath' resize filesize--重置表空間的大小
eg:
alter database datafile 'c:\2.txt' resize 10m
4.關閉表空間的自動擴充套件屬性:
alter database datafile 'filepath' autoextend off
eg:
alter database datafile 'c:\2.txt' autoextend off
5.開啟表空間的自動擴充套件屬性:
alter database datafile 'filepath' autoextend on
eg:
alter database datafile 'c:\2.txt' autoextend on
6.使表空間離線:
alter tablespace tablespace_name offline
7.使表空間聯機:
alter tablespace tablespace_name online
8.設定表空間為只讀:
alter tablespace tablespace_name read only
9.設定表空間為讀寫:
alter tablespace tablespace_name read write
11.刪除表空間:
drop tablespace tablespace_name
12.刪除表空間的同時,刪除資料檔案
drop tablespace tablespace_name including contents and datefiles
13.檢視每個表空間佔用空間的大小:
select tablespace_name,sum(bytes)/1024/1024 from dba_segments group by tablespace_name
10.移動表空間資料檔案步驟:
a.使表空間離線:alter tablespace tablespace_name offline
b.物理移動資料檔案到目的地(可以是表空間的部分資料檔案或者是修改資料檔案的名稱)
c.邏輯移動:alter tablespace tablespace_name rename datafile '原始檔地址'to '目的檔案地址'--注意可以將多個原始檔轉移到同一個目的檔案地址(多個原始檔地址用逗號分隔)
d.將表空間聯機:alter tablespace tablespace_name online
11.查詢表空間的資訊:
select tablespace_name,bytes/1024/1024 file_size_mb,file_name from DBA_DATE_FILES--注意書籍庫中的實體都是以大寫表示
12.當資料檔案被刪除的時候,如果對該資料檔案操作的時候,oracle會報不能找到該資料檔案的錯誤。如何處理。
(1)shutdown—關閉oracle例項
(2)startup --開啟oracle例項並開啟資料庫
(3)alter database datafile ‘datafile_name’ offline drop;
(4)alter database open
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/196700/viewspace-683878/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 10g大檔案表空間(轉)Oracle 10g
- Oracle表空間Oracle
- oracle 表空間Oracle
- Oracle切換undo表空間操作步驟Oracle
- 增加oracle表空間Oracle
- oracle temp 表空間Oracle
- oracle 表移動表空間Oracle
- Oracle表移動表空間Oracle
- oracle表空間的整理Oracle
- Oracle 批量建表空間Oracle
- Oracle清理SYSAUX表空間OracleUX
- Oracle Temp 表空間切換Oracle
- Oracle 表空間增加檔案Oracle
- Oracle OCP(49):表空間管理Oracle
- Oracle表空間收縮方案Oracle
- Oracle RMAN 表空間恢復Oracle
- Oracle新建使用者、表空間、表Oracle
- oracle建立臨時表空間和資料表空間以及刪除Oracle
- Oracle的表空間quota詳解Oracle
- oracle臨時表空間相關Oracle
- oracle sql 表空間利用率OracleSQL
- Oracle OCP(47):表空間的建立Oracle
- 【Oracle 恢復表空間】 實驗Oracle
- 【TABLESPACE】Oracle表空間最佳實踐Oracle
- oracle 建立表空間和使用者Oracle
- Oracle建立表空間和使用者Oracle
- Oracle中新建表空間、使用者Oracle
- Oracle中表空間、表、索引的遷移Oracle索引
- ORACLE線上切換undo表空間Oracle
- oracle表空間增長趨勢分析Oracle
- Oracle OCP(46):表空間、段、區、塊Oracle
- 【TABLESPACE】Oracle 表空間結構說明Oracle
- Oracle RAC+DG 表空間擴容Oracle
- oracle表空間使用率查詢Oracle
- 16、表空間 建立表空間
- Oracle臨時表空間檢視、新增臨時表空間資料檔案、修改預設臨時表空間 方法!Oracle
- 【XTTS】Oracle傳輸表空間xtts增量方式TTSOracle
- 【RESIZE】Oracle收縮表空間主要命令Oracle
- Oracle 12cbigfile表空間物件遷移Oracle物件