How to Remove and Drop Datafiles from Tablespace in Oracle Database Come rimuovere e da Drop Datafiles 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 database memorizza dati logicamente in forma di tablespaces e fisicamente in forma di file di dati. The datafiles are added to the tablespaces as database space requirement grows bigger. Il datafiles sono aggiunte le tablespaces come banca dati spazio requisito cresce più grande. However, there are several reasons you may want to remove or delete data files from a tablespace. Tuttavia, vi sono diversi motivi è possibile che si desideri rimuovere o cancellare i dati da un file 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. Come ad esempio accidentalmente aggiungere un torto dimensioni o indesiderati archivio dei dati relativi a un tablespace, oppure i dati di utilizzo dello spazio è diventato più piccolo e alcuni file di dati vogliono essere rimosso, o tentare di recuperare i database Oracle che non parte a causa di mancanti o danneggiati datafiles di rimuoverli , Oracle non fornisce un modo semplice interfaccia utente o per eliminare o goccia datafiles da un 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. Una volta che un archivio dei dati è fatto parte di un tablespace, non può più essere staccati o rimosso dalla tablespace, anche se ci sono diverse soluzioni.
How to Completely Drop the Whole Tablespace with All Datafiles Come goccia completamente l'intero tablespace con tutti i Datafiles
The easiest way to drop a or multiple datafiles is by dropping the entire tablespace together with its datafiles. Il modo più semplice per eliminare una o più datafiles è di cadere l'intero tablespace insieme con i suoi 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. Se non hai più bisogno dei dati contenuti di tablespace, il seguente comando la discesa tablespace, l'archivio dei dati, e tablespace del contenuto dal dizionario dei dati. All of the objects that where contained in that tablespace are permanently removed. Tutti gli oggetti che, se contenute in tale tablespace sono rimossi in modo permanente.
DROP TABLESPACE <tablespace name> INCLUDING CONTENTS AND DATAFILES; DROP tablespace <tablespace name> contenuto E 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). Se non si specifica "E DATAFILES", Oracle non far cadere il fisico archivio dei dati dopo il comando DROP tablespace, ma si può sempre cancellare il file dalla shell di sistema operativo (Se il file di dati sono bloccato, riavviare il server).
But always perform a backup of the database, as the “DROP TABLESPACE” command is irreversible. Ma sempre eseguire una copia di backup del database, come il "DROP tablespace" comando è irreversibile. 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. È anche una buona pratica per controllare e identificare quanti datafiles uno tablespace ha effettivamente prima di eseguire la goccia d'azione al fine di evitare errore.
How to Check How Many Datafiles a Tablespace Has Come controllare quanti Datafiles uno ha tablespace
To determine and identify all datafiles that link to a tablespace, use the following query, with tablespace name in capital letter: Di determinare e identificare tutti i datafiles che contengono link a un tablespace, utilizzare la seguente query di ricerca, con tablespace nome in lettera maiuscola:
SELECT file_name, tablespace_name SELECT nome_file, tablespace_name
FROM dba_data_files DA dba_data_files
WHERE tablespace_name =’<tablespace name>’; DOVE 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. Se un tablespace contiene più datafiles, e si desidera solo discesa di uno o alcuni dei datafiles e mantenere le restanti datafiles insieme con gli oggetti e contenuti, gli oggetti o dati devono essere esportati, per le tabella spazio. Once exported, the tablespace can be dropped with above “DROP TABLESPACE” command. Una volta esportato, tablespace può essere eliminato con sopra "DROP tablespace". Then, recreate the tablespace with the datafile(s) required (that you initially want to keep), and then import the objects into the recreated tablespace. Quindi, ricreare il tablespace con l'archivio dei dati (s) richiesto (che inizialmente si desidera mantenere), e quindi importare gli oggetti in ricreato il tablespace.
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. Se uno o più datafiles è mancante dopo un processo di recupero o eliminazione accidentale, è possibile utilizzare ALTER DATABASE archivio dei dati <datafile name> OFFLINE DROP comando per rendere il archivio dei dati in modalità non in linea in modo tale che può banca dati si avvia al termine del quale l'travagliata tablespace può essere eliminato. (See (Cfr. instruction to recover from missing datafiles istruzioni per recuperare dal mancanti datafiles .)
How to Resize a Datafile to Minimum Size Come ridimensionare un archivio dei dati di taglia minima
Another alternative to drop the datafile is by shrinking the size of datafile instead of dropping. Un'altra alternativa alla discesa è l'archivio dei dati, riducendo la dimensione di archivio dei dati, invece di cadere. This option is only possible if there is no extents in the datafile. Questa opzione è possibile solo se non vi è alcuna misura in archivio dei dati. 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. Se non ve ne sono, è possibile ridimensionare il file di dati fino a un piccolo file (2 blocchi), se del database Oracle non sarà più creare qualsiasi misura in archivio dei dati. 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. Tuttavia, questa soluzione non rimuove il tablespace da archivio dei dati, né eliminare il file fisicamente, ma di ridurre il rischio in quanto nessun dato verrà troncato in quanto solo vuota blocchi sono ridotti. It simply makes it unusable and takes up almost close to no disk space. E 'semplicemente rende inutilizzabile e occupa quasi a non chiudere lo spazio su disco. To resize a datafile, use the following query: Ridimensionare un archivio dei dati, utilizzare la seguente query di ricerca:
alter database datafile ‘<datafile name>’ resize 8M; modificare archivio dei dati del database '<datafile name>' ridimensionare 8M;
How to Determine the Extents inside Datafile Come determinare la Extents all'interno archivio dei dati
To check and determine the extents that exists in a datafile, use this query: Per controllare e determinare la misura che esiste in un archivio dei dati, utilizzare questa query:
SELECT owner, segment_name SELECT proprietario, segment_name
FROM dba_extents a, dba_data_files b DA dba_extents a, b dba_data_files
WHERE a.file_id = b.file_id DOVE a.file_id = b.file_id
AND b.file_name = ‘<datafile name>’ E b.file_name = '<datafile name>'
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Questa è una pagina tradotta macchina che è fornito "così com'è" senza alcuna garanzia. Machine translation may be difficult to understand. Traduzione automatica può essere difficile da capire. Please refer to Si prega di fare riferimento a original English article articolo originale in lingua inglese whenever possible. quando possibile.
Share and contribute or get technical support and help at Condividere e contribuire o ottenere supporto tecnico e assistenza in My Digital Life Forums La mia vita digitale Forum .
Related Articles Articoli correlati
- How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile Come goccia tablespace e recuperare database Oracle quando accidentalmente eliminare archivio dei dati
- How to Rename or Move Oracle Tablespace Datafile to Another Location Come rinominare o spostare Oracle tablespace archivio dei dati in un'altra posizione
- ORA-25153 Temporary Tablespace is Empty Error in Oracle ORA-25153 temporanea Tablespace è Vuoto Errore in Oracle
- Oracle ORA-01658 Unable to Create INITIAL Extent for Segment in Tablespace Error Oracle ORA-01658 Impossibile creare INIZIALE Estensione per il segmento in errore Tablespace
- Delete, Remove or Drop Oracle Stored Packages with Drop Package Eliminare, rimuovere o goccia oracolo memorizzati i pacchetti a goccia pacchetto
- Oracle Database Link Oracle database di link
- ORA-02449 Oracle Drop Table Error ORA-02449 Oracle goccia tabella di errore
- Oracle Database Import Error 3113/3114 Database Oracle errore di importazione 3113/3114
- Change Oracle Database User Password Cambia database Oracle Utente Password
- Check Oracle Version Verificare la versione di Oracle
















August 4th, 2007 02:55 Ago 4, 2007 02:55
[...] Tip: How to check datafiles that belong to tablespace. [...] Suggerimento: Come controllare datafiles che appartengono a tablespace. [...]