How is this possible?
Hello, I'm on Oracle Database 12.2, Linux, patches are current, statistics are current.
I have a Korn shell script that runs 3 queries, a select an insert and a delete. It’s been running for months in seconds. Suddenly it’s taking 12 minutes to run.
By process of elimination I narrowed down the offending query to the select.
In the shell script it’s taking 12 minutes. In SQL Plus on the database server it’s taking 12 minutes. In Toad it takes mircoseconds.
In OEM I discovered 2 different plan hash values and execution times. One very fast, one very not fast. I was able to recreate the 12 minute and microsecond run times at will by logging in with the different products.