Cannot re-compile or drop view. Every attempt causes the database to hang indefinitely.

StackOverflow https://stackoverflow.com/questions/19052402

  •  29-06-2022
  •  | 
  •  

Domanda

I have a view in an oracle database that appears to be corrupted or something of that nature. Some queries to that view cause the database to hang indefinitely, and this just spontaneously started happening in the past week, after years of running smoothly.

I checked the view on a test instance of the database, with the exact same data in the database, and the queries run fine. The view is identical in all visible ways, so I decided I should just re-compile the view. Every attempt to do so hangs indefinitely, so I decided to drop and re-create. Any and all attempts to drop, even from sysdba, also hang indefinitely. Creating a view from that view's script works just fine, so I decided to create a duplicate of the view, and just change the synonyms to point to the new view, but dropping the existing synonyms also hangs indefinitely. It's looking like I'm going to have to create a new view, and change every instance in our code in which the corrupted view is queried to query the new view.

Does anyone have any ideas as to how I can replace the corrupted view with a fresh, non corrupted one?

È stato utile?

Soluzione

Check if there are any uncommited transactions. They can cause DDL statements to hang, waiting for the transaction to finish.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top