ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 生产环境数据库恢复一例

生产环境数据库恢复一例

原创 Linux操作系统 作者:husthxd 时间:2004-09-28 00:00:00 0 删除 编辑

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


现场情况: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/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 中秋节快乐!
下一篇: 短信
请登录后发表评论 登录
全部评论
ITPUB数据库版块资深版主,对Oracle、PostgreSQL有深入研究。

注册时间:2007-12-28

  • 博文量
    1559
  • 访问量
    4231593