Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old May 6th, 2004, 07:16 AM
string string is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 2 string User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy SQL query problem

I have this sql in my stored procedure, oracle 9i, the value '1120%' in the last line is from a binded varaible:

UPDATE EIM_OPTY A
SET CON_COMMENTS = (SELECT DESC_TEXT FROM S_LST_OF_VAL WHERE TYPE = 'UOB_APPL_ERROR' AND ACTIVE_FLG = 'Y' AND VAL = 'EIM ERROR')
WHERE (IF_ROW_STAT = 'IMPORTED' OR IF_ROW_STAT != 'IMPORTED')
AND IF_ROW_BATCH_NUM > 1
AND ROW_ID IN (SELECT B.ROW_ID FROM EIM_FN_CONTACT1 B, EIM_FN_CONTACT4 C, EIM_OPTY_DTL D, EIM_FN_OPTY1 E, EIM_CONTACT F WHERE B.ROW_ID = A.ROW_ID AND B.IF_ROW_BATCH_NUM >= 1 AND C.ROW_ID = B.ROW_ID AND C.IF_ROW_BATCH_NUM >= 1 AND D.ROW_ID = C.ROW_ID AND D.IF_ROW_BATCH_NUM >= 1 AND E.ROW_ID = D.ROW_ID
AND E.IF_ROW_BATCH_NUM >= 1 AND F.ROW_ID = E.ROW_ID
AND F.IF_ROW_BATCH_NUM >= 1 AND (B.IF_ROW_BATCH_NUM > 1 AND B.IF_ROW_STAT != 'IMPORTED') OR (B.IF_ROW_BATCH_NUM = 1 AND B.IF_ROW_STAT IN ('ID# ALREADY EXISTS', 'CIF# FOUND'))
OR (C.IF_ROW_BATCH_NUM > 1 AND C.IF_ROW_STAT != 'IMPORTED') OR (C.IF_ROW_BATCH_NUM = 1 AND C.IF_ROW_STAT = 'IMPORT FAILED') OR (D.IF_ROW_BATCH_NUM > 1 AND D.IF_ROW_STAT != 'IMPORTED') OR (E.IF_ROW_BATCH_NUM > 1 AND E.IF_ROW_STAT != 'IMPORTED') OR (F.IF_ROW_BATCH_NUM > 1 AND F.IF_ROW_STAT != 'IMPORTED') OR (F.IF_ROW_BATCH_NUM = 1 AND F.IF_ROW_STAT = 'IMPORT FAILED'))) AND ROW_ID LIKE '1120%';

When I have 500 records in each of the tables, the query works fine, but when the record number increases to 5000, the query will hang. Don't think the query is executing too slow and take a long time to finish, because I left it run for a whole night and it still didn't finish executing. Is there anything wrong with the query? I have been running for many many times and I'm still stucked . Please help... Thanks alot in advance!

Best Regards,
string

Reply With Quote
  #2  
Old May 19th, 2004, 04:32 PM
jimbag8 jimbag8 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 28 jimbag8 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Are the columns indexed?, Are there any partitions that you are dealing with?, are you putting your driving tables first?, and...are you pulling any CLOB data back?

~jimbag8

Reply With Quote
  #3  
Old June 16th, 2004, 11:45 AM
astrocanis astrocanis is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 14 astrocanis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to astrocanis
are you committing at midpoint by any chance. a strange point: Oracle locks rows for read consistency, but writes blocks. if your update's commit occurs before end of block with updated data, the process can hang as the block is considered complete but still locked!

Reply With Quote
  #4  
Old June 16th, 2004, 11:46 AM
astrocanis astrocanis is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 14 astrocanis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to astrocanis
sorry....

you should run explain plan on the query as well...

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > SQL query problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway