Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Export Import with QUERY Oracle
  • Finding last recovered file on DR and remove all chanracters before any “/” Linux/Unix
  • Oracle Connections expire_time and firewall Oracle
  • CPU speed on solaris Linux/Unix
  • Caching sequence in Memory Oracle
  • Jai Shree Ram Linux/Unix
  • Sort with ASCII order and Numeric Order Linux/Unix
  • rm_backup_arch_file.ksh Linux/Unix
  • cp_filesystem.sql Oracle
  • CTAS with LONG Column for 7.x and 8 and 8i Oracle
  • Oracle 11g Training on 29JAN1010 Oracle
  • scripts to take listener.log backup Linux/Unix
  • Check Oracle installed products using one command Oracle
  • Test Case for Inserting Multiple (2.3 Million rows in 26 Seconds) Oracle
  • TRUNCATE Privs Oracle

Find execution plan from dba_hist_sql_plan for a specific SQL_ID and PLAN_HASH_VALUE fplan.sql

Posted on 27-Sep-2006 By Admin No Comments on Find execution plan from dba_hist_sql_plan for a specific SQL_ID and PLAN_HASH_VALUE fplan.sql

REM fplan.sql

REM Find execution plan from dba_hist_sql_plan for a specific SQL_ID and PLAN_HASH_VALUE.

column plan_hash_value format 999999999999

accept v_sqlid prompt ‘Enter SQL_ID : ‘

accept v_plan_hash_value prompt ‘Enter PLAN Hash Value : ‘

SELECT LPAD(‘ ‘,2*(LEVEL-1))||operation||’ ‘||options ||’ ‘||object_name ||’ ‘|| DECODE(id, 0, ‘Cost = ‘||position)

“Query Plan”

FROM dba_hist_sql_plan

START WITH id = 0 and sql_id=’&v_sqlid’ and plan_hash_value=&v_plan_hash_value

CONNECT BY PRIOR id = parent_id and sql_id=’&v_sqlid’ and plan_hash_value=&v_plan_hash_value;

Oracle, SQL scripts

Post navigation

Previous Post: Find Plan Hash value fphv.sql
Next Post: currwaitobj.sql SQl_ID and SQL statement you can get from currwaitobj.sql

Related Posts

  • New Latest Param.sql for finding all hidden parameters also Oracle
  • mutex in Oracle 10.2.0.2 or Oracle 10g Oracle
  • Find average Row Length and other table size calculation. metalink notes Oracle
  • Absolute file number and relative file number Oracle
  • Drop tempfiles from database Oracle
  • Alter procedure auditing Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (395)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (343)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026
  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • reset Sequence Oracle
  • Find long Running Transaction Linux/Unix
  • DBMS_STATS Metalinks Notes Oracle
  • Jai Shree Ram Linux/Unix
  • Rman Notes -1 Oracle
  • Explain Plan Doesn’T Change For Sql After New Statistics Generated Oracle
  • All About Trace Fils Oracle
  • find_open_cur.sql Find open cursorts per session Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme