SQL tutorial | Interview questions | Oracle
Would you like to react to this message? Create an account in a few clicks or log in to continue.

What Happens to the Data Files If a Tablespace Is Dropped?

Go down

What Happens to the Data Files If a Tablespace Is Dropped? Empty What Happens to the Data Files If a Tablespace Is Dropped?

Post by Micheal Tue Jan 19, 2010 7:18 pm

If a tablespace is dropped, what happens to its data files? By default, data files will remain in OS file system, even if the tablespace they are mapped is dropped. Of course, you delete the data files using OS commands, if they are no longer needed.
Another way of deleting data files is to use the INCLUDING clause in the DROP TABLESPACE
statement. Here is a SQL sample script:
SQL> CREATE TABLESPACE my_space
2 DATAFILE '/temp/my_space.dbf' SIZE 10M;
Tablespace created.
SQL> DROP TABLESPACE my_space INCLUDING CONTENTS AND DATAFILES;
Tablespace dropped.
With the INCLUDING CONTENTS AND DATAFILES clause, all contents and mapped data files
are also deleted.

Micheal
Admin

Posts : 243
Join date : 2010-01-10

http://sql-tutorial.co.cc

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum