合 使用华为云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 |