How to Remove and Drop Datafiles from Tablespace in Oracle Database Wie zu entfernen und Drop Datafiles von Tablespace in Oracle Database

Oracle RDBMS databases stores data logically in the form of tablespaces and physically in the form of data files. Oracle RDBMS Datenbanken speichert Daten logisch in Form von Tablespaces und physisch in der Form von Dateien. The datafiles are added to the tablespaces as database space requirement grows bigger. Die Dateien werden in die Datenbank Tablespaces wie Platzbedarf wächst größer. However, there are several reasons you may want to remove or delete data files from a tablespace. Es gibt jedoch mehrere Gründe, können Sie zu entfernen oder zu löschen, Daten aus einem 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. Wie aus Versehen eine falsche Größe oder unerwünschtes datafile einem Tablespace, den Raum oder die Daten-Nutzung hat sich kleinere und einige Dateien entfernt werden möchten, oder versuchen, um die Oracle-Datenbank nicht gestartet werden durch fehlende oder beschädigte Dateien, indem sie , Oracle bietet keine einfache Möglichkeit oder Benutzeroberfläche zu löschen oder Drop Dateien aus einem 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. Sobald eine Datei ist Teil eines Tablespace, kann es nicht mehr werden oder aus dem Tablespace, allerdings gibt es einige Workarounds.

How to Completely Drop the Whole Tablespace with All Datafiles Wie das Ganze komplett Drop Tablespace mit allen Datafiles

The easiest way to drop a or multiple datafiles is by dropping the entire tablespace together with its datafiles. Der einfachste Weg, um ein oder mehrere Dateien ist durch Verzicht auf die gesamte tablespace zusammen mit seinen Datenbeständen. 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. Wenn Sie nicht mehr benötigen, die Daten Inhalt des Tablespace, den folgenden Befehl wird das tablespace, den datafile und der Tablespace den Inhalt aus dem Data Dictionary. All of the objects that where contained in that tablespace are permanently removed. Alle Objekte, die in dem in diesem Tablespace werden permanent gelöscht.

DROP TABLESPACE <tablespace name> INCLUDING CONTENTS AND DATAFILES; DROP TABLESPACE <tablespace name> EINSCHLIESSLICH INHALT UND 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). Wenn Sie keinen "UND Datafiles", Oracle wird nicht fallen die physische Datei nach dem Befehl DROP TABLESPACE, aber Sie können sich jederzeit löschen Sie die Dateien vom Betriebssystem-Shell (Wenn die Daten gesperrt sind, den Server neu starten).

But always perform a backup of the database, as the “DROP TABLESPACE” command is irreversible. Aber immer ein Backup der Datenbank, da die "DROP TABLESPACE" Befehl ist irreversibel. 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. Es ist auch eine gute Praxis zu überprüfen und zu ermitteln, wie viele Dateien eines Tablespace tatsächlich hat, bevor Sie die Drop-Aktion, um Fehler zu vermeiden.

How to Check How Many Datafiles a Tablespace Has Wie um zu überprüfen, wie viele Datafiles einem Tablespace Hat

To determine and identify all datafiles that link to a tablespace, use the following query, with tablespace name in capital letter: Um zu ermitteln, und alle Dateien, die auf einem Tablespace, verwenden Sie die folgende Abfrage, mit tablespace Namen in Großbuchstaben:

SELECT file_name, tablespace_name SELECT file_name, tablespace_name
FROM dba_data_files AUS dba_data_files
WHERE tablespace_name ='<tablespace name>'; WO 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. Wenn ein Tablespace enthält mehrere Dateien, und Sie wollen nur den einen oder einige der Dateien und halten Sie die verbleibenden Dateien zusammen mit den Objekten und die Inhalte, die Objekte oder Daten exportiert werden für die betroffenen Tabelle Raum. Once exported, the tablespace can be dropped with above “DROP TABLESPACE” command. Einmal ausgeführt, der Tablespace kann auch wieder abgewählt werden mit den oben genannten "DROP TABLESPACE"-Befehl. Then, recreate the tablespace with the datafile(s) required (that you initially want to keep), and then import the objects into the recreated tablespace. Dann, stellen Sie den Tablespace mit der Datei (en), die (zunächst, dass Sie halten wollen), und importieren Sie die Objekte in den Tablespace neu.

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. Sollten eine oder mehrere Dateien fehlen nach einer Recovery-Prozess oder versehentliches Löschen, können Sie ALTER DATABASE Datafile <datafile name> OFFLINE DROP-Befehl, um die Datei so, dass die Offline-Datenbank startet, nach dem die unruhigen Tablespace kann auch wieder abgewählt werden. (See (Siehe instruction to recover from missing datafiles Anweisung zur Wiederherstellung von Dateien fehlen .) .)

