Click here to Skip to main content
15,065,644 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created an Oracle Data Table either in Oracle SQL Developer or in my .Net program, and also OK in updating. Today, I got something strange, as summarized below:
In Oracle SQL Developer
1) Delete tbl_xxx - working to delete all of the records
2) Truncate Table tbl_xxx - Not working, got frozen
3) Drop table, Edit (e.g. add a new column, or change table name) - Not working
In .Net Code
1) Delete tbl_xxx - Not working when running
C#
try {
using (OracleCommand cmd = new OracleCommand("delete " + tblName, connection)) {
    cmd.ExecuteNonQuery(); 
}
catch (System.IO.IOException e)  {
    g.Write2Log("Error Message: " + e.Message);
}


Got frozen at cmd.ExecuteNonQuery(), but no error message was thrown.
I did another test:
1) In Oracle SQL Developer, made a copy of the data table.
2) Could perform all of possible functions, like drop, truncate, edit,etc.

I learned that the table, which got problem as stated above, is currently used in a webservice. I am not sure this is could be the reason to cause the scheme lock or not.

What could be the problem be possibly solved? How can this be debugged w/ error message? Thanks in advance if you can share your experience.
Posted
Updated 8-Aug-14 4:32am
v2

1 solution

One posible reason is locks. In order to remove all the rows you need sufficient locks and at the time of execute there may be active locks blocking your operation.

If you have access to V$ tables, you can query for example
- V$SESSION
- V$SESSION_WAIT
- V$LOCK
to see more information about the situation.
   
Comments
s yu 8-Aug-14 12:35pm
   
The admin found a lock created in the DB. He is cleaning it up. Mika's recommendation is beneficial. Thanks.
Wendelius 8-Aug-14 13:07pm
   
Glad it helped :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900