合 使用华为云SMS迁移Oracle数据库后启动报错解决过程
场景
主机迁移服务是一种P2V/V2V迁移服务,可以帮您把X86物理服务器或者私有云、公有云平台上的虚拟机迁移到华为云弹性云服务器上,从而帮助您轻松地把服务器上的应用和数据迁移到华为云。
使用华为云的SMS工具可以将OS整机迁移上云,参考:https://support.huaweicloud.com/productdesc-sms/sms_01_0002.html
不过使用该工具迁移数据库有一些限制条件,可以参考:华为云使用SMS工具的限制条件
尤其对于Oracle数据库,在最后一次增量迁移前,源端Oracle必须停机,若源端不停机,则目标端是不能正常启动数据库的,必须通过数据库的一些恢复手段来恢复Oracle数据库。
这篇文章主要介绍,在该场景下常见的一些错误处理过程。
控制文件版本不一致:ORA-00214: control file xxx version 1461112 inconsistent with file xxx version 1461071
现象
1 2 3 4 5 6 7 8 9 10 11 12 | SQL> startup ORACLE instance started. Total System Global Area 3290345472 bytes Fixed Size 2257720 bytes Variable Size 1996491976 bytes Database Buffers 1275068416 bytes Redo Buffers 16527360 bytes ORA-00214: control file '/opt/oracle/oradata/orcl/control01.ctl' version 1461112 inconsistent with file '/opt/oracle/fast_recovery_area/orcl/control02.ctl' version 1461071 |
解决
这个问题处理比较简单,我们直接将version后数字比较大的文件覆盖数字比较小的文件,然后重启数据库,该问题即可解决。
但是,很大程度会报其它的错误,例如:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options [oracle@localhost ~]$ cp /opt/oracle/oradata/orcl/control01.ctl /opt/oracle/oradata/orcl/control01.ctl_bk [oracle@localhost ~]$ cp /opt/oracle/fast_recovery_area/orcl/control02.ctl /opt/oracle/oradata/orcl/control01.ctl [oracle@localhost ~]$ [oracle@localhost ~]$ [oracle@localhost ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Tue Jul 26 14:20:20 2022 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> startup force ORACLE instance started. Total System Global Area 3290345472 bytes Fixed Size 2257720 bytes Variable Size 1996491976 bytes Database Buffers 1275068416 bytes Redo Buffers 16527360 bytes Database mounted. ORA-01122: database file 2 failed verification check ORA-01110: data file 2: '/opt/oracle/oradata/orcl/sysaux01.dbf' ORA-01207: file is more recent than control file - old control file |
解决数据文件内容不一致问题
报错类似如下的需要恢复文件的问题,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ORA-01122: database file 2 failed verification check ORA-01110: data file 2: '/opt/oracle/oradata/orcl/sysaux01.dbf' ORA-01207: file is more recent than control file - old control file SQL> alter database open; alter database open * ERROR at line 1: ORA-01122: database file 1 failed verification check ORA-01110: data file 1: '/data/oracle/oradata/orcl/system01.dbf' ORA-01207: file is more recent than control file - old control file 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: '/data/oracle/oradata/orcl/system01.dbf' SQL> alter database open; alter database open * ERROR at line 1: ORA-01113: file 1 needs media recovery ORA-01110: data file 1: '/u01/oracle/oradata/ecology/system01.dbf' |
一般处理流程:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | select * from v$logfile; select * from v$log; recover database using backup controlfile until cancel; SQL> recover database using backup controlfile until cancel; ORA-00279: change 2411502252 generated at 07/08/2022 18:26:33 needed for thread 1 ORA-00289: suggestion : /opt/oracle/fast_recovery_area/ORCL/archivelog/2022_07_26/o1_mf_1_39897_%u_.arc ORA-00280: change 2411502252 for thread 1 is in sequence #39897 -- 此时需要根据sequence号然后去v$log里查询到具体的redo日志的文件名称,依次输入具体文件名,直到出现“Media recovery complete.” -- 启动数据库 alter database open RESETLOGS; |
示例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | SQL> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME ---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ --------- 1 1 39898 52428800 512 1 NO INACTIVE 2411590445 08-JUL-22 2411884082 08-JUL-22 3 1 39897 52428800 512 1 NO INACTIVE 2411502252 08-JUL-22 2411590445 08-JUL-22 2 1 39899 52428800 512 1 NO CURRENT 2411884082 08-JUL-22 2.8147E+14 SQL> recover database using backup controlfile until cancel; ORA-00279: change 2411502252 generated at 07/08/2022 18:26:33 needed for thread 1 ORA-00289: suggestion : /opt/oracle/fast_recovery_area/ORCL/archivelog/2022_07_26/o1_mf_1_39897_%u_.arc ORA-00280: change 2411502252 for thread 1 is in sequence #39897 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} /opt/oracle/oradata/orcl/redo03.log ORA-00279: change 2411590445 generated at 07/08/2022 18:59:05 needed for thread 1 ORA-00289: suggestion : /opt/oracle/fast_recovery_area/ORCL/archivelog/2022_07_26/o1_mf_1_39898_%u_.arc ORA-00280: change 2411590445 for thread 1 is in sequence #39898 ORA-00278: log file '/opt/oracle/oradata/orcl/redo03.log' no longer needed for this recovery Specify log: {<RET>=suggested | filename | AUTO | CANCEL} /opt/oracle/oradata/orcl/redo01.log ORA-00279: change 2411884082 generated at 07/08/2022 19:08:14 needed for thread 1 ORA-00289: suggestion : /opt/oracle/fast_recovery_area/ORCL/archivelog/2022_07_26/o1_mf_1_39899_%u_.arc ORA-00280: change 2411884082 for thread 1 is in sequence #39899 ORA-00278: log file '/opt/oracle/oradata/orcl/redo01.log' no longer needed for this recovery Specify log: {<RET>=suggested | filename | AUTO | CANCEL} /opt/oracle/oradata/orcl/redo02.log Log applied. Media recovery complete. SQL> alter database open RESETLOGS; alter database open RESETLOGS * ERROR at line 1: ORA-03113: end-of-file on communication channel Process ID: 20210 Session ID: 1144 Serial number: 5 SQL> startup force ORA-24324: service handle not initialized ORA-01041: internal error. hostdef extension doesn't exist SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options |
若出现其它问题,再解决。
undo问题:600 4194
报错:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | -- 该错误需要去查告警日志 ORA-03113: end-of-file on communication channel Process ID: 20872 Session ID: 1144 Serial number: 5 -- 告警日志 Errors in file /opt/oracle/diag/rdbms/orcl/orcl/trace/orcl_smon_20838.trc (incident=78509): ORA-00600: internal error code, arguments: [4194], [], [], [], [], [], [], [], [], [], [], [] Incident details in: /opt/oracle/diag/rdbms/orcl/orcl/incident/incdir_78509/orcl_smon_20838_i78509.trc Block recovery completed at rba 1.388.16, scn 1.646866619 Errors in file /u01/oracle/diag/rdbms/ecology/ecology/trace/ecology_q001_4634.trc: ORA-00600: internal error code, arguments: [4193], [], [], [], [], [], [], [], [], [], [], [] ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1], [3813], [25751], [26789], [], [], [], [], [], [], [] Incident details in: /opt/oracle/diag/rdbms/orcl/orcl/incident/incdir_72156/orcl_ora_10235_i72156.trc Aborting crash recovery due to error 600 Errors in file /opt/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_10235.trc: ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1], [3813], [25751], [26789], [], [], [], [], [], [], [] Errors in file /opt/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_10235.trc: ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1], [3813], [25751], [26789], [], [], [], [], [], [], [] ORA-600 signalled during: alter database open... Errors in file /u01/oracle/diag/rdbms/ecology/ecology/trace/ecology_ora_27801.trc (incident=282108): ORA-00603: ORACLE server session terminated by fatal error ORA-00600: internal error code, arguments: [4194], [ody "SYS.DBMS_STANDARD" Incident details in: /u01/oracle/diag/rdbms/ecology/ecology/incident/incdir_282108/ecology_ora_27801_i282108.trc Use ADRCI or Support Workbench to package the incident. See Note 411.1 at My Oracle Support for error and packaging details. Errors in file /u01/oracle/diag/rdbms/ecology/ecology/trace/ecology_mmon_27775.trc (incident=282077): ORA-00600: internal error code, arguments: [4412], [0x55EE9EBD0], [0x000000000], [1], [6283], [], [], [], [], [], [], [] Incident details in: /u01/oracle/diag/rdbms/ecology/ecology/incident/incdir_282077/ecology_mmon_27775_i282077.trc Starting background process SMCO Sat Oct 08 01:48:33 2022 SMCO started with pid=53, OS id=27949 Dumping diagnostic data in directory=[cdmp_20221008014833], requested by (instance=1, osid=27775 (MMON)), summary=[incident=282075]. opiodr aborting process unknown ospid (27801) as a result of ORA-603 Sat Oct 08 01:48:33 2022 Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x6DA7C7CA] [PC:0x90CC67A, kgebse()+776] [flags: 0x0, count: 1] 0x0, count: 1] Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x6DA7C7CA] [PC:0x90CC67A, kgebse()+776] [flags: 0x2, count: 2] Use ADRCI or Support Workbench to package the incident. See Note 411.1 at My Oracle Support for error and packaging details. Errors in file /u01/oracle/diag/rdbms/ecology/ecology/trace/ecology_mmon_27775.trc (incident=282078): ORA-00600: internal error code, arguments: [4406], [0x55EE9EBD0], [0x000000000], [2], [6289], [], [], [], [], [], [], [] ORA-00600: internal error code, arguments: [4412], [0x55EE9EBD0], [0x000000000], [1], [6283], [], [], [], [], [], [], [] Incident details in: /u01/oracle/diag/rdbms/ecology/ecology/incident/incdir_282078/ecology_mmon_27775_i282078.trc Use ADRCI or Support Workbench to package the incident. See Note 411.1 at My Oracle Support for error and packaging details. Errors in file /u01/oracle/diag/rdbms/ecology/ecology/trace/ecology_mmon_27775.trc (incident=282079): ORA-00603: ORACLE server session terminated by fatal error ORA-24557: error 600 encountered while handling error 600; exiting server process ORA-00600: internal error code, arguments: [4406], [0x55EE9EBD0], [0x000000000], [2], [6289], [], [], [], [], [], [], [] ORA-00600: internal error code, arguments: [4412], [0x55EE9EBD0], [0x000000000], [1], [6283], [], [], [], [], [], [], [] Incident details in: /u01/oracle/diag/rdbms/ecology/ecology/incident/incdir_282079/ecology_mmon_27775_i282079.trc Dumping diagnostic data in directory=[cdmp_20221008014834], requested by (instance=1, osid=27801), summary=[incident=282108]. opidrv aborting process MMON ospid (27775) as a result of ORA-603 Dumping diagnostic data in directory=[cdmp_20221008014835], requested by (instance=1, osid=27775 (MMON)), summary=[incident=282079]. |