分类目录归档:小工具

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使用说明

发表在 小工具 | 标签为 , | 评论关闭

Oracle Recovery Tools恢复案例总结—202505

开发出来Oracle Recovery Tools小工具已经一段时间,而且在大量的客户恢复case中使用,大大的提高的恢复效率,特别是win平台需要bbed或者类似工具的时候.现在对该工具在实战中的一些case进行总结:
Oracle Recovery Tools修复空闲坏块
Oracle Recovery Tools实战批量坏块修复
Oracle Recovery Tools快速恢复ORA-19909
Oracle Recovery Tools 解决ORA-600 3020故障
Oracle Recovery Tools恢复csc higher than block scn
Oracle Recovery Tools恢复MISSING00000文件故障
Oracle Recovery Tools快速恢复重建ctl遗漏数据文件故障
一键恢复ORA-01113 ORA-01110—Oracle Recovery Tools
Oracle Recovery Tools 解决ORA-01190 ORA-01248等故障
Oracle Recovery Tools快速解决sysaux文件不能online问题
Oracle Recovery Tools恢复—ORA-00704 ORA-01555故障
ORA-01113 ORA-01110错误不一定都要Oracle Recovery Tools解决
Oracle Recovery Tools解决ORA-00279 ORA-00289 ORA-00280故障
Oracle Recovery Tools修复ORA-600 6101/kdxlin:psno out of range故障
Oracle Recovery Tools工具一键解决ORA-00376 ORA-01110故障(文件offline)
Oracle Recovery Tools修复ORA-00742、ORA-600 ktbair2: illegal inheritance故障
Oracle Recovery Tools快速恢复断电引起的无法正常启动数据库(ORA-01555,MISSING000等问题)
软件下载:OraRecovery下载
使用说明:使用说明

发表在 小工具 | 标签为 | 评论关闭

Oracle Recovery Tools修复ORA-600 6101/kdxlin:psno out of range故障

数据库异常断电,然后启动异常,我接手该库,尝试recover恢复

SQL> recover database;
ORA-10562: Error occurred while applying redo to data block (file# 2, block#
63710)
ORA-10564: tablespace SYSAUX
ORA-01110: ???????? 2: 'H:\TEMP\GDLISNET\SYSAUX01.DBF'
ORA-10561: block type 'TRANSACTION MANAGED INDEX BLOCK', data object# 179030
ORA-00600: ????????????, ????: [6101], [0], [700], [32], [], [], [], [], [],
[], [], []

SQL> recover datafile 1;
完成介质恢复。
SQL> recover datafile 3;
完成介质恢复。
SQL> recover datafile 4;
完成介质恢复。
SQL> recover datafile 5;
完成介质恢复。
SQL> recover datafile 6;
完成介质恢复。
SQL> recover datafile 2;
ORA-00283: ??????????
ORA-10562: Error occurred while applying redo to data block (file# 2, block#
63744)
ORA-10564: tablespace SYSAUX
ORA-01110: ???? 2: 'H:\TEMP\GDLISNET\SYSAUX01.DBF'
ORA-10561: block type 'TRANSACTION MANAGED INDEX BLOCK', data object# 67482
ORA-00600: ??????, ??: [kdxlin:psno out of range], [], [], [], [], [], [], [],
[], [], [], []

alert日志信息

Mon Apr 14 12:31:55 2025
ALTER DATABASE RECOVER  database  
Media Recovery Start
 started logmerger process
Parallel Media Recovery started with 20 slaves
Mon Apr 14 12:31:56 2025
Recovery of Online Redo Log: Thread 1 Group 2 Seq 6845 Reading mem 0
  Mem# 0: H:\TEMP\GDLISNET\REDO02.LOG
