在11g上有个新特性,叫reference partition table,但是有时候在查询reference partition的时候,会报错ORA-00600 [6305]
我们可以看下面的testcase:
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 |
TestCase: SQL> CREATE TABLE BILL_DATA_T ("BILLID" CHAR(10 BYTE) NOT NULL ENABLE, -----<<<<<<< 4.BILLID是char 10 "COGCODE" CHAR(7 BYTE), CONSTRAINT "PK_BILL_DATA_T" PRIMARY KEY ("BILLID")) PARTITION BY RANGE ("COGCODE") (PARTITION "BILLS_2012" VALUES LESS THAN ('X'), PARTITION "BILLS_OPEN" VALUES LESS THAN (MAXVALUE)); 2 3 4 5 6 7 8 Table created. SQL> SQL> CREATE TABLE FREIGHT_ITEM_T ("BILLID" CHAR(10 BYTE) NOT NULL ENABLE, "FRTITEMID" CHAR(3 BYTE) NOT NULL ENABLE, CONSTRAINT PK_FREIGHT_ITEM_T PRIMARY KEY ("BILLID"), CONSTRAINT FK_FREIGHT_ITEM_T FOREIGN KEY ("BILLID") REFERENCES ---<<<<<<< 3.外键是参考BILL_DATA_T表的BILLED字段 BILL_DATA_T ("BILLID")) PARTITION BY REFERENCE ----<<<<<<<<<<<<< 1.是partition by reference ("FK_FREIGHT_ITEM_T") ----<<<<<<<<<<< 2.参考了FK_FREIGHT_ITEM_T (PARTITION "BILLS_2012", PARTITION "BILLS_OPEN"); 2 3 4 5 6 7 8 9 10 Table created. SQL> SQL> SQL> select * from freight_item_t where billid='123456789000000'; ----<<<<< 5.超过char 10,就报错 select * from freight_item_t where billid='123456789000000' * ERROR at line 1: ORA-00600: internal error code, arguments: [6305], [16], [12], [1], [], [], [], [], [], [], [], [] SQL> SQL> SQL> SQL> c/123456789000000/123456789 1* select * from freight_item_t where billid='123456789' -----<<<<<< 6.不超过char 10,就不会报错。 SQL> / no rows selected SQL> |
这其实是bug 13841623.
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 |
(1)该bug发生在11.2.0.2和11.2.0.3. (2)该bug的call stack为获得引用分区的range有关,会调用kkpamRefGet()、kkpamFRange()、 kkpapbGetRange()等: ----- Call Stack Trace ----- calling call entry argument values in hex location type point (? means dubious value) -------------------- -------- -------------------- ---------------------------- ksedst1()+124 CALL skdstdst() FFFFFFFF7FFEE8D0 ? 000000002 ? 10CB723B0 ? 000000000 ? FFFFFFFF7FFC5C40 ? 000000000 ? ksedst()+52 CALL ksedst1() 00010D000 ? 00010CC00 ? 10CFFF000 ? 00010D007 ? 10CFFF948 ? 10D00787C ? dbkedDefDump()+1988 CALL ksedst() 000000000 ? 10D01E000 ? 00010D01E ? 10D007000 ? 00010D000 ? 00010D007 ? dbgexPhaseII()+1340 PTR_CALL dbkedDefDump() 000000002 ? 10D007000 ? 000000003 ? 000000001 ? 000000000 ? 000000008 ? dbgexProcessError() CALL dbgexPhaseII() 10D1BD150 ? +2072 FFFFFFFF7A40EE00 ? 10D28D0F0 ? 1006E86C0 ? 10CFF5D40 ? 000000000 ? dbgePostErrorKGE()+ CALL dbgeExecuteForError 000000024 ? 10CFFFE40 ? 1348 () 000000000 ? 10D1BD150 ? FFFFFFFF7A40EE00 ? 10CFF5D40 ? dbkePostKGE_kgsf()+ CALL dbgePostErrorKGE() 000000000 ? 10D1BD150 ? 48 10CFFFE40 ? 000000000 ? 000000258 ? FFFFFFFF78F21DF0 ? kgeade()+640 PTR_CALL dbkePostKGE_kgsf() 10CFFFC90 ? FFFFFFFF78F21168 ? 000000258 ? 000002868 ? 10B445000 ? 00010B445 ? kgeriv_int()+128 CALL kgeade() FFFFFFFF7FFF6F00 ? FFFFFFFF78F21168 ? 000000001 ? 000000258 ? 000000000 ? 000000004 ? kgeasi()+180 CALL kgeriv_int() 10CFFFC90 ? FFFFFFFF78F21168 ? 0000018A1 ? 000000000 ? 000000003 ? FFFFFFFF7FFF7198 ? kdkoin()+1736 CALL kgeasi() 10CFFFC90 ? FFFFFFFF78F21168 ? 0000018A1 ? 000000002 ? 000000003 ? 000000000 ? kkpamRefGet()+1740 CALL kdkoin() 000000016 ? 000000017 ? 00010CC00 ? 00010D007 ? 000000001 ? 000001800 ? kkpamFRange()+1396 CALL kkpamRefGet() 000000001 ? 68F52E7B0 ? FFFFFFFF7FFF9434 ? FFFFFFFF7DFC8028 ? 000000016 ? 6D65834D8 ? kkpapbGetRange()+33 CALL kkpamFRange() 000000001 ? 6 FFFFFFFF7FFF9411 ? 6C4D3F220 ? 000000000 ? 000000000 ? 00000003D ? kkpapGRangeSLvl()+1 CALL kkpapbGetRange() FFFFFFFF7FFF9874 ? 08 6D65834D8 ? 000000001 ? FFFFFFFF7FFF987C ? FFFFFFFF7FFF9878 ? 000000002 ? kkpapiItOpen()+244 CALL kkpapGRangeSLvl() 6D6582F28 ? 6D65834D8 ? 000000002 ? FFFFFFFF7FFF9CDC ? FFFFFFFF7FFF9CD8 ? FFFFFFFF7FFF9CD4 ? kkpapItOpen()+168 CALL kkpapiItOpen() 000000000 ? 000100000 ? 6D6582F28 ? 6D65834D8 ? FFFFFFFF7FFF9EB8 ? 000000002 ? qertbItOpen()+88 CALL kkpapItOpen() 6D6582F28 ? FFFFFFFF78E72FA0 ? 000000002 ? 000000002 ? 000000000 ? FFFFFFFF78E72FB0 ? qertbStart()+2916 CALL qertbItOpen() 6AF307260 ? FFFFFFFF78E54988 ? 000000002 ? 000000080 ? 38000A000 ? 6D6582F28 ? selexe0()+1008 PTR_CALL qertbStart() 00010D01E ? FFFFFFFF78E548C0 ? 040004880 ? 6AF307150 ? 040004880 ? 10CFFF948 ? opiexe()+10348 CALL selexe0() 10B4F9000 ? FFFFFFFF78F325A0 ? 10B7A2000 ? 10BA37F20 ? 68F52EF30 ? 026270001 ? kpoal8()+1924 CALL opiexe() 000000000 ? 10CFFFE40 ? 10D016880 ? FFFFFFFF78F51C40 ? 000000000 ? FFFFFFFF78E5AFC8 ? opiodr()+1164 PTR_CALL kpoal8() FFFFFFFFFFFFFFFC ? FFFFFFFF7FFFE3C8 ? 10D016880 ? 000000000 ? FFFFFFFF78F325A0 ? 000000013 ? ttcpip()+916 PTR_CALL opiodr() 00010B400 ? 00010CC00 ? 10CFFFE40 ? 00000005E ? 000000000 ? 000003E00 ? opitsk()+1640 CALL ttcpip() 103CB5220 ? 000000028 ? 10CFFFC90 ? FFFFFFFF7FFFE3C8 ? FFFFFFFF7FFFCE10 ? 10B424008 ? opiino()+924 CALL opitsk() 10B4284D4 ? 10B4281E4 ? 000000001 ? 10D016804 ? 000000000 ? 00000000A ? opiodr()+1164 PTR_CALL opiino() 10D016880 ? FFFFFFFF7FFFF780 ? 000000001 ? 000000000 ? 0000000A3 ? 10D1BE938 ? opidrv()+1032 CALL opiodr() 10D014000 ? 000003D70 ? 10CFFFE40 ? 00000003C ? 000000000 ? 000003E00 ? sou2o()+88 CALL opidrv() 10D004000 ? 000000000 ? 10D016880 ? 00000003C ? 000000000 ? FFFFFFFF7FFFF780 ? opimai_real()+504 CALL sou2o() FFFFFFFF7FFFF758 ? 00000003C ? 000000004 ? FFFFFFFF7FFFF780 ? 10D01AC88 ? 00010D000 ? ssthrdmain()+316 PTR_CALL opimai_real() 000000002 ? FFFFFFFF7FFFFA08 ? FFFFFFFF7DD00AD0 ? 00010C400 ? 000000000 ? 000000001 ? main()+316 CALL ssthrdmain() 00010D000 ? 00010D025 ? 10D025000 ? 000000002 ? 00010D025 ? 10D1AEC70 ? _start()+380 CALL main() 000000002 ? 000000000 ? 000000000 ? FFFFFFFF7FFFFA18 ? FFFFFFFF7FFFFB28 ? FFFFFFFF7B300200 ? --------------------- Binary Stack Dump --------------------- (3)当代入的变量超过引用分区表的字段定义时,就会报错ora 600 [6305]了。如上我们的 char (10),如果查询的时候,条件的输入超过10,就会出现该报错。 |
解决方案:
1 2 |
目前该bug在11.2.0.3上在HP IA,Solaris SPARC 64上有patch。 建议开发对前端输入进行限制,如不能输入超过char (10)的值。如果超过定义,就会报错,如果不超过,就正常输出。 |
一条评论
测试了一下,oracle11.2.0.3for winx64没有遇到这个bug