Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle database is hanging infinitly in UPDATE queries

suddenly my update queries are not executing . i can make select queries but when i try to update records the database hangs infinitly. i tried even from sql plus and nothing happens.

like image 742
erni313 Avatar asked Sep 21 '11 14:09

erni313


People also ask

Why does Oracle query take so long to execute?

On a large table this could take a long time either way, maybe even longer than the 4 or 5 minutes you're seeing. Once the data is retrieved, the temporary index would be dropped in the background. When you do another query, Oracle needs to build a new temporary index, which is why it takes that long for every query.

How would you troubleshoot a slow running query in Oracle?

If you are running a query and it's slow, it could benefit from indexes. Indexes are often the most useful when created on columns as part of the Join clause and the Where clause. So, check which columns are used there, check if they have indexes, and create them if they don't.

Why is my Oracle DB slow?

The most common causes of slow performance are as follows: Excessive round-trips from the application server to the database. Ideally, each UI operation should require exactly one round-trip to the database. Sometimes, the framework will require additional round-trips to retrieve and make session data persistent.


1 Answers

Most likely you have another open uncommitted transaction for the same set of records, so they are locked for that transaction.

And, most likely, you locked them, running the same UPDATE in another transaction.

Just Commit/rollback your transactions, you should be fine.

like image 168
Adriano Carneiro Avatar answered Sep 23 '22 11:09

Adriano Carneiro