UJP - 技術情報

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

     

Tablespace

Tablespace


0.更新履歴

  • 2001.03.08 新規作成

1.はじめに

 このドキュメントは,Tablespaceの利用方法ついて記述するものである.

2.Tablespace色々

  • Tablespaceを作成する.

SVRMGR> create tablespace USR datafile '/oracle/data/usr.dbf'
     2> size 500M
     3> default storage (initial 500M NEXT 100M)
     4> ;

  • 複数のファイルにtablespaceを分ける

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>

  • 連続した空きデータブロックを1つにする

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 をつけると強制的に消すことができる.



広告スペース
Google