如何手动修改Oracle sga scn?

手动修改Oracle sga方法有很多种,这里只介绍其中一种,就是用oracle debug工具
SQL> alter database open read only;

Database altered.

SQL> col scn for 9999999999999999
SQL> select dbms_flashback.get_system_change_number scn from dual;

              SCN
-----------------
   10999733447365

SQL> oradebug setmypid
Statement processed.
SQL>  oradebug DUMPvar SGA kcsgscn_
kcslf kcsgscn_ [060012658, 060012688) = 13346AC5 00000A01 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 60012338 00000000

修改内存地址从0x060012658之后的4个字节,内容为0xffffffff
SQL> oradebug poke 0x060012658 4 0xffffffff
BEFORE: [060012658, 06001265C) = 13346AC5
AFTER:  [060012658, 06001265C) = FFFFFFFF

SQL> oradebug DUMPvar SGA kcsgscn_
kcslf kcsgscn_ [060012658, 060012688) = FFFFFFFF 00000A01 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 60012338 00000000

可以看到已经修改成功
SQL> select dbms_flashback.get_system_change_number scn from dual;

              SCN
-----------------
   11003706212351
  
SQL> select current_scn scn from v$database;

              SCN
-----------------
                0

你可能感兴趣的:(oracle)