Question

I am trying to take undo datafile in offline mode using following command

alter database datafile '<datafile path>' offline;

this datafile is in recovery mode. Oracle shows message as database successfully altered.

But after executing this command when I select entries in v$datafile. The file that I just made offline remains in this table.

Can somebody please tell how to take undo datafile offline.

OS: RHEL
Oracle version: 11g
Datafile status: Recovery

EDIT:

I already tried command

alter database datafile '/your/data/file/name' offline drop

it says database altered successfully ,

alter database open;

fails with message <my undo log file name> needs recovery of undo file.

I cannot recover it as I have lost the archive files. It seems like file is getting dropped logically not physically. Now I just want my database to be up and running and for that I want to take this file to be offline.

When I check v$datafile table it shows the entry for the file irrespective of alter database datafile '<datafile path>' offline drop; ran succesfully, Please help me resolve the issue. Database is down from the morning and I could not get it started

Was it helpful?

Solution

Why do you want to do this? What are you trying to accomplish?

In v$tablespaces are the tablespaces listed. The datafiles are in v$datafiles.

A tablespace can have multiple datafiles. How is your database and backup setup ? Do you need the tablespace?

If you just want to get rid of the datafile (and the tablespace) you could try to drop it while in mount mode:

startup mount
alter database datafile '/your/data/file/name' offline drop;
alter database open;
drop tablespace your_tablespace_name including contents and datafiles;

If you do need the tablespace online, you start with restoring the datafile and do a full media recovery.

I hope this works, Ronald.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top