How to Resize a Datafile to Minimum Size Wie man die Größe eines Datafile auf die Mindestgröße

Another alternative to drop the datafile is by shrinking the size of datafile instead of dropping. Eine weitere Alternative, um die Datei ist durch Schrumpfung die Größe von datafile statt ab. This option is only possible if there is no extents in the datafile. Diese Option ist nur dann möglich, wenn es keine Extents im 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. Wenn es keine gibt, ist es möglich, die Größe der Datei auf eine sehr kleine Datei (2 Blöcke), in dem Oracle-Datenbank wird nicht mehr schaffen, dem Umfang, in der Datei. 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. Allerdings ist diese Lösung nicht entfernen Sie die Datei aus Tablespace löschen Sie die Datei noch physisch, aber das Risiko, da keine Daten werden abgeschnitten, da nur leere Blöcke werden verringert. It simply makes it unusable and takes up almost close to no disk space. Es macht es einfach unbrauchbar und nimmt fast nah an keinen Speicherplatz. To resize a datafile, use the following query: Um die Größe einer Datei, verwenden Sie die folgende Abfrage:

alter database datafile '<datafile name>' resize 8M; ALTER DATABASE datafile "<datafile name> 'Größe 8M;

How to Determine the Extents inside Datafile Wie bestimmt man die Extents innerhalb Datafile

To check and determine the extents that exists in a datafile, use this query: Um zu prüfen und festzustellen, die Größe, die es in einer Datei, verwenden Sie diese Abfrage:

SELECT owner, segment_name SELECT-Besitzer, segment_name
FROM dba_extents a, dba_data_files b AUS dba_extents a, b dba_data_files
WHERE a.file_id = b.file_id WO a.file_id = b.file_id
AND b.file_name = '<datafile name>' UND b.file_name = '<datafile name>'

IMPORTANT : The page is machine translated and provided "as is" without warranty. WICHTIG: Die Seite ist Maschine übersetzt und "as is" ohne Garantie. Machine translation may be difficult to understand. Maschinelle Übersetzung kann schwierig zu verstehen. Please refer to Bitte beachten Sie original English article Original Englisch Artikel whenever possible. wann immer dies möglich ist.


One Response to “How to Remove and Drop Datafiles from Tablespace in Oracle Database” One Response to "How to Remove and Drop Datafiles von Tablespace in Oracle Database"

  1. How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile » My Digital Life Wie Drop Tablespace und Wiederherstellung von Oracle-Datenbank Wenn versehentlich löschen Datafile »Mein Digital Life
    August 4th, 2007 02:55 4. August 2007 02:55
    1 1

    [...] Tip: How to check datafiles that belong to tablespace. [...] Tipp: Wie Sie Dateien, die zu Tablespace. [...] [...]

Leave a Reply Lassen Sie eine Antwort

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Sie können diese Tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Abonnieren Sie Kommentare Funktion wurde deaktiviert. To receive notification of latest comments posted, subscribe to Um Anmeldung der neuesten Kommentare abonnieren My Digital Life Comments RSS feed My Digital Life Kommentare RSS-Feed or oder register to receive Register zu erhalten new comments in daily email digest. neue Kommentare in der täglichen E-Mail-Benachrichtigung.
Custom Search

New Articles Neue Artikel

Incoming Search Terms for the Article Eingehender Suchbegriffe für den Artikel

