查看当前SCN
SQL> ALTER SYSTEM CHECKPOINT ;
System altered.
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
20101799
SQL> select to_char(20101799,'xxxxxxxxx')from dual;
TO_CHAR(20
----------
132baa5
copy 控制文件
[oracle@devin-enmo controlfile]$ sz control01.ctl
rz
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring control01.ctl...
100% 10768 KB 10768 KB/sec 00:00:01 0 Errors
当前SCN约2000W,将132baa5改成232baa5,换算出来大概是3700W
SQL> SELECT TO_NUMBER('232BAA7','XXXXXXXXXXXXXXXX') FROM DUAL;
TO_NUMBER('232BAA7','XXXXXXXXXXXXXXXX')
---------------------------------------
36879015
用UE修改控制文件
通过132baa5定位当前scn所在的块为00048000H,偏移量为60的行的第9个字节开始到12个字节之间;flag为该块第一行偏移量为15的0x04;checksum为该块第二行的offset 16,17的0x5a9d
将01改成02,并将checksum以及flag清0
重新上传控制文件
[oracle@devin-enmo controlfile]$ rz
rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring control01.ctl...
100% 10768 KB 10768 KB/sec 00:00:01 0 Errors
[oracle@devin-enmo controlfile]$ cp control01.ctl ../datafile/control02.ctl
启动数据库,验证
[oracle@devin-enmo controlfile]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Mon Feb 1 15:50:50 2021
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> startup nomount
ORACLE instance started.
Total System Global Area 268435456 bytes
Fixed Size 8619496 bytes
Variable Size 201329176 bytes
Database Buffers 50331648 bytes
Redo Buffers 8155136 bytes
SQL> alter database mount ;
Database altered.
SQL> select checkpoint_change# from v$database;
CHECKPOINT_CHANGE#
------------------
36879013
SQL> alter database open;
Database altered.
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
36979499
确认修改成功。