Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

JDBC Oracle - Buscar plano de explicação para consulta


Usa isto:
oracle = ConnectionManager.getConnection(ConnectionManager.Test);
stmt = oracle.createStatement()
stmt.execute("explain plan for SELECT   1 from Dual");
rs = stmt.executeQuery("select plan_table_output from table(dbms_xplan.display())");
while (rs.next()) 
{
  System.out.println(rs.getString(1));
}