免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2349 | 回复: 3
打印 上一主题 下一主题

请看是否可行:UNDO表空间数据文件被误删的处理 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-04-14 10:05 |只看该作者 |倒序浏览
不小心误删了UNDO表空间的数据文件UNDOTBS01.DBF,我想采用以下步骤处理,各位请看看是否可行:

SQL>;startup mount
SQL>;alter database datafile '/../UNDOTBS01.DBF' offline;
SQL>;alter database open;
SQL>;Create undo tablespace UNDOTBS02  datafile '/../UNDOTBS02.DBF' size 100m;
SQL>; alter system set undo_tablespace=undotbs2;
SQL>; drop tablespace test including contents and datafiles;
然后在INIT文件里也修改UNOD参数:
       undo_tablespace=UNDOTBS02

请问这样是否可行???

论坛徽章:
0
2 [报告]
发表于 2005-04-14 11:06 |只看该作者

请看是否可行:UNDO表空间数据文件被误删的处理

If the datafile lost is Rollback related datafile with active transactions, restore from the previous backup and start the database.   
If the datafile contains rollback with no active rollback segments, you can offline the datafile (after commenting the rollback_segments parameter        assuming that they are private rollback segments) and open the database

论坛徽章:
0
3 [报告]
发表于 2005-04-19 17:38 |只看该作者

请看是否可行:UNDO表空间数据文件被误删的处理

我后来是这样处理的:
SQL>; alter system set undo_management = manual scope=spfile;
SQL>; shutdown immediate
SQL>; startup
SQL>;create pfile=/../init.ora from spfile;
SQL>; drop tablespace UNDOTBS1;提示说有active的rollback,不能drop
SQL>; shutdown imediate
在init.ora中加上如下两行:
   rollback_segments=(system)
   _corrupted_rollback_segments=(_SYSSMU8$,_SYSSMU9$,_SYSSMU10$)
SQL>; startup pfile=/../init.ora
SQL>; drop tablespace UNDOTBS1;
SQL>; create undo tablespace UNDOTBS1 create UNDO tablespace undotbs1 datafile /../undotbs01.dbf size xxxxM;
SQL>; alter system set undo_management = auto scope=spfile;
SQL>; shutdown immediate
SQL>; startup

论坛徽章:
0
4 [报告]
发表于 2005-04-20 02:12 |只看该作者

请看是否可行:UNDO表空间数据文件被误删的处理

find out if the undo tablespace has active transactions

select SEGMENT_NAME, SEGMENT_ID, TABLESPACE_NAME from dba_rollback_segs
where SEGMENT_ID in (select XIDUSN from v$transaction);

if the undo tablespace has active transactions, you will HAVE to restore the whole database (no archive log mode), or restore the backup of the dropped datafile and recover it (archive log mode).

that's the only way to make your database consistent.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP