我在Oracle(11.2.0.1.0)上遇到一个问题,其中太多的左外连接(或者连接表中的列太多)会导致以下错误:
ORA-03113: end-of-file on communication channel
alert.log文件将基础错误显示为:
ORA-07445: exception encountered: core dump
...
我们之前见过类似的问题,但是出现了不同的错误:
ORA-01445: cannot select ROWID from, or sample, a join view without a
key-preserved table
When ANSI SQL Join Syntax Does Not Work in Oracle
测试用例:
-- create 100 colum table
CREATE TABLE BIG_TABLE
(
c1 NVARCHAR2(1), c2 NVARCHAR2(1), c3 NVARCHAR2(1), c4 NVARCHAR2(1), c5 NVARCHAR2(1), c6 NVARCHAR2(1), c7 NVARCHAR2(1), c8 NVARCHAR2(1), c9 NVARCHAR2(1), c10 NVARCHAR2(1),
c11 NVARCHAR2(1), c12 NVARCHAR2(1), c13 NVARCHAR2(1), c14 NVARCHAR2(1), c15 NVARCHAR2(1), c16 NVARCHAR2(1), c17 NVARCHAR2(1), c18 NVARCHAR2(1), c19 NVARCHAR2(1), c20 NVARCHAR2(1),
c21 NVARCHAR2(1), c22 NVARCHAR2(1), c23 NVARCHAR2(1), c24 NVARCHAR2(1), c25 NVARCHAR2(1), c26 NVARCHAR2(1), c27 NVARCHAR2(1), c28 NVARCHAR2(1), c29 NVARCHAR2(1), c30 NVARCHAR2(1),
c31 NVARCHAR2(1), c32 NVARCHAR2(1), c33 NVARCHAR2(1), c34 NVARCHAR2(1), c35 NVARCHAR2(1), c36 NVARCHAR2(1), c37 NVARCHAR2(1), c38 NVARCHAR2(1), c39 NVARCHAR2(1), c40 NVARCHAR2(1),
c41 NVARCHAR2(1), c42 NVARCHAR2(1), c43 NVARCHAR2(1), c44 NVARCHAR2(1), c45 NVARCHAR2(1), c46 NVARCHAR2(1), c47 NVARCHAR2(1), c48 NVARCHAR2(1), c49 NVARCHAR2(1), c50 NVARCHAR2(1),
c51 NVARCHAR2(1), c52 NVARCHAR2(1), c53 NVARCHAR2(1), c54 NVARCHAR2(1), c55 NVARCHAR2(1), c56 NVARCHAR2(1), c57 NVARCHAR2(1), c58 NVARCHAR2(1), c59 NVARCHAR2(1), c60 NVARCHAR2(1),
c61 NVARCHAR2(1), c62 NVARCHAR2(1), c63 NVARCHAR2(1), c64 NVARCHAR2(1), c65 NVARCHAR2(1), c66 NVARCHAR2(1), c67 NVARCHAR2(1), c68 NVARCHAR2(1), c69 NVARCHAR2(1), c70 NVARCHAR2(1),
c71 NVARCHAR2(1), c72 NVARCHAR2(1), c73 NVARCHAR2(1), c74 NVARCHAR2(1), c75 NVARCHAR2(1), c76 NVARCHAR2(1), c77 NVARCHAR2(1), c78 NVARCHAR2(1), c79 NVARCHAR2(1), c80 NVARCHAR2(1),
c81 NVARCHAR2(1), c82 NVARCHAR2(1), c83 NVARCHAR2(1), c84 NVARCHAR2(1), c85 NVARCHAR2(1), c86 NVARCHAR2(1), c87 NVARCHAR2(1), c88 NVARCHAR2(1), c89 NVARCHAR2(1), c90 NVARCHAR2(1),
c91 NVARCHAR2(1), c92 NVARCHAR2(1), c93 NVARCHAR2(1), c94 NVARCHAR2(1), c95 NVARCHAR2(1), c96 NVARCHAR2(1), c97 NVARCHAR2(1), c98 NVARCHAR2(1), c99 NVARCHAR2(1), c100 NVARCHAR2(1)
)
/
-- left outer join query (10 joins = 1000 columns)
SELECT
*
FROM
BIG_TABLE
LEFT OUTER JOIN BIG_TABLE BT1 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT2 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT3 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT4 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT5 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT6 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT7 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT8 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT9 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT10 ON 1 = 1
--LEFT OUTER JOIN BIG_TABLE BT11 ON 1 = 1
如果取消注释最后一行,则会导致错误。
-
我已针对以下版本进行了测试:
10.2.0.1.0 = ORA-01445:无法通过密钥保留表从连接视图中选择ROWID。
(请注意,您需要注释掉最后两个连接以使其工作 - 它似乎包括除连接表之外的第一个表的列)
11.1.0.6.0 = O.K。
11.2.0.1.0 = ORA-03113:通讯渠道上的文件结尾
有人可以确认我的结果(特别是最后的结果),如果可能的话,建议任何解决方法吗?
谢谢, 本
答案 0 :(得分:4)
在Linux x86-64上的11.2.0.3中正常工作。 所以,我建议你升级11.2.0.1.0 - > 11.2.0.3.0。 它不仅会修复这个错误,还会修复数千个其他错误。 另外,如果你打开一个带有Oracle的SR,他们首先要做的是,他们会要求你升级到11.2.0.3。
-Mark
答案 1 :(得分:1)
我运行你的测试用例,我发现了一些结果: 1)你正在做笛卡尔积,如果在大表中插入2行查询输出4096行,我不知道这是否是所希望的行为 2)如果将所选列的unmber限制为96,则会得到结果。 我试过了
SELECT
big_table.c1,big_table.c2,big_table.c3,big_table.c4,big_table.c5,big_table.c6,big_table.c7,big_table.c8,big_table.c9,big_table.c10,
big_table.c11,big_table.c12,big_table.c13,big_table.c14,big_table.c15,big_table.c16,big_table.c17,big_table.c18,big_table.c19,big_table.c20,
big_table.c21,big_table.c22,big_table.c23,big_table.c24,big_table.c25,big_table.c26,big_table.c27,big_table.c28,big_table.c29,big_table.c30,
big_table.c31,big_table.c32,big_table.c33,big_table.c34,big_table.c35,big_table.c36,big_table.c37,big_table.c38,big_table.c39,big_table.c40,
big_table.c41,big_table.c42,big_table.c43,big_table.c44,big_table.c45,big_table.c46,big_table.c47,big_table.c48,big_table.c49,big_table.c50,
big_table.c51,big_table.c52,big_table.c53,big_table.c54,big_table.c55,big_table.c56,big_table.c57,big_table.c58,big_table.c59,big_table.c60,
big_table.c61,big_table.c62,big_table.c63,big_table.c64,big_table.c65,big_table.c66,big_table.c67,big_table.c68,big_table.c69,big_table.c70,
big_table.c71,big_table.c72,big_table.c73,big_table.c74,big_table.c75,big_table.c76,big_table.c77,big_table.c78,big_table.c79,big_table.c80,
big_table.c81,big_table.c82,big_table.c83,big_table.c84,big_table.c85,big_table.c86,big_table.c87,big_table.c88,big_table.c89,big_table.c90,
big_table.c91,big_table.c92,big_table.c93,big_table.c94,big_table.c95,big_table.c96
FROM
BIG_TABLE
LEFT OUTER JOIN BIG_TABLE BT1 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT2 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT3 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT4 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT5 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT6 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT7 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT8 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT9 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT10 ON 1 = 1
LEFT OUTER JOIN BIG_TABLE BT11 ON 1 = 1
并没有错误 97列或更多我得到你提到的错误。 我认为你遇到了一个bug,所以如果你有权访问Metalink,请尝试升级到最新版本。
答案 2 :(得分:0)
您的测试用例对我有用。我甚至添加了五个左外连接,这是有效的。我们的实例可能安装了一些补丁,我不确定。
SELECT * FROM v$version;
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production PL/SQL Release 11.2.0.1.0 - Production CORE 11.2.0.1.0 Production TNS for 32-bit Windows: Version 11.2.0.1.0 - Production NLSRTL Version 11.2.0.1.0 - Production
答案 3 :(得分:0)
运行此命令:
alter system set "_query_rewrite_vop_cleanup" = false
这将解决11.2.0.1无需升级的问题