• notice
  • Congratulations on the launch of the Sought Tech site

Oracle advances SCN series: use oradebug to advance SCN in mount state

Environment: RHEL 6.5(x86-64) + Oracle
Statement: The promotion of SCN belongs to the category of unconventional recovery, and it is not recommended to operate by non-professionals, otherwise you will be responsible for the consequences.
Demand: I will demonstrate the promotion of the SCN 10W order here.The actual demand promotion can be confirmed according to the specific value of ORA-600 [2662] [a] [b] [c] [d] [e].

Arg [a] Current SCN WRAP
Arg [b] Current SCN BASE
Arg [c] dependent SCN WRAP
Arg [d] dependent SCN BASE
Arg [e] Where present this is the DBA where the dependent SCN came from.

For more details, please refer to: ORA-600 [2662] "Block SCN is ahead of Current SCN" (Document ID 28929.1)

  • 1.View the Current SCN of the current database

  • 2.Restart the database to the mount stage

  • 3.Use oradebug poke to advance SCN

  • 4.Supplement the actual calculation method to promote SCN

1.View the Current SCN of the current database

SYS@orcl> select current_scn||'' from v$database;


You can see that the current SCN is 4563483988, I now want to advance the SCN, at the 10w level, that is, 4563 4 83988 marked in red and changed to the specified value.

2.Restart the database to the mount stage

Restart the database to the mount stage:

SYS@orcl> shutdown abort
ORACLE instance shut down.
SYS@orcl> startup mount
ORACLE instance started.

Total System Global Area 1235959808 bytes
Fixed Size                  2252784 bytes
Variable Size             788529168 bytes
Database Buffers          436207616 bytes
Redo Buffers                8970240 bytes
Database mounted.

3.Use oradebug poke to advance SCN

Here I directly changed the "4" of the 100,000 digits to "9", which is equivalent to an advancement of about 50w:
Note: The experiment found that the SCN value promoted by oradebug poke can either be specified in hexadecimal 0x11008DE74 or directly.4563983988 in decimal.

SYS@orcl> oradebug setmypid
Statement processed.
SYS@orcl> oradebug dumpvar sga kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000
SYS@orcl> select to_char(checkpoint_change#, 'XXXXXXXXXXXXXXXX') from v$database;


SYS@orcl> oradebug poke 0x06001AE70 8 4563983988
BEFORE: [06001AE70, 06001AE78) = 00000000 00000000
AFTER:  [06001AE70, 06001AE78) = 1008DE74 00000001

SYS@orcl> oradebug dumpvar sga kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 1008DE74 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000

SYS@orcl> alter database open;

Database altered.

SYS@orcl> select current_scn||'' from v$database;


It can be seen that the SCN has been successfully promoted to 4563 9 83988, and the SCN continues to grow, so the value found here is slightly larger.

4.Supplement the actual calculation method to promote SCN

This article will further explain on 2018-12-16:
In actual work of this type, we should actually calculate the value of the SCN that needs to be promoted, and should not directly give a large value to save trouble. The latter is not only a manifestation of immature technical level, but also irresponsible behavior.

--ORA-00600: internal error code, arguments: [2662], [2], [1424107441], [2], [1424142235], [8388617], [], []
select 2*power(2,32)+1424142235 from dual;

--ORA-00600: internal error code, arguments: [2662], [2], [1424142249], [2], [1424142302], [8388649], [], []
select 2*power(2,32)+1424143000 from dual;

Summarizing formula: c * power(2,32) + d {+ can be added a little, but not too big! }
c stands for: Arg [c] dependent SCN WRAP
d stands for: Arg [d] dependent SCN BASE

oradebug setmypid
oradebug dumpvar sga kcsgscn_
oradebug poke 0x060012658 8 10014077592
oradebug dumpvar sga kcsgscn_
alter database open;

The last thing to say is that you should think more about doing things, and you can gently promote SCN in unconventional recovery.The value of advanced DBA is reflected in the details.


Technical otaku

Sought technology together

Related Topic


Leave a Reply