Search
 
SCRIPT & CODE EXAMPLE
 

SQL

execution plan oracle

-- Get sql_id and cursor_child_no from session
SELECT s.SQL_ID, s.SQL_CHILD_NUMBER,
       s.USERNAME, s.SCHEMANAME, s.OSUSER, s.PROGRAM,
       s.SQL_EXEC_START, s.SID
FROM GV$SESSION s
WHERE s.STATUS = 'ACTIVE' AND s.TYPE <> 'BACKGROUND';
-- Get hash plan from SQL_ID and SQL_CHILD_NUMBER
SELECT * FROM TABLE(dbms_xplan.display_cursor(sql_id => 'sql_id',
                                              cursor_child_no => 0));
Comment

oracle show execution plan

-- Without execution
EXPLAIN PLAN FOR select ...;
SELECT * FROM TABLE(dbms_xplan.display);
-- With execution
SELECT /*+ gather_plan_statistics */  ...;
SELECT * FROM TABLE(dbms_xplan.display_cursor(NULL,NULL,'ALLSTATS LAST'));
Comment

PREVIOUS NEXT
Code Example
Sql :: monthname sql 
Sql :: wordpress sql change site url 
Sql :: moodle query item quiz 
Sql :: pl sql dynamic sql drop doesnt work 
Sql :: nvl postgres 
Sql :: change mysql root password 
Sql :: copy all values of a column to another column in sql in same table 
Sql :: how to select department from table 
Sql :: set password mysql 
Sql :: sql query with replace function 
Sql :: sql random sampling per group 
Sql :: postgresql get last day of month 
Sql :: how to open closed port mysql in ubuntu 
Sql :: select * from table where name like 
Sql :: operadores en postgresql 
Sql :: mysql get character set 
Sql :: alter table drop column 
Sql :: postgresql difference between two dates in days 
Sql :: group concat with separator 
Sql :: sql update alias 
Sql :: psql import backup file for windows 
Sql :: sqlite check if row exists 
Sql :: mysql one week ago 
Sql :: import file mysql terminal 
Sql :: how to define a composite primary key in sql 
Sql :: ostgreSQL version 
Sql :: show processlist mysql full query 
Sql :: mysql insert from local csv 
Sql :: tsql cmd exec script from file 
Sql :: ajouter une clé etrangere mysql 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =