N
N
Nikolay Baranenko2017-05-08 14:04:23
Oracle
Nikolay Baranenko, 2017-05-08 14:04:23

How to delete data files without table space?

It was necessary to recreate the table space via DROP.
Oracle Database 12c - 12.2.0.1.0, Microsoft Windows [Version 10.0.10240]
I naively thought that when you delete a table space through the developer 12 PL-SQL interface , the
data files that are in it will be automatically deleted.
BUT they stayed.
Now I'm trying to find a way to delete tada files without table space.
Does such a thing exist?
Will everything continue correctly with the Oracle instance if they are simply deleted at the OS level?
if execute this select from SYS

SELECT TABLESPACE_NAME, FILE_NAME, FILE_ID
FROM DBA_DATA_FILES

he does not find them.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
idShura, 2017-05-08
@idShura

Check that there is nothing in the datafile:

SELECT owner, segment_name, segment_type, block_id 
  FROM dba_extents 
       WHERE FILE_ID = <id datafile>
  ORDER BY block_id DESC;

Then remove the datafile:
If the database is running under Windows OS, then most likely the datafile will be deleted from the database, but will remain in the file system. When you try to delete it using OS tools, you will get an error that the file is in use. It can be deleted only after the database is restarted.
If you cannot restart the database, then you can simply reduce the size of the datafile and delete it somehow later.
If the database is test , then you can use the unlocker utility to unlock the file and then delete it. I don't recommend doing this on a working basis.

R
roman_green, 2017-06-23
@roman_green

In fact, if TS is deleted, then the date of the file is no one's. Is he bothering you in any way?
Is this data file in v$datafiles ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question