I'm trying to understand what is causing an open query on an Oracle (10) database.
On AWR it shows a very high number of parse calls (e.g. 15,000+ in a 1 hour period), but 0 executions.
How it can the query not be executed, but then parsed 15000 times?
Parse Calls : 15,000+
Executions : 0
SQL Text : select * from AVIEW
The * in the SQL would explain the repeated parsing. You should replace it with a list of field names.
Oracle 11, java, jdbc 11.2.0.3
Problem occurs when you getting sequence from insert like this
PreparedStatement ps = connection.prepareStatement(QUERY, new String[] { "student_id" });
We found that jdbc driver prepares "SELECT * FROM " statement before every insert. There is only parse operation without execution.
T4CConnection.doDescribeTable
T4CStatement localT4CStatement = new T4CStatement(this, -1, -1);
localT4CStatement.open();
String str1 = paramAutoKeyInfo.getTableName();
String str2 = new StringBuilder().append("SELECT * FROM ").append(str1).toString();
localT4CStatement.sqlObject.initialize(str2);
Oracle parser doesn't cache parsed queries with "*" so there is additional parse operation per every insert.
Zero executions indicates that the query did not complete within the AWR snapshot
We have a similar issue, but the query was slightly different:
select col1, col2, col3 from table
Result was the same. A high parse rate but zero executions.
The reason was StatementCreatorUtils#setNull from spring-jdbc. ver 4.2.7 When executing:
insert into table (col1, col2, col3) values (val1, null, null)
there was a call to the database for a parameter type.
来源:https://stackoverflow.com/questions/30394077/oracle-awr-high-sql-parse-calls-but-0-executions