数据库恢复从ora-01152错误开始一路问题解决过程

做一个数据库的恢复,客户指定恢复7月1日的,查看了集中备份里的刚好最早的备份是7月1日,而后一次备份是7月18日。
照常恢复控制文件,然后restore database,recover database;

期间没有相应的文件系统,建了文件系统,后来空间不够叫sa增加了空间。
                                                                                                           

点击(此处)折叠或打开

  1. #mkdir /oradata
  2. #mklv -t jfs2 -y lv_oradata datavg 1022G
  3. #crfs -v jfs2 -d lv_oradata -A yes -m
  4. #mount /oradata
  5. #df -g
    
restore database结束,进行recover database 提示 
RMAN-06025 no backup of log thread 1 seq 40438 lowscn 5480793347 found to restore

alter database open resetlogs 提示
ora-01152: file 1 was not restored from a sufficiently old backup

这是无论怎么起都提示以上错误,其实解决很简单
这是可以将   40438日志取下来做recover,但很不巧该日志丢失了;


于是想到了修改隐含参数 _allow_resetlogs_corruption,跳过一致性检测。
于是:
                                                                                                                                                                                                                                  
                                                                                                                                                                                  
alter system set "_allow_resetlogs_corruption"=true scope=spfile;

alter database open resetlogs;
(PS:这期间因redo日志路径的问题出现错误,于是进行清除redo,然后重建)                                                                                                 )
alter database open;

数据库直接关闭,alert 日志提示以下内容:                               
  1. Wed Aug 19 09:12:50 BEIST 2015
  2. ORA-01555 caused by SQL statement below (SQL ID: 4krwuz0ctqxdt, SCN: 0x0001.46b0aa96):
  3. Wed Aug 19 09:12:50 BEIST 2015
  4. select ctime, mtime, stime from obj$ where obj# = :1
  5. Wed Aug 19 09:12:50 BEIST 2015
  6. Errors in file /opt/app/oracle/products/10205/rdbms/log/gessdb_ora_13959238.trc:
  7. ORA-00704: bootstrap process failure
  8. ORA-00704: bootstrap process failure
  9. ORA-00604: error occurred at recursive SQL level 1
  10. ORA-01555: snapshot too old: rollback segment number 6 with name "_SYSSMU6$" too small
  11. Error 704 happened during db open, shutting down database
  12. USER: terminating instance due to error 704
  13. Instance terminated by USER, pid = 13959238
  14. ORA-1092 signalled during: ALTER DATABASE OPEN..
数据库启动时   执行    select ctime, mtime, stime from obj$ where obj# = :1 导致快照太旧;因而bootstrap进程失败,于是通过了oradebug 推进scn的方法来解决;
以下博客有相应实验过程:                              
                 
http://www.killdb.com/2014/06/19/数据库open报错ora-01555-snapshot-too-old.html

oradebug 过程:
  1. SQL> oradebug setmypid
  2. Statement processed.
  3. SQL>
  4. SQL> oradebug dumpvar sga kcsgscn_kcslff
  5. ORA-00079: variable kcsgscn_kcslf not found
  6. SQL> oradebug 0x700000010012650 4 0x146BFECD3
  7. ORA-00070: command 0x700000010012650 is not valid
  8. SQL> oradebug dumpvar sga kcsgscn_
  9. kcslf kcsgscn_ [700000010012650, 700000010012680) = 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 07000000 ...
  10. SQL> oradebug poke 0x700000010012650 4 0x146BFECD3
  11. BEFORE: [700000010012650, 700000010012654) = 00000000
  12. AFTER: [700000010012650, 700000010012654) = 46BFECD3
  13. SQL>
  14. SQL>
 oradebug addr length value   value是推进后的scn;
  这里简单解释一下,4 为长度,0x146BFECD3是16进制,我在原来的v$datafile_header.checkpoint_change#的基础之上
加上上1000000得到该值。                  

其实执行alter database open;
数据库报错,alert 日志如下:
ora-600       [2252], [60627],错误应该是由于推进了scn导致时间不对导致,此时可以重启数据库。
                                                                                
                                                           

  1. ARC1 started with pid=21, OS id=9437196
  2. Wed Aug 19 09:55:54 BEIST 2015
  3. Errors in file /opt/app/oracle/products/10205/rdbms/log/gessdb_lgwr_12583110.trc:
  4. ORA-00600: internal error code, arguments: [2252], [60627], [1], [], [], [], [], []
  5. Wed Aug 19 09:55:55 BEIST 2015
  6. Errors in file /opt/app/oracle/products/10205/rdbms/log/gessdb_lgwr_12583110.trc:
  7. ORA-00600: internal error code, arguments: [2252], [60627], [1], [], [], [], [], []
  8. Wed Aug 19 09:55:55 BEIST 2015
  9. LGWR: terminating instance due to error 470
  10. Instance terminated by LGWR, pid = 125831
于是我再重启数据库,alert 日志报了以下内容                  

  1. Wed Aug 19 09:59:18 BEIST 2015
  2. Errors in file /opt/app/oracle/products/10205/rdbms/log/gessdb_ora_12582916.trc:
  3. ORA-00704: bootstrap process failure
  4. ORA-39700: database must be opened with UPGRADE option
  5. Wed Aug 19 09:59:18 BEIST 2015
  6. Error 704 happened during db open, shutting down database
  7. USER: terminating instance due to error 704
  8. Instance terminated by USER, pid = 12582916
  9. ORA-1092 signalled during: alter database open...
此时报 ORA - 39700数据库需以upgrade 启动。于是已upgrade 做了升级。                              


  1. shutdown immediate
  2. startup upgrade

  3. @?/rdbms/admin/catupgrd.sql
  4. @?/rdbms/admin/catalog.sql
  5. @?/rdbms/admin/catproc.sql
  6. @?/rdbms/admin/utlrp.sql

shutdown immediate

SQL> startup
ORACLE instance started.
Total System Global Area 1224736768 bytes
Fixed Size                  2096032 bytes
Variable Size             335545440 bytes
Database Buffers          872415232 bytes
Redo Buffers               14680064 bytes
Database mounted.
Database opened.


将  _allow_resetlogs_corruption改为false。                 
alter system set "_allow_resetlogs_corruption"=false  scope=spfile;
shutdown immediate
SQL> startup

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

转载于:http://blog.itpub.net/29863023/viewspace-1776522/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值