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.
Related Articles In Verbindung stehende Artikel
- How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile Wie Drop Tablespace und Wiederherstellung von Oracle-Datenbank Wenn versehentlich löschen Datafile
- Oracle ORA-01658 Unable to Create INITIAL Extent for Segment in Tablespace Error Oracle ORA-01658 Unable to Create INITIAL Umfang für Segment im Tablespace Fehler
- How to Rename or Move Oracle Tablespace Datafile to Another Location Wie zu Umbenennen oder Verschieben Oracle Tablespace Datafile an einen anderen Ort
- Delete, Remove or Drop Oracle Stored Packages with Drop Package Löschen, Entfernen oder Drop Oracle Stored Packages mit Drop-Paket
- ORA-25153 Temporary Tablespace is Empty Error in Oracle ORA-25153 Temporary Tablespace ist leer Fehler in Oracle
- ORA-02449 Oracle Drop Table Error ORA-02449 Oracle DROP TABLE-Fehler
- Oracle Database Link Oracle Database Link
- Change Oracle Database User Password Change Oracle Database User Password
- Oracle Database Import Error 3113/3114 Oracle Database Import Error 3113/3114
- View and Retrieve Oracle Database Link Details Anzeigen und Abrufen von Oracle Database Link Details










































August 4th, 2007 02:55 4. August 2007 02:55
[...] Tip: How to check datafiles that belong to tablespace. [...] Tipp: Wie Sie Dateien, die zu Tablespace. [...] [...]