这篇文章主要介绍“怎么解决Oracle报错ORA-01194、ORA-01110问题”,在日常操作中,相信很多人在怎么解决Oracle报错ORA-01194、ORA-01110问题问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”怎么解决Oracle报错ORA-01194、ORA-01110问题”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

使用_allow_resetlogs_corruption打开无归档日志rman备份库,运维DBA反映服务器宕机后,开启数据库报错ORA-01194 ORA-01110,分析原因为Oracle SCN不一致导致数据库无法启动,使用_allow_resetlogs_corruption打开数据库

1.rman还原恢复操作

--还原数据库RMAN>restoredatabase;--恢复数据库RMAN>recoverdatabase;Startingrecoverat2012-03-0821:20:45usingtargetdatabasecontrolfileinsteadofrecoverycatalogallocatedchannel:ORA_DISK_1channelORA_DISK_1:SID=65devicetype=DISKstartingmediarecoveryRMAN-00571:===========================================================RMAN-00569:===============ERRORMESSAGESTACKFOLLOWS===============RMAN-00571:===========================================================RMAN-03002:failureofrecovercommandat03/08/201221:20:47RMAN-06053:unabletoperformmediarecoverybecauseofmissinglogRMAN-06025:nobackupofarchivedlogforthread1withsequence2936andstartingSCNof25991695foundtorestoreRMAN-06025:nobackupofarchivedlogforthread1withsequence2935andstartingSCNof25991652foundtorestoreRMAN-06025:nobackupofarchivedlogforthread1withsequence2934andstartingSCNof25991649foundtorestore……………………RMAN-06025:nobackupofarchivedlogforthread1withsequence2902andstartingSCNof25991156foundtorestore这里报日志缺少,实际上是备份的数据库文件后,没有备份归档日志,归档日志全部丢失

进行不完全恢复

SQL> recover database until cancel; ORA-00279: change 25991194 generated at 03/08/2012 20:33:58 needed for thread 1 ORA-00289: suggestion : /opt/oracle/oradata/archivelog/chf/1_2902_752334071.dbf ORA-00280: change 25991194 for thread 1 is in sequence #2902 Specify log: {

=suggested | filename | AUTO | CANCEL} cancel ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below ORA-01194: file 1 needs more recovery to be consistent ORA-01110: data file 1: '/opt/oracle/oradata/chf/system01.dbf' ORA-01112: media recovery not started SQL> alter database open resetlogs; alter database open resetlogs * ERROR at line 1:ORA-01194: file 1 needs more recovery to be consistent ORA-01110: data file 1: '/opt/oracle/oradata/chf/system01.dbf'

2.查看相关SCN

SQL>selectfile#,to_char(checkpoint_change#,'999999999999')fromv$datafile;FILE#TO_CHAR(CHECK-----------------------12599221422599221432599221442599221452599221462599221472599221482599221492599221410259922141125992214FILE#TO_CHAR(CHECK-----------------------1325992214142599221413rowsselected.SQL>selectfile#,online_status,to_char(change#,'999999999999')fromv$recover_file;FILE#ONLINE_TO_CHAR(CHANG------------------------------1ONLINE259911942ONLINE259911943ONLINE259911944ONLINE259911945ONLINE259911946ONLINE259911947ONLINE259911948ONLINE259911949ONLINE2599119410ONLINE2599119411ONLINE25991194FILE#ONLINE_TO_CHAR(CHANG------------------------------13ONLINE2599119414ONLINE2599119413rowsselected.SQL>selectfile#,to_char(checkpoint_change#,'999999999999')fromv$datafile_header;FILE#TO_CHAR(CHECK-----------------------12599119422599119432599119442599119452599119462599119472599119482599119492599119410259911941125991194FILE#TO_CHAR(CHECK-----------------------1325991194142599119413rowsselected.--发现数据文件scn和控制文件不一致,重建控制文件,然后查询相关scnSQL>selectfile#,to_char(checkpoint_change#,'999999999999')fromv$datafile;FILE#TO_CHAR(CHECK-----------------------12599119422599119432599119442599119452599119462599119472599119482599119492599119410259911941125991194FILE#TO_CHAR(CHECK-----------------------1325991194142599119413rowsselected.SQL>selectfile#,online_status,to_char(change#,'999999999999')fromv$recover_file;FILE#ONLINE_TO_CHAR(CHANG------------------------------1ONLINE259911942ONLINE259911943ONLINE259911944ONLINE259911945ONLINE259911946ONLINE259911947ONLINE259911948ONLINE259911949ONLINE2599119410ONLINE2599119411ONLINE25991194FILE#ONLINE_TO_CHAR(CHANG------------------------------13ONLINE2599119414ONLINE2599119413rowsselected.SQL>selectfile#,to_char(checkpoint_change#,'999999999999')fromv$datafile_header;FILE#TO_CHAR(CHECK-----------------------12599119422599119432599119442599119452599119462599119472599119482599119492599119410259911941125991194FILE#TO_CHAR(CHECK-----------------------1325991194142599119413rowsselected.--此时所有scn均一致3.尝试打开数据库

SQL> alter database open resetlogs; alter database open resetlogs * ERROR at line 1: ORA-01194: file 1 needs more recovery to be consistent ORA-01110: data file 1: '/opt/oracle/oradata/chf/system01.dbf' SQL> recover database using backup controlfile until cancel; ORA-00279: change 25991194 generated at 03/08/2012 20:33:58 needed for thread 1 ORA-00289: suggestion : /opt/oracle/oradata/archivelog/chf/1_2902_752334071.dbf ORA-00280: change 25991194 for thread 1 is in sequence #2902 Specify log: {

=suggested | filename | AUTO | CANCEL} cancel ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below ORA-01194: file 1 needs more recovery to be consistent ORA-01110: data file 1: '/opt/oracle/oradata/chf/system01.dbf' ORA-01112: media recovery not started SQL> alter database open resetlogs; alter database open resetlogs * ERROR at line 1:ORA-01194: file 1 needs more recovery to be consistent ORA-01110: data file 1: '/opt/oracle/oradata/chf/system01.dbf'

5.使用隐含参数打开数据库

SQL>createpfile='/tmp/pfile'fromspfile;Filecreated.-------/tmp/pfile中加上----------_allow_resetlogs_corruption=TRUE---------------------------------SQL>startupmountpfile='/tmp/pfile'forceORACLEinstancestarted.TotalSystemGlobalArea622149632bytesFixedSize2230912bytesVariableSize419431808bytesDatabaseBuffers192937984bytesRedoBuffers7548928bytesDatabasemounted.SQL>alterdatabaseopenresetlogs;Databasealtered.SQL>selectopen_modefromv$database;OPEN_MODE--------------------READWRITE

到此,关于“怎么解决Oracle报错ORA-01194、ORA-01110问题”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!