oracle drop datafile Oracle Drop datafile - -- oracle drop tablespace Oracle Drop Tablespace - -- drop datafile oracle Drop datafile Oracle - -- drop datafile Drop datafile - -- drop tablespace oracle Drop Tablespace Oracle - -- delete tablespace Tablespace löschen - -- oracle remove datafile Oracle entfernen datafile - -- drop tablespace datafile Drop Tablespace datafile - -- oracle delete tablespace Oracle-Tablespace löschen - -- oracle drop tablespace datafile Oracle Drop Tablespace datafile - -- drop oracle datafile Drop Oracle datafile - -- oracle delete datafile Oracle löschen datafile - -- remove datafile entfernen datafile - -- oracle drop tablespace including datafiles Oracle Drop Tablespace-Datendateien, einschließlich - -- remove tablespace entfernen Tablespace - -- drop tablespace command Drop Tablespace Befehl - -- oracle remove datafile from tablespace Oracle entfernen datafile von Tablespace - -- delete tablespace oracle Oracle-Tablespace löschen - -- remove datafile oracle entfernen datafile Oracle - -- drop datafiles Drop Dateien - -- oracle drop datafiles Oracle Drop Dateien - -- delete datafile Datei löschen - -- alter tablespace remove datafile ALTER TABLESPACE datafile entfernen - -- drop tablespace in oracle Drop Tablespace in Oracle - -- delete datafile in oracle löschen datafile in Oracle - -- delete datafile oracle löschen datafile Oracle - -- drop datafile in oracle Drop-Datei in Oracle - -- drop datafile from tablespace Drop datafile von Tablespace - -- remove datafile from tablespace entfernen datafile von Tablespace - -- drop tablespace and datafiles Drop Tablespace und Datendateien - -- HOW TO DELETE DATAFILE IN ORACLE So löschen Datafile in ORACLE - -- how to drop datafile in oracle wie Drop datafile in Oracle - -- oracle drop tablespace and datafile Oracle Drop Tablespace und datafile - -- delete oracle datafile Oracle-Datei löschen - -- drop tablespace and datafile Drop Tablespace und datafile - -- oracle remove datafiles Oracle-Dateien entfernen - -- drop datafile + oracle Drop datafile + Oracle - -- drop tablespace including datafile Drop Tablespace einschließlich datafile - -- drop tablespace including contents and datafiles Drop Tablespace einschließlich der Inhalte und Dateien - -- how to delete tablespace So löschen Tablespace - -- oracle drop datafile from tablespace Oracle Drop Tablespace-Datei aus - -- delete oracle tablespace Oracle-Tablespace löschen - -- oracle resize tablespace Oracle-Tablespace-Größe - -- drop datafiles oracle Drop Dateien Oracle - -- delete tablespace in oracle löschen Tablespace in Oracle - -- Oracle drop tablespace datafiles Oracle Drop Tablespace-Datendateien - -- drop tablespace including datafiles Drop Tablespace einschließlich Datendateien - -- Oracle dropping datafile Oracle Drop datafile - -- remove oracle datafile entfernen Oracle datafile - -- drop datafile tablespace Drop datafile Tablespace - -- oracle drop tablespace with datafile Oracle Drop Tablespace mit datafile - -- how to remove tablespace zum Entfernen von Tablespace - -- drop file oracle Drop Datei oracle - -- how to drop datafile wie Drop datafile - -- delete a tablespace Löschen eines Tablespace - -- DROP TABLESPACE WITH DATAFILE DROP TABLESPACE MIT Datafile - -- remove datafile from tablespace oracle entfernen datafile aus Oracle-Tablespace - -- drop tablespace file Drop Tablespace-Datei - -- drop datafile Drop datafile - -- drop oracle tablespace Drop Oracle-Tablespace - -- how to remove a datafile So entfernen Sie ein datafile - -- alter tablespace drop datafile ALTER TABLESPACE datafile Drop - -- how to drop oracle datafile fallen zu lassen, wie Oracle datafile - -- how to delete datafile from tablespace So löschen datafile von Tablespace - -- oracle tablespace drop file Oracle-Tablespace-Drop-Datei - -- how to drop datafiles in oracle wie Drop Dateien in Oracle - -- drop tablespace command in oracle Drop-Befehl in Oracle-Tablespace - -- HOW TO DELETE DATAFILE So löschen Datafile - -- remove datafile tablespace entfernen datafile Tablespace - -- ORACLE DATAFILE DELETE ORACLE Datafile DELETE - -- oracle drop datafile Oracle Drop datafile - -- oracle drop data file Oracle-Drop-Datei - -- Dropping datafile from tablespace Dropping datafile von Tablespace - -- deleting oracle datafile Löschen von Oracle datafile - -- delete tablespace name Tablespace-Namen löschen - --