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 :: alter tablespace add datafile autoextend 
Sql :: wsl install mysql 
Sql :: what is mysql_pconnect 
Sql :: getting next sequence value jpa postgress 
Sql :: where to locate set password for mysql 
Sql :: sql auto date 
Sql :: désinstaller postgresql linux 
Sql :: shell mysql connect 
Sql :: mysql previous year 
Sql :: sql server: select column values as comma separated string 
Sql :: How to Add a Default Value to a Column in MS SQL Server 
Sql :: search db for table name 
Sql :: add foreign key constraint in postgresql 
Sql :: ajouter une clé etrangere mysql 
Sql :: purge undo tablespace usage 
Sql :: ORA-00903: invalid table name 
Sql :: sql decimal to 2 places 
Sql :: mysql date to string 
Sql :: sql rank 
Sql :: mysql current date 
Sql :: sql calculate percentage 
Sql :: phone number sql 
Sql :: sql where first letter 
Sql :: how to update date value in sql 
Sql :: change date format in oracle query 
Sql :: give a column name to values generated from case statement in sql 
Sql :: sql how to duplicate a table 
Sql :: how to change column name in sql 
Sql :: mariadb add foreign key 
Sql :: vbscript connect mssql 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =