How to Remove and Drop Datafiles from Tablespace in Oracle Databaseデータファイルを削除してからドロップする方法をOracleデータベースのテーブルスペースで
Oracle RDBMS databases stores data logically in the form of tablespaces and physically in the form of data files. OracleのRDBMSのより多くのデータをデータベースに格納さのテーブルスペースの形で論理的にも肉体的には、フォームのデータをファイルです。 The datafiles are added to the tablespaces as database space requirement grows bigger.テーブルスペースのデータファイルが追加されたデータベースのスペース要件として大きく成長します。 However, there are several reasons you may want to remove or delete data files from a tablespace.しかし、には、いくつかの理由を削除したり、削除することができますデータのファイルを、テーブルスペースです。 Such as accidentally add a wrongly sized or unwanted datafile to a tablespace, or the data space usage has became smaller and some data files want to be removed, or attempt to recover Oracle database which fails to start due to missing or corrupted datafiles by removing them, Oracle does not provide an easy way or user interface to delete or drop datafiles from a tablespace.を追加するなど、誤って誤ってテーブルスペースの大きさや不要なDATAFILEをしてか、または、データ容量が小さく、利用方法にはいくつかのデータファイルを削除するか、またはOracleデータベースを復元する試みが失敗した場合を開始するか、または破損し行方不明のためにデータファイルを削除して、 Oracleの提供する簡単な方法はありませんまたはユーザーインターフェイスをテーブルからデータファイルを削除したり、ドロップします。 Once a datafile is made part of a tablespace, it can no longer be detached or removed from the tablespace, albeit there are several workarounds. DATAFILEを一度には、テーブルスペースの一部を、分離できなくなることができますまたはテーブルから削除さは、たとえには、いくつかの回避策です。
How to Completely Drop the Whole Tablespace with All Datafiles テーブルスペース全体を完全にドロップする方法についてすべてのデータファイル
The easiest way to drop a or multiple datafiles is by dropping the entire tablespace together with its datafiles.最も簡単な方法、または複数のデータファイルを削除するには、テーブルスペース全体のドロップと一緒にそのデータファイルです。 If you no longer need the data contents of the tablespace, the following command will drop the tablespace, the datafile, and the tablespace’s contents from the data dictionary.もはや必要とする場合、データの内容を、テーブルスペース、テーブルスペースには、以下のコマンドをドロップすると、 DATAFILEを、との内容のテーブルからのデータ辞書をダウンロードします。 All of the objects that where contained in that tablespace are permanently removed.どこのすべてのオブジェクトが含まれるテーブルスペースが完全に削除します。
DROP TABLESPACE <tablespace name> INCLUDING CONTENTS AND DATAFILES; ドロップテーブルスペース<tablespace内容やデータファイル名を含む;
If you don’t specify “AND DATAFILES”, Oracle will not drop the physical datafile after the DROP TABLESPACE command, but you can always delete the files from operating system shell (If the data files are locked, restart the server).を指定しない場合は"とデータファイル" 、 Oracleは特定の物理的なDATAFILEをドロップドロップした後、テーブルスペースのコマンドを、いつでもオペレーティングシステムからファイルを削除してシェル(の場合、データファイルがロックされ、サーバーを再起動します) 。
But always perform a backup of the database, as the “DROP TABLESPACE” command is irreversible.しかし、データベースのバックアップを実行するには常に、 "ドロップテーブルスペース"コマンドは不可逆的です。 It’s also a good practice to check and identify how many datafiles a tablespace actually has before performing the drop action in order to avoid mistake.それには、良い練習をチェックすると、実際にテーブルスペースを識別する方法については、多くのデータファイルを実行する前にミスを避けるために行動をドロップします。
How to Check How Many Datafiles a Tablespace Has 多くのデータファイルを確認する方法を表にはどのよう
To determine and identify all datafiles that link to a tablespace, use the following query, with tablespace name in capital letter:識別を決定すると、テーブルのすべてのデータファイルにリンクして、次のようなクエリを使用して、テーブルスペースの名前を資本金の手紙:
SELECT file_name, tablespace_name ファイル名を選択し、 tablespace_name
FROM dba_data_files よりdba_data_files
WHERE tablespace_name =’<tablespace name>’; どこtablespace_name = ' <tablespace名' ;
If a tablespace contains multiple datafiles, and you just want to drop one or some of the datafiles and keep the remaining datafiles together with the objects and contents, the objects or data must be exported for the affected table space.テーブルスペースを含む場合は、複数のデータファイル、およびドロップするだけに、 1つまたはいくつかのデータファイルとデータファイルと一緒に、残りの維持は、オブジェクトや内容は、データオブジェクトまたはエクスポートしなければならないため、影響を受けるテーブルスペースです。 Once exported, the tablespace can be dropped with above “DROP TABLESPACE” command.一度にエクスポートすると、テーブルスペースの上に落とし、 "ドロップテーブルスペース"コマンドを使用します。 Then, recreate the tablespace with the datafile(s) required (that you initially want to keep), and then import the objects into the recreated tablespace.その後、テーブルスペースのDATAFILEを再作成します(劇団)が必要となります(最初にしたいことを保つ) 、と入力し、オブジェクトをインポートしてテーブルスペースの再作成します。
If one or more datafiles is missing after a recovery process or accidental deletion, you can use ALTER DATABASE DATAFILE <datafile name> OFFLINE DROP command to make the datafile offline so that database can starts up after which the troubled tablespace can be dropped. 1つまたは複数のデータファイルが存在しない場合、回復プロセスまたは誤って削除した後、 データベースを使用することができますDATAFILEを変える<datafile名 DATAFILEをオフラインでドロップコマンドを使うことで、オフラインのデータベースを起動するようにした後は、テーブルスペースの問題を抱えたが破棄されます。 (See (参照 instruction to recover from missing datafiles命令を回復するデータファイルから行方不明 .) 。 )
How to Resize a Datafile to Minimum Size DATAFILEをどのように最小サイズのサイズを変更する
Another alternative to drop the datafile is by shrinking the size of datafile instead of dropping.もう一つの代わりにドロップするだけのサイズを縮小するDATAFILEのはDATAFILEの代わりにドロップします。 This option is only possible if there is no extents in the datafile.このオプションは、のみ可能なことがない場合はエクステントは、 DATAFILEのです。 If there are none, it’s possible to resize the data file down to a very small file (2 blocks), where Oracle database will no longer create any extent in the datafile.場合にはなし、することが可能にダウンしてデータファイルのサイズを変更する非常に小さなファイル( 2ブロック) 、ここでOracleデータベースは、もはや任意の範囲は、 DATAFILEを作成します。 However, this workaround does not remove the datafile from tablespace nor delete the file physically, but it reduce the risk as no data will be truncated as only empty blocks are reduced.しかし、この回避策はありませんDATAFILEを削除してからファイルを削除してテーブルスペースにも肉体的に、それとしてのリスクを削減するだけに切り捨てられるデータは空のブロックが減少します。 It simply makes it unusable and takes up almost close to no disk space.単に使用不可能にすることとは、ディスクの空き容量アップほとんどないに近いです。 To resize a datafile, use the following query: DATAFILEのサイズを変更するには、次のようなクエリを使用して:
alter database datafile ‘<datafile name>’ resize 8M; データベースDATAFILEを変える' <datafile名'のサイズを変更8メートル;
How to Determine the Extents inside Datafile 内部DATAFILEのエクステントを確認する方法
To check and determine the extents that exists in a datafile, use this query:をチェックすると確認するにエクステントが存在するDATAFILEを使うと、このクエリ:
SELECT owner, segment_name 所有者を選択し、 segment_name
FROM dba_extents a, dba_data_files b よりdba_extentsを、 dba_data_files b
WHERE a.file_id = b.file_id どこa.file_id = b.file_id
AND b.file_name = ‘<datafile name>’ とb.file_name = ' <datafile名'
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要 :これは、機械翻訳ページで提供"現状有姿"を保証します。 Machine translation may be difficult to understand.機械翻訳を理解するのは難しいかもしれません。 Please refer toを参照してください original English articleオリジナルの英語記事索引 whenever possible.いつ可能です。
Share and contribute or get technical support and help atを共有して貢献や技術サポートとヘルプを得る My Digital Life Forums 私のデジタルライフフォーラム .です。
Related Articles関連記事
- How Drop Tablespace and Recover Oracle Database When Accidentally Delete DatafileどのようドロップOracleデータベースのテーブルスペースを回復DATAFILEのときに誤って削除
- How to Rename or Move Oracle Tablespace Datafile to Another Location Oracleのテーブルスペースの名前を変更する方法についてまたはDATAFILEのを別の場所に移動する
- ORA-25153 Temporary Tablespace is Empty Error in OracleメールORA - 25153テンポラリテーブルスペースが空にエラーが発生オラクル
- Oracle ORA-01658 Unable to Create INITIAL Extent for Segment in Tablespace ErrorオラクルのOra - 01658の範囲の最初のセグメントを作成できない場合は、テーブルスペースのエラーが発生
- Delete, Remove or Drop Oracle Stored Packages with Drop Package削除、 Oracleのストアドパッケージを削除したり、ドロップドロップパッケージ
- Oracle Database Link Oracleデータベースのリンク
- ORA-02449 Oracle Drop Table Errorエラーが発生OracleのドロップテーブルのOra - 02449
- Oracle Database Import Error 3113/3114 Oracleデータベースにインポートエラーが発生3114分の3113
- Change Oracle Database User Password Oracleデータベースのユーザのパスワードを変更
- Check Oracle Version Oracleのバージョンを確認

































August 4th, 2007 02:55 2007年8月4日02:55
[...] Tip: How to check datafiles that belong to tablespace. [...]ヒント:データファイルをどのように属してテーブルをチェックする。 [...]