How to Remove and Drop Datafiles from Tablespace in Oracle Database Cara Hapus dan Drop Datafiles dari tablespace di Oracle Database
Oracle RDBMS databases stores data logically in the form of tablespaces and physically in the form of data files. RDBMS database oracle menyimpan data secara logis dalam bentuk tablespace dan secara fisik dalam bentuk file data. The datafiles are added to the tablespaces as database space requirement grows bigger. Para datafiles ditambahkan ke database tablespace sebagai kebutuhan ruang tumbuh lebih besar. However, there are several reasons you may want to remove or delete data files from a tablespace. Namun, ada beberapa alasan Anda mungkin ingin untuk menghapus atau menghapus file data dari sebuah 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. Seperti sengaja menambah ukuran salah atau tidak diinginkan datafile ke tablespace, atau penggunaan kapasitas data yang telah menjadi lebih kecil dan beberapa file data yang ingin dihapus, atau mencoba untuk memulihkan database Oracle yang gagal untuk memulai karena hilang atau rusak datafiles dengan membuang mereka , Oracle tidak menyediakan cara yang mudah atau user interface untuk menghapus atau menjatuhkan datafiles dari sebuah tablespace. 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. Sekali datafile dibuat bagian dari tablespace, itu tidak lagi dapat dilepaskan atau dihapus dari tablespace, meskipun ada beberapa workarounds.
How to Completely Drop the Whole Tablespace with All Datafiles Bagaimana Completely Drop tablespace Utuh dengan Semua Datafiles
The easiest way to drop a or multiple datafiles is by dropping the entire tablespace together with its datafiles. Cara termudah untuk mengurangi salah satu atau beberapa datafiles adalah dengan menjatuhkan seluruh tablespace bersama-sama dengan 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. Jika Anda tidak lagi membutuhkan isi data tablespace, perintah berikut ini akan menjatuhkan tablespace, yang datafile, dan tablespace isi dari kamus data. All of the objects that where contained in that tablespace are permanently removed. Semua objek-objek yang mana yang terdapat dalam tablespace secara permanen dihapus.
DROP TABLESPACE <tablespace name> INCLUDING CONTENTS AND DATAFILES; DROP tablespace <tablespace name> TERMASUK ISI DAN DATAFILES;
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). Jika Anda tidak menentukan "DAN DATAFILES", Oracle tidak akan menjatuhkan fisik datafile tablespace setelah perintah DROP, tapi Anda selalu dapat menghapus file dari sistem operasi shell (Jika file data terkunci, restart server).
But always perform a backup of the database, as the “DROP TABLESPACE” command is irreversible. Tetapi selalu melakukan backup database, sebagai "DROP tablespace" perintah ireversibel. 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. Ini juga merupakan praktik yang baik untuk memeriksa dan mengidentifikasi berapa banyak yang tablespace datafiles sebenarnya memiliki sebelum melakukan tindakan drop untuk menghindari kesalahan.
How to Check How Many Datafiles a Tablespace Has Cara Periksa Berapa Banyak Datafiles sebuah tablespace Has
To determine and identify all datafiles that link to a tablespace, use the following query, with tablespace name in capital letter: Untuk menentukan dan mengidentifikasi semua datafiles yang memiliki pranala ke suatu tablespace, gunakan query berikut, dengan nama tablespace dalam huruf besar:
SELECT file_name, tablespace_name SELECT file_name, tablespace_name
FROM dba_data_files DARI dba_data_files
WHERE tablespace_name ='<tablespace name>'; WHERE tablespace_name = '<tablespace name>';
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. Jika suatu tablespace berisi beberapa datafiles, dan Anda hanya ingin menjatuhkan salah satu atau beberapa datafiles dan menyimpan sisanya datafiles bersama-sama dengan benda-benda dan isinya, objek-objek atau data harus diekspor untuk ruang meja yang terkena. Once exported, the tablespace can be dropped with above “DROP TABLESPACE” command. Setelah diekspor, tablespace dapat dijatuhkan dengan di atas "DROP tablespace" perintah. Then, recreate the tablespace with the datafile(s) required (that you initially want to keep), and then import the objects into the recreated tablespace. Kemudian, menciptakan kembali tablespace dengan datafile (s) yang diperlukan (yang Anda awalnya ingin tetap), dan kemudian mengimpor benda ke tablespace diciptakan kembali.
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. Jika satu atau lebih datafiles yang hilang setelah proses pemulihan atau penghapusan tidak disengaja, Anda dapat menggunakan ALTER DATABASE OFFLINE DATAFILE <datafile name> perintah DROP untuk membuat datafile offline database sehingga dapat dijalankan setelah yang tablespace yang bermasalah dapat dijatuhkan. (See (Lihat instruction to recover from missing datafiles instruksi untuk pulih dari hilang datafiles .) .)
How to Resize a Datafile to Minimum Size Bagaimana Resize Datafile untuk sebuah Luas Minimum
Another alternative to drop the datafile is by shrinking the size of datafile instead of dropping. Alternatif lain untuk menjatuhkan datafile adalah dengan menyusut ukuran datafile bukannya turun. This option is only possible if there is no extents in the datafile. Pilihan ini hanya mungkin jika tidak ada di datafile extent. 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. Jika tidak ada, mungkin untuk mengubah ukuran file data ke file yang sangat kecil (2 blok), dimana database Oracle tidak akan lagi menciptakan batas tertentu di 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. Namun, prosedur ini tidak menghapus datafile dari tablespace atau menghapus file secara fisik, tapi itu mengurangi risiko karena tidak ada data yang akan dipotong hanya sebagai blok kosong berkurang. It simply makes it unusable and takes up almost close to no disk space. Ini hanya membuat tidak dapat digunakan dan memakan waktu hampir dekat dengan tidak ada disk space. To resize a datafile, use the following query: Untuk mengubah ukuran suatu datafile, gunakan query berikut:
alter database datafile '<datafile name>' resize 8M; alter database datafile '<datafile name>' merubah ukuran 8M;
How to Determine the Extents inside Datafile Cara Tentukan luasan dalam Datafile
To check and determine the extents that exists in a datafile, use this query: Untuk memeriksa dan menentukan luasan yang ada dalam sebuah datafile, gunakan query ini:
SELECT owner, segment_name SELECT pemilik, segment_name
FROM dba_extents a, dba_data_files b DARI dba_extents a, b dba_data_files
WHERE a.file_id = b.file_id WHERE a.file_id = b.file_id
AND b.file_name = '<datafile name>' DAN b.file_name = '<datafile name>'
IMPORTANT : The page is machine translated and provided "as is" without warranty. PENTING: Halaman ini adalah mesin diterjemahkan dan diberikan "sebagaimana adanya" tanpa jaminan. Machine translation may be difficult to understand. Terjemahan mesin mungkin sulit untuk mengerti. Please refer to Silakan merujuk ke original English article artikel asli bahasa Inggris whenever possible. bila memungkinkan.
Related Articles Artikel Terkait
- How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile Bagaimana Drop tablespace dan Recover Oracle Database Ketika sengaja Hapus Datafile
- Oracle ORA-01658 Unable to Create INITIAL Extent for Segment in Tablespace Error ORA-01658 oracle Tidak dapat Buat Luas AWAL untuk Segmen dalam tablespace Kesalahan
- How to Rename or Move Oracle Tablespace Datafile to Another Location Bagaimana Oracle Ubah nama atau Pindah ke lain tablespace Datafile Lokasi
- ORA-25153 Temporary Tablespace is Empty Error in Oracle ORA-25153 tablespace is Empty Temporary Error di Oracle
- Delete, Remove or Drop Oracle Stored Packages with Drop Package Hapus, Hapus atau Drop Oracle Stored Paket dengan Paket Drop
- Oracle Database Link Oracle Database Link
- Change Oracle Database User Password Ubah Oracle Database User Password
- ORA-02449 Oracle Drop Table Error ORA-02449 Oracle Drop Tabel Error
- Oracle Database Import Error 3113/3114 Kesalahan Impor Oracle Database 3113/3114
- Oracle EXP-00091 Error When Export Database EXP-00091 oracle Error Ketika Ekspor Database










































August 4th, 2007 02:55 4 Agustus 2007 02:55
[...] Tip: How to check datafiles that belong to tablespace. [...] Tips: Bagaimana memeriksa datafiles milik tablespace. [...] [...]