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:
  #1  
Old December 28th, 2004, 06:29 AM
rajiv_iyer rajiv_iyer is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 4 rajiv_iyer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 11 sec
Reputation Power: 0
update query very slow

I have a problem with production database. One of the procedures is taking a lot of time in completion. Oracle Enterprise Manager showed a particular update query as the culprit. Now it is very difficult to understand how a particular update query which was running well till friday suddenly becomes slow on Monday. Please help me in understanding how internally an Update query works in Oracle. Does it use any internal mechanism or object which has become corrupt.
One more thing I would like to add. On Sunday the database had crashed due to some reasons and the DBA had managed to recover it. Might this have any impact on the update query or anything else which results in poor performance.
Please help me since I have to take immediate steps regarding this.

Reply With Quote
  #2  
Old December 29th, 2004, 01:40 PM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,308 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 5 h 2 m 57 sec
Reputation Power: 48
Try EXPLAIN PLAN for the update query. It sounds like this update is part of a trigger.
This will show you how the update goes about finding the row(s) to update.

If the update is no longer using indexes, it may be because the table(s) in question need to be analyzed to allow the optimizer to make good decisions. Also analyze the indexes on the table(s).

Code:
analyze table mytable compute statistics;
analyze index index_on_mytable comput statistics;


I'm assuming you use the CBO.

Reply With Quote
  #3  
Old December 29th, 2004, 01:47 PM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,308 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 5 h 2 m 57 sec
Reputation Power: 48
PS. It's possible that in recovering the db, some of the various files that comprise the db were not in sync. However, this usually results in lots of runtime errors for users when you start the db.

Your DBA should have a hot backup scheduled everyday. If he doesn't get him going on that.

Reply With Quote
  #4  
Old January 11th, 2005, 09:09 AM
rajiv_iyer rajiv_iyer is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 4 rajiv_iyer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 11 sec
Reputation Power: 0
Thanks Jim,

It indeed turned out that I needed to analyze the table and the indexes. Now the system is workin smoothly. Thanks for ur invaluable help.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > update query very slow


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 3 hosted by Hostway