生产环境数据库恢复一例

恢复过程如下......


现场情况:startup nomout/mount出现ora-600错误。警告日志文件没有具体的错误信息。初步估计是spfile的问题,用create spfile from pfile=‘’后,数据库可以mount,打开的时候出现回滚表空间数据文件需要恢复的错误,断定数据文件损坏,用alter database 把数据文件offline drop,打开数据库,用exp对业务用户做逻辑备份,exp过程中出现其中一张表不能export的错误,原因是需要读损坏的数据文件,经查验后该表是附件表,数据不是特别重要,而且现场有430号的exp备份,故跳过该表继续进行exp

备份完毕后,在数据库open状态下,新建undo表空间,用alter system 把回滚表空间切换到该表空间上;shutdownstartup数据库,想把原来的回滚表空间用drop tablespace来清掉的时候,出现回滚段有活动事务的错误,咨询oracle支持,据oracle工程师的说法,需要新建数据库并把原来的业务数据重新import到数据库中。于是重建数据库,建立与原来数据库用户一致的用户名,用imp的用户模式把原业务数据重新imp到新数据库中。附件表数据用430号的备份来导入。

修改中间件服务器数据源的sid,指向新数据库,并测试通过。最后打开业务应用,确认应用可以连接数据库,操作一切正常,恢复完成。

 

附件1

执行脚本

create spfile from pfile=’’;

startup mount;

alter database datafile ‘’ offline drop;

alter database open;

-- 此时进行exp

create undo tablespace undo_tbs datafile ‘’ size 500m;

alter system set undo_tablespace = undo_tbs scope = both;

shutdown immediate;

startup;

drop tablespace undotbs1 including contents and datafiles;

-- 出错!只能重建数据库并导入

-- 新建数据库,并用imp导入业务用户数据

 

附件2

oracle支持工程师提出的解决方案

 

When the undo tablespace corrupted, there are some active transaction on the undo segment.Since the data file of the undo tablespace have been lost and you have no any backup of them, you have to do a full export of the current database and then create a new database, import the data back into the new database.

You'd better do backup and run the database in archive mode, this can help avoid losting data and recover fast.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/6906/viewspace-21551/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/6906/viewspace-21551/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值