EXPLAIN PLAN of SQL in oracle

EXPLAIN PLAN OF SQL
====================


First connect sqlplus and generate plan like below, with out executing sql.

---i will take below sql for example---
 select * from emp where empno = 202

---how to generate plan without execution.

EXPLAIN PLAN FOR
 select * from emp where empno = 202;

---- how to display generated plan--

SET LINESIZE 300
SET PAGESIZE 300
SELECT * FROM table(DBMS_XPLAN.DISPLAY);


--this sql will displays the plan.

No comments:

Post a Comment

View running queries in postgresql

 View running queries in postgreSQL: SELECT * FROM pg_stat_activity;