Mon Apr 14 12:31:56 2025
Errors in file c:\app\xff\diag\rdbms\gdlisnet\gdlisnet\trace\gdlisnet_pr0e_9840.trc  (incident=1489):
ORA-00600: 内部错误代码, 参数: [6101], [0], [700], [32], [], [], [], [], [], [], [], []
Incident details in: c:\app\xff\diag\rdbms\gdlisnet\gdlisnet\incident\incdir_1489\gdlisnet_pr0e_9840_i1489.trc
Slave exiting with ORA-10562 exception
Errors in file c:\app\xff\diag\rdbms\gdlisnet\gdlisnet\trace\gdlisnet_pr0e_9840.trc:
ORA-10562: Error occurred while applying redo to data block (file# 2, block# 63710)
ORA-10564: tablespace SYSAUX
ORA-01110: 数据文件 2: 'H:\TEMP\GDLISNET\SYSAUX01.DBF'
ORA-10561: block type 'TRANSACTION MANAGED INDEX BLOCK', data object# 179030
ORA-00600: 内部错误代码, 参数: [6101], [0], [700], [32], [], [], [], [], [], [], [], []
Mon Apr 14 12:31:57 2025
Checker run found 6 new persistent data failures
Recovery Slave PR0E previously exited with exception 10562
Media Recovery failed with error 448
Errors in file c:\app\xff\diag\rdbms\gdlisnet\gdlisnet\trace\gdlisnet_pr00_14232.trc:
ORA-00283: 恢复会话因错误而取消
ORA-00448: 后台进程正常结束
Slave exiting with ORA-283 exception
Errors in file c:\app\xff\diag\rdbms\gdlisnet\gdlisnet\trace\gdlisnet_pr00_14232.trc:
ORA-00283: 恢复会话因错误而取消
ORA-00448: 后台进程正常结束
ORA-10562 signalled during: ALTER DATABASE RECOVER  database  ...

ALTER DATABASE RECOVER  datafile 2  
Media Recovery Start
Serial Media Recovery started
Recovery of Online Redo Log: Thread 1 Group 2 Seq 6845 Reading mem 0
  Mem# 0: H:\TEMP\GDLISNET\REDO02.LOG
Errors in file c:\app\xff\diag\rdbms\gdlisnet\gdlisnet\trace\gdlisnet_ora_22400.trc  (incident=1369):
ORA-00600: ??????, ??: [kdxlin:psno out of range], [], [], [], [], [], [], [], [], [], [], []
Incident details in: c:\app\xff\diag\rdbms\gdlisnet\gdlisnet\incident\incdir_1369\gdlisnet_ora_22400_i1369.trc
Media Recovery failed with error 10562
ORA-283 signalled during: ALTER DATABASE RECOVER  datafile 2  ...

发现2号数据文件异常,报ORA-600 6101和ORA-600 kdxlin:psno out of range错误,出现该错误的原因主要是由于数据文件的bock和redo中信息不匹配导致,对于这种情况,我这边选择使用Oracle Recovery Tools工具进行快速恢复
QQ20250414-123421
再次recover并且直接打开库

SQL> set numw 16
SQL> col CHECKPOINT_TIME for a40
SQL> set lines 150
SQL> set pages 1000
SQL> SELECT status,
  2  to_char(checkpoint_time,'yyyy-mm-dd hh24:mi:ss') checkpoint_time,FUZZY,checkpoint_change#,
  3  count(*) ROW_NUM
  4  FROM v$datafile_header
  5  GROUP BY status, checkpoint_change#, to_char(checkpoint_time,'yyyy-mm-dd hh24:mi:ss'),fuzzy
  6  ORDER BY status, checkpoint_change#, checkpoint_time;

STATUS  CHECKPOINT_TIME                          FUZ CHECKPOINT_CHANGE#          ROW_NUM
------- ---------------------------------------- --- ------------------ ----------------
ONLINE  2025-03-28 22:00:09                      NO           118575875                6

SQL>
SQL>
SQL> alter database open;
alter database open
*
第 1 行出现错误:
ORA-01113: 文件 2 需要介质恢复
ORA-01110: 数据文件 2: 'H:\TEMP\GDLISNET\SYSAUX01.DBF'


SQL> recover datafile 2;
完成介质恢复。
SQL> alter database open;

数据库已更改。

SQL>

逻辑方法导出该库,完成该库的恢复工作

发表在 Oracle备份恢复, 小工具 | 标签为 , , , , , | 评论关闭