Home Database Mysql Tutorial Oracle ORA-00600 6002错误的解决方法

Oracle ORA-00600 6002错误的解决方法

Jun 07, 2016 pm 05:46 PM
oracle

这种错误经常是在数据库恢复之后,经常会遇到如下ORA-600 6002错误,这属于常见的,可以分析消除的错误之一,下面我们来看解决办法。

这种错误经常是在数据库恢复之后,经常会遇到如下ORA-600 6002错误,这属于常见的,可以分析消除的错误之一,下面我们来看解决办法。

以下是最近在用户数据恢复中遇到的错误:

*** 2012-03-08 13:56:04.178
ksedmp: internal or fatal error
ORA-00600: internal error code, arguments: [6002], [0], [0], [4], [0], [], [], []
----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
57cce5a18       418  package body SYS.DBMS_HA_ALERTS_PRVT
57cce5a18       552  package body SYS.DBMS_HA_ALERTS_PRVT


错误现实,在执行SYS.DBMS_HA_ALERTS_PRVT包的内部任务时出现问题。
而 ORA-00600 6002 错误和索引相关,具体内容是指:
当Oracle试图去插入一个索引键值时,首先需要找到合适的位置,并且去进行相关校验,校验内容包括索引列数量、数据大小等,一旦发现不一致,则将出现ORA-600 的 6002错误。

MOS上的解释如下:

Oracle was trying to insert a key and key data into a b*tree index.  
In order to do this, it had to first find the correct leaf block to   do the insert.   
Once the correct leaf block is retrieved, Oracle validates the block  by checking the data size and number of columns in the key.   
If there is a mismatch then ORA-600 [6002] is reported. 

其主要的参数含义如下:

Arg [a] Number of bytes in keydata   
Arg [b] Number of bytes in the index layer of the leaf header  
Arg [c] Number of columns in index search key structure  
Arg [d] Number of columns in the index layer fo the leaf header

所以如果遇到这个错误,首先应该找到出现问题的索引对象,可以尝试通过重建索引消除这个错误影响。
如下是跟踪文件中体现的出现错误的块头信息:

Block header dump:  0x00c086ed
 Object id on Block? Y
 seg/obj: 0x22a9  csc: 0x00.1c87691f  itc: 12  flg: E  typ: 2 - INDEX
     brn: 0  bdba: 0xc086e9 ver: 0x01 opc: 0
     inc: 0  exflg: 0
 
 Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0x000a.016.00045449  0x0080027f.4951.02  C---    0  scn 0x0000.0b0c478c
0x02   0x0014.00e.000aadce  0x01000b9f.67ea.26  C---    0  scn 0x0000.1c876660
0x03   0x0014.01b.000aada1  0x01000b9f.67ea.17  C---    0  scn 0x0000.1c87653d
0x04   0x000a.002.000e628d  0x00800247.6ebe.29  C---    0  scn 0x0000.1c87691e
0x05   0x0034.00e.00000270  0x010061c8.00c6.11  ----    1  fsc 0x0000.00000000
0x06   0x0009.01d.0001e6dc  0x0080008a.8128.37  --U-    1  fsc 0x0031.1c876923
0x07   0x0008.017.0001d3c2  0x00800080.8857.26  C---    0  scn 0x0000.1c87613a
0x08   0x0002.02b.0001720e  0x00801355.7ebb.1f  C---    0  scn 0x0000.1c87654d
0x09   0x000a.01f.000e6254  0x00800245.6ebe.0e  C---    0  scn 0x0000.1c87683c
0x0a   0x0009.004.0001e89d  0x0080008a.8128.30  C---    0  scn 0x0000.1c876841
0x0b   0x000a.00a.000e6279  0x0080023f.6ebe.08  C---    0  scn 0x0000.1c87666a
0x0c   0x000a.011.000e6252  0x0080022f.6ebe.3e  C---    0  scn 0x0000.1c87613e

