Tablespace
Tablespace
0.更新履歴
1.はじめに
このドキュメントは,Tablespaceの利用方法ついて記述するものである.
2.Tablespace色々
SVRMGR> create tablespace USR datafile '/oracle/data/usr.dbf'
2> size 500M
3> default storage (initial 500M NEXT 100M)
4> ;
|
create tablespace USR
DATAFILE
'/oracle/data/dbf1/dbf1.dbf' SIZE 4000M,
'/oracle/data/dbf2/dbf2.dbf' SIZE 4000M;
|
VRMGR> select tablespace_name,initial_extent,next_extent
2> from dba_tablespaces;
TABLESPACE_NAME INITIAL_EX NEXT_EXTEN
------------------------------ ---------- ----------
SYSTEM 10240 10240
OEM_REPOSITORY 131072 131072
RBS 131072 131072
TEMP 262144 262144
USERS 51200 51200
INDX 51200 51200
DRSYS 10240 10240
USR 10240 10240
8 rows selected.
SVRMGR>
|
alter tablespace USR coalesce;
|
SVRMGR> select sum(bytes) from dba_free_space where tablespace_name = 'USR';
SUM(BYTES)
----------
3784456192
1 row selected.
SVRMGR> select sum(bytes) from dba_free_space where tablespace_name = 'SYSTEM';
SUM(BYTES)
----------
42405888
1 row selected.
SVRMGR>
|
db1% svrmgrl
Oracle Server Manager Release 3.1.5.0.0 - Production
(c) Copyright 1997, Oracle Corporation. All Rights Reserved.
Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
With the Partitioning and Java options
PL/SQL Release 8.1.5.0.0 - Production
SVRMGR> connect internal
Connected.
SVRMGR> drop tablespace usr
2> ;
drop tablespace usr
*
ORA-01549: tablespace not empty, use INCLUDING CONTENTS option
SVRMGR> drop tablespace usr including contents
2> ;
Statement processed.
SVRMGR>
|
テーブルスペースに中身がある場合は,INCLUDING CONTENTS をつけると強制的に消すことができる.