Delete on oracle taking long
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 397
- Joined: Wed Apr 12, 2006 2:28 pm
- Location: Tennesse
Delete on oracle taking long
I am running a job with two Oracle stages where it extracts the Key of table A and in second stage deletes some record from table A based on some conditions.
In the target I am using user define query for delete rows. like
DELETE FROM TABLE A
where KEY in (........
The job starts fine and it even delete those records which I can see on Database side but even after deleting the jobs doesn't finish, it shows running status for hours.
I am not sure what's going on DB side. Are there any other way to achieve this ?
Any help will be appreciated.
In the target I am using user define query for delete rows. like
DELETE FROM TABLE A
where KEY in (........
The job starts fine and it even delete those records which I can see on Database side but even after deleting the jobs doesn't finish, it shows running status for hours.
I am not sure what's going on DB side. Are there any other way to achieve this ?
Any help will be appreciated.
hi sam here
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Premium Member
- Posts: 397
- Joined: Wed Apr 12, 2006 2:28 pm
- Location: Tennesse
-
- Premium Member
- Posts: 397
- Joined: Wed Apr 12, 2006 2:28 pm
- Location: Tennesse
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Get your DBA to monitor the session. In my experience DELETE does take a very long time, particularly when there are referential integrity constraints involved.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
But the fact that the deletes 'can be seen' on the database side, which I take to mean they can be seen to be gone, would imply they have been committed and thus the Oracle part is done. Well... unless intermediate commits are being done and they only checked some. ![Confused :?](./images/smilies/icon_confused.gif)
![Confused :?](./images/smilies/icon_confused.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
In addition to that
If you are sure database is taking time then
Check the indexes on columns used in where condition. I believe Its indexed as you termed it as KEY.
Analyze the table and indexes. If references of that table are present in the database analyse all referneced tables and indexes.
Check if cascade delete is enabled on that table generally it should not.
Ask your DBA to monitor the session to find any bottlenecks.
If you are sure database is taking time then
Check the indexes on columns used in where condition. I believe Its indexed as you termed it as KEY.
Analyze the table and indexes. If references of that table are present in the database analyse all referneced tables and indexes.
Check if cascade delete is enabled on that table generally it should not.
Ask your DBA to monitor the session to find any bottlenecks.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.![Wink :wink:](./images/smilies/icon_wink.gif)
Genius may have its limitations, but stupidity is not thus handicapped.
![Wink :wink:](./images/smilies/icon_wink.gif)
-
- Participant
- Posts: 3
- Joined: Tue Feb 07, 2006 6:56 am
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom