今天接到个case,有个exp的脚本导出报错了:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
. . exporting table SRIRAM_1 169 rows exported . . exporting table SRIRAM_10 126 rows exported . . exporting table SRIRAM_2 169 rows exported . . exporting table STATS 84915 rows exported . . exporting table T76B001 0 rows exported . . exporting table T76B002 0 rows exported . . exporting table TMP 284 rows exported . . exporting table TMP_F56024A_20110410 EXP-00008: ORACLE error 600 encountered ORA-00600: internal error code, arguments: [6191], [3], [11047], [16743], [], [], [], [] . . exporting table TMP_F56024A_20110417 EXP-00008: ORACLE error 600 encountered ORA-00600: internal error code, arguments: [6191], [3], [11419], [17180], [], [], [], [] . exporting synonyms . exporting views . exporting stored procedures . exporting operators . exporting referential integrity constraints . exporting triggers . exporting indextypes . exporting bitmap, functional and extensible indexes . exporting posttables actions . exporting materialized views . exporting snapshot logs . exporting job queues . exporting refresh groups and children . exporting dimensions . exporting post-schema procedural objects and actions . exporting statistics Export terminated successfully with warnings. |
从这个报错看,exp的时候有ora600,一般是遇到了bug。我们先手工的试试导出那个报错的表:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
JPJDE@NMTAS303 [/home/oracle] > exp PRODDTA/xxxxx tables=TMP_F56024A_20110410 direct=y file=TMP_F56024A_20110410.dmp log=TMP_F56024A_20110410.log Export: Release 9.2.0.4.0 - Production on Mon May 2 11:29:46 2011 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production With the Partitioning option JServer Release 9.2.0.4.0 - Production Export done in US7ASCII character set and UTF8 NCHAR character set server uses JA16SJIS character set (possible charset conversion) About to export specified tables via Direct Path ... . . exporting table TMP_F56024A_20110410 EXP-00008: ORACLE error 600 encountered ORA-00600: internal error code, arguments: [6193], [4], [1165], [12168], [16743], [], [], [] Export terminated successfully with warnings. |
确实,我们也看到了对于这个表的导出,是有ora600[6193]的报错。
我们到metalink里面去查ora600[6191]和[6193],有这样一篇文档,说明了exp的时候,如果指定direct=y,就会报错的一些bug:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
ORA-600 [6191] or ORA-600 [6193] on DIRECT Mode Export [ID 239965.1] The information in this article applies to: - Oracle Server 8i - Release 2 - 8.1.6.0 up to 8.1.6.3 - Oracle Server 8i - Release 3 - 8.1.7.0 up to 8.1.7.4 - Oracle Server 9i - Release 1 - 9.0.1.1 up to 9.0.1.5 - Oracle Server 9i - Release 2 - 9.2.0.1 up to 9.2.0.6 - Oracle Server 10g - Release 1 - 10.1.0.1 up to 10.1.0.3 - Export Utility (EXP) - Export is done in Direct Path mode: using parameter DIRECT=Y - on all supported platforms Checked for relevance on July 2009 PURPOSE ------- This document provides information about the known problems with a DIRECT path export, that can result in internal errors like ORA-600 [6191] and ORA-600 [6193]. SCOPE & APPLICATION ------------------- The article is intended for users of the Oracle8i, Oracle9i and Oracle10g databases who run a DIRECT path export and experience an internal error: ORA-600 [6191] or ORA-600 [6193]. These errors may also reproduce when exporting from older releases, such as from Oracle8 and Oracle7. As those older releases have been de-supported, they are not listed in this docuement. For details about the DIRECT path export see: Note:155477.1 "Parameter DIRECT - Conventional Path Export Versus Direct Path Export" ORA-600 [6191] OR ORA-600 [6193] ON DIRECT MODE EXPORT ========================================================= Bug:1477959 ------------- Details : A direct path export may fail with internal errors ORA-600 [6193] if the table contains ROWID columns. Releases: 8.1.6.0 and 8.1.6.1 and 8.1.6.2 and 8.1.6.3 8.1.7.0 and 8.1.7.1 and 8.1.7.2 and 8.1.7.3 9.0.1.1 and 9.0.1.2 Symptoms: EXP-00008: ORACLE error 600 encountered ORA-00600: internal error code, arguments: [6193], [1], [579], [6], [], [], [], [] Solution: Apply patchset and re-run the export: - For Oracle8i 8.1.7.x: apply 8.1.7.4 patchset - For Oracle9i 9.0.1.x: apply 9.0.1.3 patchset or any higher patchset or: Upgrade and re-run the export: - Upgrade to Oracle9i Release 2 (9.2.0.x) - Upgrade to Oracle10g Release 1 (10.1.0.x) or: Use the workaround: - re-run the export in conventional path mode (DIRECT=N). Bug:1686987 (not a public bug) -------------------------------- Details : A direct path export may fail with internal errors ORA-600 [6191] if the row data contains trailing null columns. Releases: 8.1.6.0 and 8.1.6.1 and 8.1.6.2 and 8.1.6.3 8.1.7.0 and 8.1.7.1 and 8.1.7.2 and 8.1.7.3 9.0.1.1 and 9.0.1.2 Symptoms: EXP-00008: ORACLE error 600 encountered ORA-00600: internal error code, arguments: [6191], [3], [3], [8], [], [], [], [] Solution: Apply patchset and re-run the export: - For Oracle8i 8.1.7.x: apply 8.1.7.4 patchset - For Oracle9i 9.0.1.x: apply 9.0.1.3 patchset or any higher patchset or: Upgrade and re-run the export: - Upgrade to Oracle9i Release 2 (9.2.0.x) - Upgrade to Oracle10g Release 1 (10.1.0.x) or: Use the workaround: - re-run the export in conventional path mode (DIRECT=N). Bug:2308033 ------------- Details : A direct path export may fail with internal errors ORA-600 [6191] or ORA-600 [6193] if the table contains a column with datatype LONG or LONG RAW and database block size is 8k or larger: DB_BLOCK_SIZE = 8192 (or higher) Releases: 9.0.1.1 and 9.0.1.2 and 9.0.1.3 9.2.0.1 Symptoms: EXP-00008: ORACLE error 600 encountered ORA-00600: internal error code, arguments: [6191], [3], [3937], [3957], [], [], [], [] or: EXP-00008: ORACLE error 600 encountered ORA-00600: internal error code, arguments: [6193], [4], [44], [4000], [4175], [], [], [] Ignoring these errors and trying to import from this corrupted export dump file can produce several errors upon import, such as: IMP-00020: long column too large for column buffer size (8) IMP-00018: partial import of previous table completed: 50230 rows imported IMP-00008: unrecognized statement in the export file: ? Solution: Apply patchset and re-run the export: - For Oracle9i 9.0.1.x: apply 9.0.1.4 patchset or any higher patchset - For Oracle9i 9.2.0.x: apply 9.2.0.2 patchset or any higher patchset or: Upgrade and re-run the export: - Upgrade to Oracle10g Release 1 (10.1.0.x) or: Use the workaround: - re-run the export in conventional path mode (DIRECT=N). Bug:3230116 ------------- Details : A direct path export may fail with internal errors ORA-600 [6191] or ORA-600 [6193] if the table or partition is compressed. Releases: 9.0.1.1 and 9.0.1.2 and 9.0.1.3 and 9.0.1.4 and 9.0.1.5 9.2.0.1 and 9.2.0.2 and 9.2.0.3 and 9.2.0.4 Symptoms: EXP-00008: ORACLE error 600 encountered ORA-00600: internal error code, arguments: [6193], [4], [494], [20360], [64256], [], [], [] or: EXP-00008: ORACLE error 600 encountered ORA-00600: internal error code, arguments: [6191], [3], [6985], [7156], [], [], [], [] Solution: Apply patchset and re-run the export: - For Oracle9i 9.2.0.x: apply 9.2.0.5 patchset or any higher patchset or: Upgrade and re-run the export: - Upgrade to Oracle10g Release 1 (10.1.0.x) or: Use the workaround: - re-run the export in conventional path mode (DIRECT=N). Bug:4085785 ------------- Details : A direct path export may fail with internal errors ORA-600 [6191] if the partition is compressed. This defect was introduced with the fix for Bug:3579567 "Corrupt export exporting a compressed table with direct=y (IMP-9)" Releases: 9.2.0.6 10.1.0.4 and 10.1.0.5 Symptoms: EXP-00008: ORACLE error 600 encountered ORA-00600: internal error code, arguments: [6191], [3], [19058], [51456], [], [], [], [] Solution: Apply patchset and re-run the export: - For Oracle9i 9.2.0.6: apply 9.2.0.7 patchset (when available) - For Oracle10g 10.1.0.4+: apply 10.1.0.6 patchset (when available) or: Use the workaround: - re-run the export in conventional path mode (DIRECT=N). RELATED DOCUMENTS ----------------- Note:155477.1 "Parameter DIRECT - Conventional Path Export Versus Direct Path Export" Bug:1477959 "OERI:6193 possible from DIRECT EXPORT of tables containing ROWID columns" Bug:1686987 "OERI:6191 possible from direct path export (with trailing NULL columns)" Bug:2308033 "OERI:6191 / OERI:6193 possible on DIRECT mode EXPORT of long row with >=8k DB_BLOCK_SIZE" Bug:3230116 "Direct export of a compressed table fails with OERI[6193]" Bug:4085785 "ORA-600 [6191] on compressed partition export on version which includes 3230116" 相关的 产品 Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Personal Edition Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Standard Edition |
对照上面说的bug,我们一个一个来看是不是吻合我们的系统:
Bug:1477959:应该不是,我们的数据库是9204的版本,不是这个bug的release范围内。
Bug:2308033:应该也不是,我们的表没有含有LONG或者LONG RAW的字段。
Bug:4085785:应该也不是,这个bug是针对9206的,我们是9204版本
Bug:3230116:这个看上去就比较吻合了,我们的数据库也确实是9204版本,那么这个表是不是压缩表呢?我们去查一下dba_tables的compression字段。这时问题发生了。
我们非常奇怪的看到在dba_tables中没有看到compression字段:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
SQL> desc dba_tables Name Null? Type ----------------------------------------- -------- ---------------------------- OWNER NOT NULL VARCHAR2(30) TABLE_NAME NOT NULL VARCHAR2(30) TABLESPACE_NAME VARCHAR2(30) CLUSTER_NAME VARCHAR2(30) IOT_NAME VARCHAR2(30) PCT_FREE NUMBER PCT_USED NUMBER INI_TRANS NUMBER MAX_TRANS NUMBER INITIAL_EXTENT NUMBER NEXT_EXTENT NUMBER MIN_EXTENTS NUMBER MAX_EXTENTS NUMBER PCT_INCREASE NUMBER FREELISTS NUMBER FREELIST_GROUPS NUMBER LOGGING VARCHAR2(3) BACKED_UP VARCHAR2(1) NUM_ROWS NUMBER BLOCKS NUMBER EMPTY_BLOCKS NUMBER AVG_SPACE NUMBER CHAIN_CNT NUMBER AVG_ROW_LEN NUMBER AVG_SPACE_FREELIST_BLOCKS NUMBER NUM_FREELIST_BLOCKS NUMBER DEGREE VARCHAR2(20) INSTANCES VARCHAR2(20) CACHE VARCHAR2(10) TABLE_LOCK VARCHAR2(8) SAMPLE_SIZE NUMBER LAST_ANALYZED DATE PARTITIONED VARCHAR2(3) IOT_TYPE VARCHAR2(12) TEMPORARY VARCHAR2(1) SECONDARY VARCHAR2(1) NESTED VARCHAR2(3) BUFFER_POOL VARCHAR2(7) ROW_MOVEMENT VARCHAR2(8) GLOBAL_STATS VARCHAR2(3) USER_STATS VARCHAR2(3) DURATION VARCHAR2(15) SKIP_CORRUPT VARCHAR2(8) MONITORING VARCHAR2(3) CLUSTER_OWNER VARCHAR2(30) DEPENDENCIES VARCHAR2(8) SQL> |
而在正常情况下,这个表的最后一个字段应该是compression字段:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production sys@ORADG(192.168.190.241)> sys@ORADG(192.168.190.241)> sys@ORADG(192.168.190.241)> sys@ORADG(192.168.190.241)> desc dba_tables Name Null? Type ----------------------------------------------------- -------- ------------------------------------ OWNER NOT NULL VARCHAR2(30) TABLE_NAME NOT NULL VARCHAR2(30) TABLESPACE_NAME VARCHAR2(30) CLUSTER_NAME VARCHAR2(30) IOT_NAME VARCHAR2(30) PCT_FREE NUMBER PCT_USED NUMBER INI_TRANS NUMBER MAX_TRANS NUMBER INITIAL_EXTENT NUMBER NEXT_EXTENT NUMBER MIN_EXTENTS NUMBER MAX_EXTENTS NUMBER PCT_INCREASE NUMBER FREELISTS NUMBER FREELIST_GROUPS NUMBER LOGGING VARCHAR2(3) BACKED_UP VARCHAR2(1) NUM_ROWS NUMBER BLOCKS NUMBER EMPTY_BLOCKS NUMBER AVG_SPACE NUMBER CHAIN_CNT NUMBER AVG_ROW_LEN NUMBER AVG_SPACE_FREELIST_BLOCKS NUMBER NUM_FREELIST_BLOCKS NUMBER DEGREE VARCHAR2(10) INSTANCES VARCHAR2(10) CACHE VARCHAR2(5) TABLE_LOCK VARCHAR2(8) SAMPLE_SIZE NUMBER LAST_ANALYZED DATE PARTITIONED VARCHAR2(3) IOT_TYPE VARCHAR2(12) TEMPORARY VARCHAR2(1) SECONDARY VARCHAR2(1) NESTED VARCHAR2(3) BUFFER_POOL VARCHAR2(7) ROW_MOVEMENT VARCHAR2(8) GLOBAL_STATS VARCHAR2(3) USER_STATS VARCHAR2(3) DURATION VARCHAR2(15) SKIP_CORRUPT VARCHAR2(8) MONITORING VARCHAR2(3) CLUSTER_OWNER VARCHAR2(30) DEPENDENCIES VARCHAR2(8) COMPRESSION VARCHAR2(8) |
这可能是在升级9204的时候,升级数据字典有点问题了。
由于该库是非常重要的生产库,没办法做停机,为了解决该问题,我们可以有2种方法:
1 2 |
(1)修改exp脚本,修改直接路径导出的direct=y参数,改成direct=n (2)如果真的是压缩表,把表改成非压缩的模式,从而绕过这个bug。 |
在这里,我选择了第二种方法:
我先看看这个表是不是压缩表:
用cats建一个一样的表,看其大小:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
SQL> create table TMP_F56024A_20110502 as select * from TMP_F56024A_20110410; Table created. SQL> 1* select sum(bytes)/1024/1024,segment_name from dba_segments where segment_name in ('TMP_F56024A_20110410','TMP_F56024A_20110502') group by segment_name SQL> / SUM(BYTES)/1024/1024 SEGMENT_NAME -------------------- ------------------------ 44 TMP_F56024A_20110410 216 TMP_F56024A_20110502 SQL> |
我们看到新建的表都比原表大,那原表应该是个压缩表。
而且,我们虽然没有dba_tables.compression可以看,我们还可以通过dbms_metadata.get_ddl来看,也确实是个压缩表。
ok,那我们确认其为压缩表后,尝试修改其属性为非压缩,测试导出:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
SQL> conn PRODDTA/xxxxxx Connected. SQL> alter table TMP_F56024A_20110410 nocompress; Table altered. SQL> alter table TMP_F56024A_20110410 move; Table altered. SQL> SQL> SQL> !exp PRODDTA/PRODDTA tables=TMP_F56024A_20110410 direct=y file=TMP_F56024A_20110410.dmp log=TMP_F56024A_20110410.log Export: Release 9.2.0.4.0 - Production on Mon May 2 13:41:39 2011 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production With the Partitioning option JServer Release 9.2.0.4.0 - Production Export done in US7ASCII character set and UTF8 NCHAR character set server uses JA16SJIS character set (possible charset conversion) About to export specified tables via Direct Path ... . . exporting table TMP_F56024A_20110410 81494 rows exported Export terminated successfully without warnings. SQL> |
至此,exp报错的问题解决。