DROP DATAFILE FROM TABLESPACE IN ORACLE

Check the tablespace for which datafile needs to be removed

SQL> select file_name from dba_data_files where tablespace_name='RCAT';

/apps01/oradata/orcl19x/rcattb1
/data01/base/oradata/ORCL11X/datafile/RCAT5045360.dbf
/data01/base/oradata/ORCL11X/datafile/RCAT20191757.dbf
/data01/base/oradata/ORCL11X/datafile/RCAT87538078.dbf

Drop the individual tablespaces

SQL> alter tablespace rcat drop datafile '/data01/base/oradata/ORCL11X/datafile/RCAT5045360.dbf';

Tablespace altered.

SQL> alter tablespace rcat drop datafile '/data01/base/oradata/ORCL11X/datafile/RCAT20191757.dbf';

Tablespace altered.

SQL> alter tablespace rcat drop datafile '/data01/base/oradata/ORCL11X/datafile/RCAT87538078.dbf';

Tablespace altered.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s