EXPLAIN PLAN SET STATEMENT_ID = 'TEST' FOR
SELECT * FROM EMP;
SELECT LPAD(OPERATION, LENGTH(OPERATION) + 2 * (LEVEL -1)) ||
DECODE(ID, 0, 'Cost Estimate:' || DECODE(POSITION, '0', 'N/A', POSITION), NULL) || ''|| OPTIONS ||
DECODE(OBJECT_NAME, NULL, NULL, ':') || RPAD(OBJECT_OWNER, LENGTH(OBJECT_NAME) + 1, ',') || OBJECT_NAME ||
DECODE(OBJECT_TYPE, 'UNIQUE', ' (U) ', 'NIN_UNIQUE', '(NU)', NULL) ||
DECODE(OBJECT_INSTANCE, NULL, NULL, '('|| OBJECT_INSTANCE || ')') PLAN
FROM PLAN_TABLE
START WITH ID = 0 AND STATEMENT_ID = 'TEST'
CONNECT BY PRIOR ID = PARENT_ID AND STATEMENT_ID = 'TEST';