|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > update query very slow |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|