How to Remove and Drop Datafiles from Tablespace in Oracle Database Ako odstrániť a Drop Datafiles z Tablespace v Oracle Database
Oracle RDBMS databases stores data logically in the form of tablespaces and physically in the form of data files. Oracle RDBMS databázy ukladá dáta logicky vo forme tablespaces a fyzicky vo forme dátových súborov. The datafiles are added to the tablespaces as database space requirement grows bigger. V datafiles sú pridané do databázy tablespaces ako priestor rozširuje. However, there are several reasons you may want to remove or delete data files from a tablespace. Existuje však niekoľko dôvodov, že budete chcieť odstrániť alebo zmazať dátové súbory z 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. Ako náhodne pridať neprávom veľkých alebo nežiaduce datafile na Tablespace, alebo údaje, využitie priestoru stala menej a niektoré dátové súbory chcete odstrániť, alebo sa pokúša získať späť Oracle databázy, ktorá nedokáže spustiť kvôli chýbajúce alebo poškodené datafiles odstránením nich Oracle neposkytuje jednoduchú cestu alebo užívateľské rozhranie pre odstránenie alebo pokles datafiles z 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. Jednou datafile sa v rámci Tablespace, že už nemôžu byť oddelené, alebo odstrániť z Tablespace, aj keď existuje niekoľko riešení.
How to Completely Drop the Whole Tablespace with All Datafiles Ako úplne Odhoï Celá Tablespace so všetkými Datafiles
The easiest way to drop a or multiple datafiles is by dropping the entire tablespace together with its datafiles. Najjednoduchší spôsob, ako stratiť alebo viac datafiles je pád celého Tablespace spolu s jeho 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. Ak nepotrebujete dáta obsahu zo Tablespace, nasledujúci príkaz odhodiť Tablespace sa datafile a Tablespace obsahu z údajov slovníka. All of the objects that where contained in that tablespace are permanently removed. Všetky predmety, ktoré, ak sú obsiahnuté v tomto Tablespace sa natrvalo odstránia.
DROP TABLESPACE <tablespace name> INCLUDING CONTENTS AND DATAFILES; DROP Tablespace <tablespace Name> VRÁTANE BALENIE A 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). Ak neuvediete "A DATAFILES", Oracle nebude pokles fyzickej datafile po DROP Tablespace príkazom, ale vždy môžete mazať súbory z operačného systému shell (Ak dátové súbory sú zamknuté, reštartovať server).
But always perform a backup of the database, as the “DROP TABLESPACE” command is irreversible. Ale vždy vykonať zálohu databázy, ako "DROP Tablespace" príkaz je neodvolateľné. 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. Je tiež dobré praxe overiť a zistiť, koľko datafiles jeden Tablespace skutočne má pred vykonaním kvapka akcie, aby nedošlo k omylu.
How to Check How Many Datafiles a Tablespace Has Ako skontrolovať, ako veľa Datafiles jeden Tablespace Bola
To determine and identify all datafiles that link to a tablespace, use the following query, with tablespace name in capital letter: Ak chcete zistiť a identifikovať všetky datafiles, že odkaz na Tablespace, použite nasledujúcu otázku, s Tablespace meno vo veľké písmeno:
SELECT file_name, tablespace_name SELECT názovsúboru, tablespace_name
FROM dba_data_files Z dba_data_files
WHERE tablespace_name ='<tablespace name>'; KDE 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. Ak Tablespace obsahuje viac datafiles, a chcete len kvapku jedného alebo niektoré z datafiles a zachovať zostávajúce datafiles spoločne s objektmi a obsah, predmety alebo informácie musia byť vyvážené pre postihnuté miesto tabuľky. Once exported, the tablespace can be dropped with above “DROP TABLESPACE” command. Akonáhle vyvezený, Tablespace možno spadol s vyššie "DROP Tablespace" príkaz. Then, recreate the tablespace with the datafile(s) required (that you initially want to keep), and then import the objects into the recreated tablespace. Potom získala Tablespace s datafile (y) požadovaná (ktoré ste pôvodne chceli zachovať), a potom importovať objekty do Tablespace znova.
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. Ak jeden alebo viac datafiles chýba po obnovení procesu alebo náhodného vymazanie, môžete použiť ALTER DATABASE datafile <datafile Name> Offline DROP príkaz, aby sa datafile offline tak, že databáze možno začína až po ktorej zkormoutil Tablespace môže byť zrušená. (See (Pozri instruction to recover from missing datafiles pokyn, na zotavenie sa zo chýba datafiles .) .)
How to Resize a Datafile to Minimum Size Ako zmeniť veľkosť datafile minimálnej veľkosti
Another alternative to drop the datafile is by shrinking the size of datafile instead of dropping. Inou alternatívou odhodiť datafile sa zmenšuje veľkosť datafile miesto zahodenie. This option is only possible if there is no extents in the datafile. Táto voľba je možná len vtedy, ak neexistuje miere v 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. Ak tomu tak nie je, je možné zmeniť veľkosť súboru dát na veľmi malý súbor (2 bloky), kde databázy Oracle už nebude vytvárať žiadne miere v 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. Ale tento postup nie je odstrániť datafile z Tablespace ani zmazať súbor fyzicky, ale zníženie rizika, ako žiadne dáta budú skrátiť len prázdne bloky sú znížené. It simply makes it unusable and takes up almost close to no disk space. Je prostě je nepoužiteľný a zaberá takmer takmer žiadne miesto na disku. To resize a datafile, use the following query: Ak chcete zmeniť veľkosť datafile, použite nasledujúcu otázku:
alter database datafile '<datafile name>' resize 8M; zmeniť databázu datafile '<datafile Name>' veľkosť 8M;
How to Determine the Extents inside Datafile Ako určiť miere vnútri datafile
To check and determine the extents that exists in a datafile, use this query: Ak chcete skontrolovať a určiť miere, ktorá existuje v datafile použite tento dotaz:
SELECT owner, segment_name SELECT vlastník segment_name
FROM dba_extents a, dba_data_files b Z dba_extents a, b dba_data_files
WHERE a.file_id = b.file_id KDE a.file_id = b.file_id
AND b.file_name = '<datafile name>' A b.file_name = '<datafile Name>'
IMPORTANT : The page is machine translated and provided "as is" without warranty. Upozornenie: Stránka je stroje preložené a poskytované "tak ako sú" bez záruky. Machine translation may be difficult to understand. Strojový preklad môže byť ťažké pochopiť. Please refer to Obráťte sa prosím na original English article Anglický originál článku whenever possible. kedykoľvek je to možné.
Related Articles Súvisiace články
- How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile Ako Drop Tablespace a Recover Oracle Database Kedy Náhodne Odstrániť datafile
- Oracle ORA-01658 Unable to Create INITIAL Extent for Segment in Tablespace Error Oracle ORA-01658 Nemožno vytvoriť POČIATOČNEJ Rozsah za Segment v Tablespace Chyba
- How to Rename or Move Oracle Tablespace Datafile to Another Location Ako premenovať alebo presunúť Oracle Tablespace datafile na iné miesto
- Delete, Remove or Drop Oracle Stored Packages with Drop Package Odstrániť, Vymaza alebo Drop Oracle Skladované Packages s Drop balík
- ORA-25153 Temporary Tablespace is Empty Error in Oracle ORA-25153 Dočasné Tablespace je prázdny Chyba v Oracle
- ORA-02449 Oracle Drop Table Error ORA-02449 Oracle Drop Tabuľka Chyba
- Oracle Database Link Oracle Database Link
- Change Oracle Database User Password Zmeniť Oracle Database Užívateľ Heslo
- Oracle Database Import Error 3113/3114 Oracle Database Import Chyba 3113/3114
- View and Retrieve Oracle Database Link Details Zobrazenie a Načítať Oracle Database Link Detaily










































August 4th, 2007 02:55 4. august 2007 02:55
[...] Tip: How to check datafiles that belong to tablespace. [...] Tip: Ako skontrolovať datafiles, ktoré patria do Tablespace. [...] [...]