Patch_SCN for Linux 功能完善

联系:手机/微信(+86 17813235971) QQ(107644445)QQ咨询惜分飞

标题:Patch_SCN for Linux 功能完善

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

Patch_SCN工具目前有For win和for linux版本,主要用于修改Oracle SCN(特别是在oracle数据库非常规恢复中实现一键修改SCN功能,实现快速open数据库.主要解决典型问题:
ORA-600 2662
ORA-600 2663
ORA-600 kclchkblk_4
ORA-600 kcbzib_kcrsds_1
最近有点空对Patch_SCN软件的for linux版本进行了完善,主要完善功能:
1. 整个代码全部通过C代码实现
2. 完善了注册机制
3. 提供直接获取内存地址,进程spid方法
4. 无需输入内存地址,程序一般情况下可以直接获取地址并修改
上传软件到linux环境并授权
确保执行用户有x权限

[root@iZbp11c0qyuuo1gr7j98upZ tmp]# ls -ltr /tmp/Patch_SCN 
-rw-r--r-- 1 root root 7895436 Oct 13  2025 /tmp/Patch_SCN
[root@iZbp11c0qyuuo1gr7j98upZ tmp]# chmod +x /tmp/Patch_SCN 
[root@iZbp11c0qyuuo1gr7j98upZ tmp]# ls -ltr /tmp/Patch_SCN 
-rwxr-xr-x 1 root root 7895436 Oct 13  2025 /tmp/Patch_SCN

软件使用说明

[root@iZbp11c0qyuuo1gr7j98upZ tmp]# ./Patch_SCN
Usage:
  Software License:       ./Patch_SCN -key
  Get Oracle SPID:        ./Patch_SCN -spid
  Get SCN address:        ./Patch_SCN -addr
  Automatic address mode: ./Patch_SCN <spid> <new_value>
  Manual address mode:    ./Patch_SCN <spid> <address> <new_value>
  Where:
    <spid> - Oracle process ID
    <address> - Memory address (hexadecimal)
    <new_value> - SCN value to modify (decimal or hexadecimal)

-key表示进行软件授权和注册
-spid表示在线直接获取spid(修改修改的进程号)
-addr自动获取需要修改的内存地址
Patch_SCN程序会根据情况自动发现合适的spid(如果有多个的情况下,建议采用人工地址模式:Patch_SCN spid address new_value)

软件自动获取进程spid

[oracle@iZbp11c0qyuuo1gr7j98upZ tmp]$ ./Patch_SCN -spid

Found 2 Oracle LOCAL=YES processes: 20626  23365  

Process Details:
UID        PID  PPID  C STIME TTY          TIME CMD
oracle   20626 20625  0 10:40 ?        00:00:00 oraclexifenfei (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle   23365 23364  0 11:26 ?        00:00:00 oraclexifenfei (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

程序会根据LOCAL=YES找出来需要的spid并展示出来供选择

软件自动获取内存地址

[oracle@iZbp11c0qyuuo1gr7j98upZ tmp]$ ./Patch_SCN -addr
Retrieving Oracle SCN address...
Successfully retrieved SCN address: 0x6001ae70

程序可以自动获取需要修改的内存地址,便于人工模式的情况下进行填写

软件授权
在没有授权的情况下,无法操作对scn的修改操作

[oracle@iZbp11c0qyuuo1gr7j98upZ tmp]$ ./Patch_SCN 20626 11123232
Successfully obtained address automatically: 0x6001ae70
This software is not registered.

========================================
           Software Registration        
========================================

Your Hardware ID: 6F610D20

Please send your Hardware ID to XiFenFei to register.
Website: https://www.xifenfei.com 
Tel/WX: +86-17813235971 

Enter Registration Code:

提示输入注册码,把硬件ID(6F610D20)发给我之后,申请注册码

Enter Registration Code: xxxxxxxx-xxxxxxx
Registration successful!
Original Oracle SCN at Address 0x6001ae70: 0x75b6d82
Are you sure you want to modify Oracle SCN? (yes/no): yes
New SCN at Address 0x6001ae70: 0xa9ba20
Oracle SCN successfully modified.

即可完成SCN修改操作,也可以单独授权(使用-key参数),授权成功之后直接使用软件修改SCN

[oracle@iZbp11c0qyuuo1gr7j98upZ tmp]$ ./Patch_SCN -key

========================================
           Software Registration        
========================================

Your Hardware ID: 6F610D20

Please send your Hardware ID to XiFenFei to register.
Website: https://www.xifenfei.com 
Tel/WX: +86-17813235971 

Enter Registration Code: xxxxxxxx-xxxxxxx
Registration successful!
[oracle@iZbp11c0qyuuo1gr7j98upZ tmp]$ ./Patch_SCN 20626 11123232
Successfully obtained address automatically: 0x6001ae70
Original Oracle SCN at Address 0x6001ae70: 0xa9ba20
Are you sure you want to modify Oracle SCN? (yes/no): yes
New SCN at Address 0x6001ae70: 0xa9ba20
Oracle SCN successfully modified.

演示修改scn操作

SQL> startup mount
ORACLE instance started.

Total System Global Area  551165952 bytes
Fixed Size                  2255112 bytes
Variable Size             369100536 bytes
Database Buffers          171966464 bytes
Redo Buffers                7843840 bytes
Database mounted.

SQL> select current_scn from v$database;

CURRENT_SCN
-----------
          0

SQL> alter database open;

Database altered.

---当前数据库实际scn
SQL>  select current_scn from v$database;

CURRENT_SCN
-----------
     964084

---修改scn操作
[oracle@iZbp11c0qyuuo1gr7j98upZ tmp]$ ./Patch_SCN -spid

Found 2 Oracle LOCAL=YES processes: 24277  30752  

Process Details:
UID        PID  PPID  C STIME TTY          TIME CMD
oracle   24277 24275  0 11:40 ?        00:00:00 oraclexifenfei (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle   30752 30751  0 13:33 ?        00:00:00 oraclexifenfei (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
[oracle@iZbp11c0qyuuo1gr7j98upZ tmp]$ ./Patch_SCN 
Usage:
  Software License:       ./Patch_SCN -key
  Get Oracle SPID:        ./Patch_SCN -spid
  Get SCN address:        ./Patch_SCN -addr
  Automatic address mode: ./Patch_SCN <spid> <new_value>
  Manual address mode:    ./Patch_SCN <spid> <address> <new_value>
  Where:
    <spid> - Oracle process ID
    <address> - Memory address (hexadecimal)
    <new_value> - SCN value to modify (decimal or hexadecimal)
[oracle@iZbp11c0qyuuo1gr7j98upZ tmp]$ ./Patch_SCN 30752 1000000
Successfully obtained address automatically: 0x6001ae70
Original Oracle SCN at Address 0x6001ae70: 0xeb667
Are you sure you want to modify Oracle SCN? (yes/no): yes
New SCN at Address 0x6001ae70: 0xf4240
Oracle SCN successfully modified.

--修改scn之后
SQL>  select current_scn from v$database;

CURRENT_SCN
-----------
    1000003   -->由于scn会自动增加,所以比修改值稍大一点 

Patch_SCN下载:Patch_SCN下载
Patch_SCN使用说明:Patch_SCN使用说明

此条目发表在 小工具 分类目录,贴了 , 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
Anti-spam image