我们可以看到出现问题的对象号是22a9,类型正是索引。
通过数据库查询可以找到这个对象名称,通过重建索引即可解决:

 代码如下 复制代码

SQL> select object_name from dba_objects where object_id=to_number('22a9','xxxxx');

OBJECT_NAME
------------------------------------------------------------------------------------------------------------------------
WRI$_ALERT_THRESHOLD_LOG_PK

SQL> alter index WRI$_ALERT_THRESHOLD_LOG_PK rebuild online;

Index altered.

6002错误需要根据对象的不同进行分析,通常是可以通过索引重建解决的。有时候问题会出现在IOT对象上,可以通过备份数据,TRUNCATE再INSERT回插记录解决。

另一篇文章

ORA-600的3020错误,数据库在故障恢复中,应用归档日志时遇到3020错误:

ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement:
            alter database recover logfile '/arch/prod1_2711_681480148.arc'
ORA-00283: recovery session canceled due to errors
ORA-12801: error signaled in parallel query server P011, instance hpdb1:PROD1 (1)
ORA-00600: internal error code, arguments: [3020], [37], [94633], [2], [3659], [604], [16], []
ORA-10567: Redo is inconsistent with data block (file# 37, block# 94633)
ORA-10564: tablespace APPS_UNDOTS2
ORA-01110: data file 37


出现这个错误后,恢复中断,无法继续,3020错误在Metalink上的解释,主要原因是:

  This is called a 'STUCK RECOVERY'.
  There is an inconsistency between the information stored in the redo
  and the information stored in a database block being recovered.

也就是说,在恢复时发现Redo里面记录的信息和被恢复的数据块信息不一致,导致恢复无法继续。比如Update Some record from 3 to 2,结果发现该记录根本不是3,恢复无法继续。

这个错误可能是由于写Redo的某个操作丢失,这可能是由于异常宕机或存储故障导致的。
This error can be reported if any of these updates are lost for some reason.

出现这个错误,如果没有备份,数据也不是特别重要,则可以通过一些隐含参数或强制手段来打开数据库,不过不可避免的会出现数据损失,Olive做过一次这样的尝试 。
经过验证的可实践方式是使用:

 代码如下 复制代码
recover database [using backup controlfile] allow 1 corruption;

将不一致的块标记为损坏,然后可以执行进一步的恢复尝试。

这次处理这个案例,最后选择了不完全恢复,补录数据,有时候放弃也是一种恢复!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What to do if the oracle can't be opened What to do if the oracle can't be opened Apr 11, 2025 pm 10:06 PM

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

How to delete all data from oracle How to delete all data from oracle Apr 11, 2025 pm 08:36 PM

Deleting all data in Oracle requires the following steps: 1. Establish a connection; 2. Disable foreign key constraints; 3. Delete table data; 4. Submit transactions; 5. Enable foreign key constraints (optional). Be sure to back up the database before execution to prevent data loss.

How to solve the problem of closing oracle cursor How to solve the problem of closing oracle cursor Apr 11, 2025 pm 10:18 PM

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

How to create cursors in oracle loop How to create cursors in oracle loop Apr 12, 2025 am 06:18 AM

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

How to paginate oracle database How to paginate oracle database Apr 11, 2025 pm 08:42 PM

Oracle database paging uses ROWNUM pseudo-columns or FETCH statements to implement: ROWNUM pseudo-columns are used to filter results by row numbers and are suitable for complex queries. The FETCH statement is used to get the specified number of first rows and is suitable for simple queries.

How to stop oracle database How to stop oracle database Apr 12, 2025 am 06:12 AM

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.

How to create oracle dynamic sql How to create oracle dynamic sql Apr 12, 2025 am 06:06 AM

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values ​​to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.

What steps are required to configure CentOS in HDFS What steps are required to configure CentOS in HDFS Apr 14, 2025 pm 06:42 PM

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

See all articles