CREATE VIEW DB2ADMIN.YuanGong
AS
with s as (
select row_number()over(partition by fk_jk_id order by dbr_id) id1,
row_number()over(partition by fk_jk_id order by dbr_id) id2, mch,
fk_jk_id
from YuanGong ) , t(fk_jk_id,id1,id2,mch) as (
select fk_jk_id,id1,id2,cast(mch as varchar(100))
from s
where id1 =1
and id2=1
union all
select t.fk_jk_id,t.id1+1,t.id2,cast(s.mch||','||t.mch as varchar(100))
from s, t
where s.id2=t.id1+1
and t.fk_jk_id = s.fk_jk_id ) select fk_jk_id,mch
from t
where t.id1= (
select max(id1)
from s
where s.fk_jk_id = t.fk_jk_id)
表-员工表YuanGong,有8万条数据
列名:id fk_jk_id mch
建表语句:
CREATE TABLE DB2ADMIN.YUANGONG
(FK_JK_ID INTEGER,
dbr_id INTEGER,
MCH VARCHAR(100),
id INTEGER NOT NULL GENERATED ALWAYS
AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20, NO CYCLE, NO ORDER)
)
建好后,用视图查询比较慢,但用with语句直接查就能快点,有更好的办法吗?
with语句是不是效率低啊。如何让这个查询这个视图更快?或者有其他方法实现单FK_JK_ID相同,显示出所有mch为一个字段。
FK_JK_ID MCH
111 张三
111 李四
222 王五
333 理查德
111 酒法子
222 王六
显示为:
111 张三,李四,酒法子
222 王五,王六
333 理查德
20 个解决方案
#1
是不是关键字段都加了索引
#2
一个索引都没加
#3
最起码先有主键
然后fk_jk_id建立索引
然后fk_jk_id建立索引
#4
我试试。
#5
如果你有quest central for db2,你可以在tune sql里,查select * from DB2ADMIN.YuanGong
的访问计划。
控制中心里也有这工具。
然后找出问题
的访问计划。
控制中心里也有这工具。
然后找出问题
#6
TO 3楼:
为DBR_ID建主键FK_DBR_ID:
ALTER TABLE DB2ADMIN.YUANGONG
ADD CONSTRAINT FK_DBR_ID PRIMARY KEY
(DBR_ID
);
为FK_JK_ID建索引INDEX_FK_JK_ID:
CREATE INDEX DB2ADMIN.INDEX_FK_JK_ID
ON DB2ADMIN.YUANGONG
(FK_JK_ID ASC
)
PCTFREE 10
DISALLOW REVERSE SCANS;
RUNSTATS ON TABLE DB2ADMIN.YUANGONG
FOR INDEX DB2ADMIN.INDEX_FK_JK_ID
SHRLEVEL REFERENCE;
为DBR_ID建主键FK_DBR_ID:
ALTER TABLE DB2ADMIN.YUANGONG
ADD CONSTRAINT FK_DBR_ID PRIMARY KEY
(DBR_ID
);
为FK_JK_ID建索引INDEX_FK_JK_ID:
CREATE INDEX DB2ADMIN.INDEX_FK_JK_ID
ON DB2ADMIN.YUANGONG
(FK_JK_ID ASC
)
PCTFREE 10
DISALLOW REVERSE SCANS;
RUNSTATS ON TABLE DB2ADMIN.YUANGONG
FOR INDEX DB2ADMIN.INDEX_FK_JK_ID
SHRLEVEL REFERENCE;
#7
以前视图名称写错了。
视图YuanGong_tong:
CREATE VIEW DB2ADMIN.YuanGong_tong
AS with s as (
select row_number()over(partition by fk_jk_id order by dbr_id) id1,
row_number()over(partition by fk_jk_id order by dbr_id) id2, mch,
fk_jk_id
from DB2ADMIN.YUANGONG) , t(fk_jk_id,id1,id2,mch) as (
select fk_jk_id,id1,id2,cast(mch as varchar(100))
from s
where id1 =1
and id2=1
union all
select t.fk_jk_id,t.id1+1,t.id2,cast(s.mch||','||t.mch as varchar(100))
from s, t
where s.id2=t.id1+1
and t.fk_jk_id = s.fk_jk_id ) select fk_jk_id,mch
from t
where t.id1= (
select max(id1)
from s
where s.fk_jk_id = t.fk_jk_id)
视图YuanGong_tong:
CREATE VIEW DB2ADMIN.YuanGong_tong
AS with s as (
select row_number()over(partition by fk_jk_id order by dbr_id) id1,
row_number()over(partition by fk_jk_id order by dbr_id) id2, mch,
fk_jk_id
from DB2ADMIN.YUANGONG) , t(fk_jk_id,id1,id2,mch) as (
select fk_jk_id,id1,id2,cast(mch as varchar(100))
from s
where id1 =1
and id2=1
union all
select t.fk_jk_id,t.id1+1,t.id2,cast(s.mch||','||t.mch as varchar(100))
from s, t
where s.id2=t.id1+1
and t.fk_jk_id = s.fk_jk_id ) select fk_jk_id,mch
from t
where t.id1= (
select max(id1)
from s
where s.fk_jk_id = t.fk_jk_id)
#8
性能怎么样了
#9
报错信息为:
[DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014
[DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014
#10
数据量小的时候不报错,数据量大了就报错。
#11
可能是你用的客户端有问题
#12
http://www.itpub.net/483294.html
#13
tune SQL分析了下,不知什么意思:
http://hiphotos.baidu.com/a51gamer/pic/item/fa32f012efccaccf6438db42.jpg
http://hiphotos.baidu.com/a51gamer/pic/item/fa32f012efccaccf6438db42.jpg
#14
#15
cost就是每一步的性能消耗
跟执行时间有一定关系
跟执行时间有一定关系
#16
现在在net程序中报错“[DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014
”
但在db2数据库中慢点,但不报错。
to 15楼:
那我该如何优化语句。
”
但在db2数据库中慢点,但不报错。
to 15楼:
那我该如何优化语句。
#17
[DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.OleDb.OleDbException: [DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014
源错误:
行 256: daProcess.SelectCommand = comm;
行 257: Open();
行 258: daProcess.Fill(dtProcess);
行 259: Close();
行 260:
源文件: F:\BLZCH\Qianhairen\LPCommon\Common\DBAccess.cs 行: 258
堆栈跟踪:
[OleDbException (0x80040e4e): [DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014]
System.Data.OleDb.OleDbDataReader.ProcessResults(OleDbHResult hr) +1044506
System.Data.OleDb.OleDbDataReader.GetRowHandles() +254
System.Data.OleDb.OleDbDataReader.ReadRowset() +49
System.Data.OleDb.OleDbDataReader.Read() +135
System.Data.OleDb.OleDbDataReader.HasRowsRead() +15
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +291
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +116
System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +4
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +130
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +115
Qianhairen.Common.DBAccess.RunProcess(String SqlString, String TableName) in F:\BLZCH\Qianhairen\LPCommon\Common\DBAccess.cs:258
Qianhairen.Common.BNBase.GetList() in F:\BLZCH\Qianhairen\LPCommon\Common\BNBase.cs:151
Qianhairen.BLZCH.BN.PublicBN.Report_ListX_out() in F:\BLZCHTEST\BLZCH\BN\PublicBN.cs:1420
AppManage_ReportListX_out.BindData() in f:\BLZCHTEST\BLZCH\Web\AppManage\ReportListX_out.aspx.cs:245
AppManage_ReportListX_out.Page_Load(Object sender, EventArgs e) in f:\BLZCHTEST\BLZCH\Web\AppManage\ReportListX_out.aspx.cs:22
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3615; ASP.NET 版本:2.0.50727.3618
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.OleDb.OleDbException: [DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014
源错误:
行 256: daProcess.SelectCommand = comm;
行 257: Open();
行 258: daProcess.Fill(dtProcess);
行 259: Close();
行 260:
源文件: F:\BLZCH\Qianhairen\LPCommon\Common\DBAccess.cs 行: 258
堆栈跟踪:
[OleDbException (0x80040e4e): [DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014]
System.Data.OleDb.OleDbDataReader.ProcessResults(OleDbHResult hr) +1044506
System.Data.OleDb.OleDbDataReader.GetRowHandles() +254
System.Data.OleDb.OleDbDataReader.ReadRowset() +49
System.Data.OleDb.OleDbDataReader.Read() +135
System.Data.OleDb.OleDbDataReader.HasRowsRead() +15
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +291
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +116
System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +4
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +130
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +115
Qianhairen.Common.DBAccess.RunProcess(String SqlString, String TableName) in F:\BLZCH\Qianhairen\LPCommon\Common\DBAccess.cs:258
Qianhairen.Common.BNBase.GetList() in F:\BLZCH\Qianhairen\LPCommon\Common\BNBase.cs:151
Qianhairen.BLZCH.BN.PublicBN.Report_ListX_out() in F:\BLZCHTEST\BLZCH\BN\PublicBN.cs:1420
AppManage_ReportListX_out.BindData() in f:\BLZCHTEST\BLZCH\Web\AppManage\ReportListX_out.aspx.cs:245
AppManage_ReportListX_out.Page_Load(Object sender, EventArgs e) in f:\BLZCHTEST\BLZCH\Web\AppManage\ReportListX_out.aspx.cs:22
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3615; ASP.NET 版本:2.0.50727.3618
#18
QUERYTIMEOUTINTERVAL=0我也试过了,还是这样
#19
用工具db2expln测试如下,不知什么意思:
(测试语句:db2expln -database db2lc -statement "select FK_JK_ID, MCH from DB2ADMIN.YUANGONG_TONG;" -terminal)
DB2 Universal Database Version 8.1, 5622-044 (c) Copyright IBM Corp. 1991, 2002
Licensed Material - Program Property of IBM
IBM DB2 Universal Database SQL Explain Tool
DB2 Universal Database Version 8.1, 5622-044 (c) Copyright IBM Corp. 1991, 2002
Licensed Material - Program Property of IBM
IBM DB2 Universal Database SQL Explain Tool
******************** DYNAMIC ***************************************
==================== STATEMENT ==========================================
Warning compiling statement:
SQL0347W 递归公共表表达式 "DB2ADMIN.T" 可能包含无限循环。 SQLSTATE=01605
Isolation Level = Cursor Stability
Blocking = Block Unambiguous Cursors
Query Optimization Class = 5
Partition Parallel = No
Intra-Partition Parallel = No
SQL Path = "SYSIBM", "SYSFUN", "SYSPROC", "XING"
SQL Statement:
select FK_JK_ID, MCH
from DB2ADMIN.YUANGONG_TONG
Section Code Page = 1386
Estimated Cost = 4073328.750000
Estimated Cardinality = 4976.491211
Data Stream 1:
| Not Piped
| (
| | Access Data Stream 1
| | Access Temp Table ID = t1
| | | #Columns = 4
| | | Relation Scan
| | | | Prefetch: Eligible
| | Nested Loop Join
| | | Data Stream 2:
| | | | Not Piped
| | | | Data Stream 3:
| | | | | Not Piped
| | | | | Access Table Name = DB2ADMIN.YUANGONG ID = 4,155
| | | | | | #Columns = 3
| | | | | | Relation Scan
| | | | | | | Prefetch: Eligible
| | | | | | Lock Intents
| | | | | | | Table: Intent Share
| | | | | | | Row : Next Key Share
| | | | | | Sargable Predicate(s)
| | | | | | | Insert Into Sorted Temp Table ID = t2
| | | | | | | | #Columns = 3
| | | | | | | | #Sort Key Columns = 2
| | | | | | | | | Key 1: FK_JK_ID (Ascending)
| | | | | | | | | Key 2: DBR_ID (Ascending)
| | | | | | | | Sortheap Allocation Parameters:
| | | | | | | | | #Rows = 77680
| | | | | | | | | Row Width = 20
| | | | | | | | Piped
| | | | | Sorted Temp Table Completion ID = t2
| | | | | Access Temp Table ID = t2
| | | | | | #Columns = 3
| | | | | | Relation Scan
| | | | | | | Prefetch: Eligible
| | | | | Insert Into Temp Table ID = t3
| | | | | | #Columns = 4
| | | | End of Data Stream 3
| | | | Access Temp Table ID = t3
| | | | | #Columns = 3
| | | | | Relation Scan
| | | | | | Prefetch: Eligible
| | | | | Sargable Predicate(s)
| | | | | | Insert Into Temp Table ID = t4
| | | | | | | #Columns = 1
| | | | Temp Table Completion ID = t4
| | | End of Data Stream 2
| | | Access Temp Table ID = t4
| | | | #Columns = 1
| | | | Relation Scan
| | | | | Prefetch: Eligible
| | | | Sargable Predicate(s)
| | | | | #Predicates = 2
| UNION
| | Access Data Stream 3
| | Access Temp Table ID = t3
| | | #Columns = 2
| | | Relation Scan
| | | | Prefetch: Eligible
| | | Sargable Predicate(s)
| | | | #Predicates = 2
| )
| Temp Table Completion ID = t1
End of Data Stream 1
Access Temp Table ID = t1
| #Columns = 3
| Relation Scan
| | Prefetch: Eligible
Nested Loop Join
| Piped Inner
| Access Data Stream 3
| Access Temp Table ID = t3
| | #Columns = 1
| | Relation Scan
| | | Prefetch: 1 Pages
| | Sargable Predicate(s)
| | | #Predicates = 1
| | | Predicate Aggregation
| | | | Column Function(s)
| Aggregation Completion
| | Column Function(s)
| Residual Predicate(s)
| | #Predicates = 1
Return Data to Application
| #Columns = 2
End of section
#20
#21
#1
是不是关键字段都加了索引
#2
一个索引都没加
#3
最起码先有主键
然后fk_jk_id建立索引
然后fk_jk_id建立索引
#4
我试试。
#5
如果你有quest central for db2,你可以在tune sql里,查select * from DB2ADMIN.YuanGong
的访问计划。
控制中心里也有这工具。
然后找出问题
的访问计划。
控制中心里也有这工具。
然后找出问题
#6
TO 3楼:
为DBR_ID建主键FK_DBR_ID:
ALTER TABLE DB2ADMIN.YUANGONG
ADD CONSTRAINT FK_DBR_ID PRIMARY KEY
(DBR_ID
);
为FK_JK_ID建索引INDEX_FK_JK_ID:
CREATE INDEX DB2ADMIN.INDEX_FK_JK_ID
ON DB2ADMIN.YUANGONG
(FK_JK_ID ASC
)
PCTFREE 10
DISALLOW REVERSE SCANS;
RUNSTATS ON TABLE DB2ADMIN.YUANGONG
FOR INDEX DB2ADMIN.INDEX_FK_JK_ID
SHRLEVEL REFERENCE;
为DBR_ID建主键FK_DBR_ID:
ALTER TABLE DB2ADMIN.YUANGONG
ADD CONSTRAINT FK_DBR_ID PRIMARY KEY
(DBR_ID
);
为FK_JK_ID建索引INDEX_FK_JK_ID:
CREATE INDEX DB2ADMIN.INDEX_FK_JK_ID
ON DB2ADMIN.YUANGONG
(FK_JK_ID ASC
)
PCTFREE 10
DISALLOW REVERSE SCANS;
RUNSTATS ON TABLE DB2ADMIN.YUANGONG
FOR INDEX DB2ADMIN.INDEX_FK_JK_ID
SHRLEVEL REFERENCE;
#7
以前视图名称写错了。
视图YuanGong_tong:
CREATE VIEW DB2ADMIN.YuanGong_tong
AS with s as (
select row_number()over(partition by fk_jk_id order by dbr_id) id1,
row_number()over(partition by fk_jk_id order by dbr_id) id2, mch,
fk_jk_id
from DB2ADMIN.YUANGONG) , t(fk_jk_id,id1,id2,mch) as (
select fk_jk_id,id1,id2,cast(mch as varchar(100))
from s
where id1 =1
and id2=1
union all
select t.fk_jk_id,t.id1+1,t.id2,cast(s.mch||','||t.mch as varchar(100))
from s, t
where s.id2=t.id1+1
and t.fk_jk_id = s.fk_jk_id ) select fk_jk_id,mch
from t
where t.id1= (
select max(id1)
from s
where s.fk_jk_id = t.fk_jk_id)
视图YuanGong_tong:
CREATE VIEW DB2ADMIN.YuanGong_tong
AS with s as (
select row_number()over(partition by fk_jk_id order by dbr_id) id1,
row_number()over(partition by fk_jk_id order by dbr_id) id2, mch,
fk_jk_id
from DB2ADMIN.YUANGONG) , t(fk_jk_id,id1,id2,mch) as (
select fk_jk_id,id1,id2,cast(mch as varchar(100))
from s
where id1 =1
and id2=1
union all
select t.fk_jk_id,t.id1+1,t.id2,cast(s.mch||','||t.mch as varchar(100))
from s, t
where s.id2=t.id1+1
and t.fk_jk_id = s.fk_jk_id ) select fk_jk_id,mch
from t
where t.id1= (
select max(id1)
from s
where s.fk_jk_id = t.fk_jk_id)
#8
性能怎么样了
#9
报错信息为:
[DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014
[DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014
#10
数据量小的时候不报错,数据量大了就报错。
#11
可能是你用的客户端有问题
#12
http://www.itpub.net/483294.html
#13
tune SQL分析了下,不知什么意思:
http://hiphotos.baidu.com/a51gamer/pic/item/fa32f012efccaccf6438db42.jpg
http://hiphotos.baidu.com/a51gamer/pic/item/fa32f012efccaccf6438db42.jpg
#14
#15
cost就是每一步的性能消耗
跟执行时间有一定关系
跟执行时间有一定关系
#16
现在在net程序中报错“[DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014
”
但在db2数据库中慢点,但不报错。
to 15楼:
那我该如何优化语句。
”
但在db2数据库中慢点,但不报错。
to 15楼:
那我该如何优化语句。
#17
[DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.OleDb.OleDbException: [DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014
源错误:
行 256: daProcess.SelectCommand = comm;
行 257: Open();
行 258: daProcess.Fill(dtProcess);
行 259: Close();
行 260:
源文件: F:\BLZCH\Qianhairen\LPCommon\Common\DBAccess.cs 行: 258
堆栈跟踪:
[OleDbException (0x80040e4e): [DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014]
System.Data.OleDb.OleDbDataReader.ProcessResults(OleDbHResult hr) +1044506
System.Data.OleDb.OleDbDataReader.GetRowHandles() +254
System.Data.OleDb.OleDbDataReader.ReadRowset() +49
System.Data.OleDb.OleDbDataReader.Read() +135
System.Data.OleDb.OleDbDataReader.HasRowsRead() +15
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +291
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +116
System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +4
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +130
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +115
Qianhairen.Common.DBAccess.RunProcess(String SqlString, String TableName) in F:\BLZCH\Qianhairen\LPCommon\Common\DBAccess.cs:258
Qianhairen.Common.BNBase.GetList() in F:\BLZCH\Qianhairen\LPCommon\Common\BNBase.cs:151
Qianhairen.BLZCH.BN.PublicBN.Report_ListX_out() in F:\BLZCHTEST\BLZCH\BN\PublicBN.cs:1420
AppManage_ReportListX_out.BindData() in f:\BLZCHTEST\BLZCH\Web\AppManage\ReportListX_out.aspx.cs:245
AppManage_ReportListX_out.Page_Load(Object sender, EventArgs e) in f:\BLZCHTEST\BLZCH\Web\AppManage\ReportListX_out.aspx.cs:22
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3615; ASP.NET 版本:2.0.50727.3618
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.OleDb.OleDbException: [DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014
源错误:
行 256: daProcess.SelectCommand = comm;
行 257: Open();
行 258: daProcess.Fill(dtProcess);
行 259: Close();
行 260:
源文件: F:\BLZCH\Qianhairen\LPCommon\Common\DBAccess.cs 行: 258
堆栈跟踪:
[OleDbException (0x80040e4e): [DB2/NT] SQL0952N 由于中断,处理被取消。 SQLSTATE=57014]
System.Data.OleDb.OleDbDataReader.ProcessResults(OleDbHResult hr) +1044506
System.Data.OleDb.OleDbDataReader.GetRowHandles() +254
System.Data.OleDb.OleDbDataReader.ReadRowset() +49
System.Data.OleDb.OleDbDataReader.Read() +135
System.Data.OleDb.OleDbDataReader.HasRowsRead() +15
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +291
System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +116
System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +4
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +130
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +115
Qianhairen.Common.DBAccess.RunProcess(String SqlString, String TableName) in F:\BLZCH\Qianhairen\LPCommon\Common\DBAccess.cs:258
Qianhairen.Common.BNBase.GetList() in F:\BLZCH\Qianhairen\LPCommon\Common\BNBase.cs:151
Qianhairen.BLZCH.BN.PublicBN.Report_ListX_out() in F:\BLZCHTEST\BLZCH\BN\PublicBN.cs:1420
AppManage_ReportListX_out.BindData() in f:\BLZCHTEST\BLZCH\Web\AppManage\ReportListX_out.aspx.cs:245
AppManage_ReportListX_out.Page_Load(Object sender, EventArgs e) in f:\BLZCHTEST\BLZCH\Web\AppManage\ReportListX_out.aspx.cs:22
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.3615; ASP.NET 版本:2.0.50727.3618
#18
QUERYTIMEOUTINTERVAL=0我也试过了,还是这样
#19
用工具db2expln测试如下,不知什么意思:
(测试语句:db2expln -database db2lc -statement "select FK_JK_ID, MCH from DB2ADMIN.YUANGONG_TONG;" -terminal)
DB2 Universal Database Version 8.1, 5622-044 (c) Copyright IBM Corp. 1991, 2002
Licensed Material - Program Property of IBM
IBM DB2 Universal Database SQL Explain Tool
DB2 Universal Database Version 8.1, 5622-044 (c) Copyright IBM Corp. 1991, 2002
Licensed Material - Program Property of IBM
IBM DB2 Universal Database SQL Explain Tool
******************** DYNAMIC ***************************************
==================== STATEMENT ==========================================
Warning compiling statement:
SQL0347W 递归公共表表达式 "DB2ADMIN.T" 可能包含无限循环。 SQLSTATE=01605
Isolation Level = Cursor Stability
Blocking = Block Unambiguous Cursors
Query Optimization Class = 5
Partition Parallel = No
Intra-Partition Parallel = No
SQL Path = "SYSIBM", "SYSFUN", "SYSPROC", "XING"
SQL Statement:
select FK_JK_ID, MCH
from DB2ADMIN.YUANGONG_TONG
Section Code Page = 1386
Estimated Cost = 4073328.750000
Estimated Cardinality = 4976.491211
Data Stream 1:
| Not Piped
| (
| | Access Data Stream 1
| | Access Temp Table ID = t1
| | | #Columns = 4
| | | Relation Scan
| | | | Prefetch: Eligible
| | Nested Loop Join
| | | Data Stream 2:
| | | | Not Piped
| | | | Data Stream 3:
| | | | | Not Piped
| | | | | Access Table Name = DB2ADMIN.YUANGONG ID = 4,155
| | | | | | #Columns = 3
| | | | | | Relation Scan
| | | | | | | Prefetch: Eligible
| | | | | | Lock Intents
| | | | | | | Table: Intent Share
| | | | | | | Row : Next Key Share
| | | | | | Sargable Predicate(s)
| | | | | | | Insert Into Sorted Temp Table ID = t2
| | | | | | | | #Columns = 3
| | | | | | | | #Sort Key Columns = 2
| | | | | | | | | Key 1: FK_JK_ID (Ascending)
| | | | | | | | | Key 2: DBR_ID (Ascending)
| | | | | | | | Sortheap Allocation Parameters:
| | | | | | | | | #Rows = 77680
| | | | | | | | | Row Width = 20
| | | | | | | | Piped
| | | | | Sorted Temp Table Completion ID = t2
| | | | | Access Temp Table ID = t2
| | | | | | #Columns = 3
| | | | | | Relation Scan
| | | | | | | Prefetch: Eligible
| | | | | Insert Into Temp Table ID = t3
| | | | | | #Columns = 4
| | | | End of Data Stream 3
| | | | Access Temp Table ID = t3
| | | | | #Columns = 3
| | | | | Relation Scan
| | | | | | Prefetch: Eligible
| | | | | Sargable Predicate(s)
| | | | | | Insert Into Temp Table ID = t4
| | | | | | | #Columns = 1
| | | | Temp Table Completion ID = t4
| | | End of Data Stream 2
| | | Access Temp Table ID = t4
| | | | #Columns = 1
| | | | Relation Scan
| | | | | Prefetch: Eligible
| | | | Sargable Predicate(s)
| | | | | #Predicates = 2
| UNION
| | Access Data Stream 3
| | Access Temp Table ID = t3
| | | #Columns = 2
| | | Relation Scan
| | | | Prefetch: Eligible
| | | Sargable Predicate(s)
| | | | #Predicates = 2
| )
| Temp Table Completion ID = t1
End of Data Stream 1
Access Temp Table ID = t1
| #Columns = 3
| Relation Scan
| | Prefetch: Eligible
Nested Loop Join
| Piped Inner
| Access Data Stream 3
| Access Temp Table ID = t3
| | #Columns = 1
| | Relation Scan
| | | Prefetch: 1 Pages
| | Sargable Predicate(s)
| | | #Predicates = 1
| | | Predicate Aggregation
| | | | Column Function(s)
| Aggregation Completion
| | Column Function(s)
| Residual Predicate(s)
| | #Predicates = 1
Return Data to Application
| #Columns = 2
End of section