oracle 使撤消表空间数据文件脱机,处于恢复模式?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5026734/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 22:47:49  来源:igfitidea点击:

Take undo tablespace datafile offline ,which is in recovery mode?

linuxoraclerhel

提问by Xinus

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.

此数据文件处于恢复模式。Oracle 在数据库成功更改时显示消息。

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

但是当我在 v$datafile 中选择条目时执行此命令后。我刚刚离线制作的文件保留在此表中。

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

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

当我检查 v$datafile 表时,无论是否alter database datafile '<datafile path>' offline drop;成功运行,它都会显示该文件的条目,请帮助我解决问题。数据库从早上开始就关闭了,我无法启动

回答by ik_zelf

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.

在 v$tablespaces 中列出了表空间。数据文件在 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.

我希望这有效,罗纳德。