备份与恢复

打开数据库报ora-00742,ora-00312,解决方式小计

时间:2015/4/29 21:45:48  作者:solgle  来源:www.solgle.com  查看:9866  评论:0
内容摘要:最近因Linux磁盘满了,需要迁移数据库数据文件到其他磁盘,因该服务器数据库有几个,忘了关闭其中一个而move文件,造成数据库崩溃,现在实施恢复,正常后,再迁移SQL> select name,open_mode from v$database;NAME 伀倀EN_MO...
最近因Linux磁盘满了,需要迁移数据库数据文件到其他磁盘,因该服务器数据库有几个,忘了关闭其中一个而move文件,造成数据库崩溃,现在实施恢复,正常后,再迁移
 
SQL> select name,open_mode from v$database;
 
NAME      OPEN_MODE
--------- --------------------
SOLGLE_LO  MOUNTED

---手动将控制文件移动回原目录,可是数据库不能打开
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-00742: Log read detects lost write in thread %d sequence %d block %d
ORA-00312: online log 2 thread 1: '/u01/data/sys/solgle_db/redo02.log'
 
--尝试恢复,可惜失败了
SQL> recover database until cancel;
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/u01/data/sys/solgle_db/system01.dbf'
 
 
SQL> alter database open ;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
 
--这样打开也失败
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/u01/data/sys/solgle_db/system01.dbf'
 
---查看scn状态
SQL> select checkpoint_change# from v$datafile;
 
CHECKPOINT_CHANGE#
------------------
           1083796
           1083796
           1083796
           1083796
           1083796
           1083796
           1083796
           1083796
 
8 rows selected.
 
SQL> select checkpoint_change# from v$database;
 
CHECKPOINT_CHANGE#
------------------
           1043552
 
SQL> select checkpoint_change# from v$datafile_heeder;
select checkpoint_change# from v$datafile_heeder
                               *
ERROR at line 1:
ORA-01219: database not open: queries allowed on fixed tables/views only
 
 
SQL> select checkpoint_change# from v$datafile_header;
 
CHECKPOINT_CHANGE#
------------------
           1083796
           1083796
           1083796
           1083796
           1083796
           1083796
           1083796
           1083796
 
8 rows selected.
 
---以上可以查出控制文件没有跟上scn(需要说明的是当前并没有做过数据库备份)
SQL> recover database using backup controlfile until cancel
ORA-00279: change 1083796 generated at 04/29/2015 09:25:21 needed for thread 1
ORA-00289: suggestion :
/u01/app/fast_recovery_area/solgle_db/archivelog/2015_04_29/o1_mf_1_11_%u_.arc
ORA-00280: change 1083796 for thread 1 is in sequence #11
 
 
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
SQL> alter database open resetlogs;
 
Database altered.
 
SQL>
----数据库恢复成功
 
 
标签:打开数据库报ora-00742 ora-00312 数据恢复小计 

solgle.com 版权所有,欢迎分享!!!

上一篇:没有了
下一篇:逻辑DataGuard重新部署逻辑备用数据库
相关评论
 img1 img2 img3 img4 img5 img6 img7 img8 img9 img10
评论者:      验证码:  点击获取验证码
   Copyright © 2013-2028 solgle.com,All rights reserved.[solgle.com] 公安机关备案号:51010802000219
Email:solgle@solgle.com; weixin:cd1008610000 ICP:蜀ICP备14011070号-1