首页 > Linux操作系统 > Linux操作系统 > 生产环境数据库恢复一例
恢复过程如下......
现场情况:startup nomout/mount出现ora-600错误。警告日志文件没有具体的错误信息。初步估计是spfile的问题,用create spfile from pfile=‘
备份完毕后,在数据库open状态下,新建undo表空间,用alter system 把回滚表空间切换到该表空间上;shutdown并startup数据库,想把原来的回滚表空间用drop tablespace来清掉的时候,出现回滚段有活动事务的错误,咨询oracle支持,据oracle工程师的说法,需要新建数据库并把原来的业务数据重新import到数据库中。于是重建数据库,建立与原来数据库用户一致的用户名,用imp的用户模式把原业务数据重新imp到新数据库中。附件表数据用4月30号的备份来导入。
修改中间件服务器数据源的sid,指向新数据库,并测试通过。最后打开业务应用,确认应用可以连接数据库,操作一切正常,恢复完成。
附件1
执行脚本
create spfile from pfile=’
startup mount;
alter database datafile ‘
alter database open;
-- 此时进行exp
create undo tablespace undo_tbs datafile ‘
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/,如需转载,请注明出处,否则将追究法律责任。