Oracle表空間管理

2021-09-25 08:45:49 字數 1497 閱讀 1827

建立表空間

create tablespace ts1 datafile 'c:tablespace\ts1.dbf' size 50m;

create tablespace ts2 datafile 'c:tablespace\ts2.dbf' size 50m autoextend on next 10m; --自動擴充套件大小

create tablespace ts2 datafile 'c:tablespace\ts3.dbf' size 50m autoentend on next 10m maxsize 1024m; --最大1g

更改預設表空間

alter database default tablespace ts1;

alter tablespace ts1 rename to tss1;--改名

drop tablespace ts2 including contents and datafiles; --刪除表空間

虛擬表

select sysdate from dual;
select * from database_properties;--檢視資料庫屬性
alter tablespace tablespace_name drop datafile file_name; --11gr2以後可使用該方法刪除
詳細說明

select machine , terminal from v$session;--檢視使用者通過什麼裝置登入資料庫
select * from v$parameter where name like 'proc%'; --檢視最大會話數
表空間離線

alter tablespace ts3 offline;

alter tablespace ts3 offline temporary;

alter tablespace ts3 offline for recover;

資料檔案離線

alter database datafile'/ home/ oracle/ ts11. dbf' offline;

alter tablespace ts1 datafile offline;

alter tablespace tts1 tempfile offline;

設定讀寫狀態

alter tablespace ts3 read write;
資料檔案的移動和重新命名需要分四步進行,

第一步將資料檔案處於離線 狀態,

第二步在作業系統中將磁碟上的資料檔案移動到另乙個位置,或者僅僅修改它的名稱

第三步在 資料庫 中 對 檔案 進行 重新命名,

第四 步 是將 資料 檔案 處於 聯機 狀態。

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...