Beruflich Dokumente
Kultur Dokumente
htm
SELECT *
FROM
dba_data_files
WHERE
tablespace_name = 'TABLESPACE';
FROM dba_data_files
where tablespace_name IN
note the formating Major commands are on a new line (select, from, where...)
1.get a list of the 'rm ' records that the select above produces and save to a file first
3.then at the linux prompt past the rm commands that you saved to delete the datafiles.
'RM'||FILE_NAME
--------------------------------------------------------------------------------
rm /u01/oradata/starship/AR_SEG.dbf
rm /u04/oradata/starship/CHKREG_SEG.1.dbf
rm /u02/oradata/starship/CSP_SEG.1.dbf
rm /u04/oradata/starship/GEN_SEG.1.dbf
rm /u05/oradata/starship/IP_SEG.1.dbf
rm /u02/oradata/starship/MP_SEG.1.dbf
rm /u01/oradata/starship/SL_SEG.1.dbf
rm /u04/oradata/starship/SMSAPP_SEG_.1.DBF
rm /u05/oradata/starship/SMSH_SEG.1.dbf
rm /u01/oradata/starship/SMS_SEG.1.dbf
rm /u03/oradata/starship/USER_SEG.1.dbf
'RM'||FILE_NAME
--------------------------------------------------------------------------------
rm /u04/oradata/starship/TEST_SEG.1.dbf
rm /u02/oradata/starship/OL_SEG.1.dbf
rm /u02/oradata/starship/OL_SEG.2.dbf
rm /u03/oradata/starship/FOF_SEG.1.dbf
15 rows selected.
How Drop Tablespace and Recover Oracle Database When Accidentally Delete Datafile
Accident may happens, even though it’s costly one. This is especially the case in Oracle
database, which stores the database objects physically in data files on hard disk. Fast hand
administrators may accidentally delete some of the datafiles, or the datafiles may get
corrupted or unreadable on hard disk failure. You may get also some missing datafiles
after database recovery process. In any case, missing a or a few datafiles will cause Oracle
database to fail to startup, rendering the whole DB inaccessible.
The solution to the missing datafiles is to drop the affected tablespace where has
incomplete datafiles, and then recreate the tablespace and import the data into the
tablespace from backup. However, the steps are not so straight forward.
1. Run SQL
*Plus.
CONNECT / AS SYSDBA
STARTUP MOUNT;
4. Issue the following command to bring the missing datafile offline so that Oracle
won’t trying to connect and access the datafile anymore:
7. Ensure the other datafiles for the tablespace has been deleted, if not, remove them
manually from the operating system.
http://it.toolbox.com/wiki/index.php/Delete_datafile_from_Tablespace
Sometime we need to delete datafiles belongs to a Tablespace in this case we can not do this as
simple way it should be. Unfortunaly we need to do drop the entire tablespace. But since you may
not want to lose the information in the tablespace before dropping it, take an export backup of the
tablespace info, drop the tablespace, recreate tablespace and import back.
[edit]
Steps
You need to drop the entire tablespace.
[edit]
Examples
DROP TABLESPACE PSAPGETRD
INCLUDING CONTENTS AND DATAFILES;
The above example dropped a tablespace and deletes all associated operating system datafiles.
[edit]
Conclusion
http://it.toolbox.com/wiki/index.php/Category:Oracle-db-l
http://it.toolbox.com/wiki/index.php/Category:Database_HOWTOs
http://it.toolbox.com/wiki/index.php/Category:Database_Development
http://www.gc.maricopa.edu/business/oracle/docs/Oracle80Docs/doc/database.804/a5839
7/toc.htm