Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • sql_doing_fts.sql Oracle
  • Good notes for shared pool Oracle
  • upload.html PHP/MYSQL/Wordpress
  • ORA-8031 issue and solution if it is occuring due to truncate. Oracle
  • To see only files and/or folders using LS command Linux/Unix
  • PLSQL Table Syntax 2 Oracle
  • Database link password in user_db_links Oracle
  • ORA-00064: object is too large to allocate on this O/S during startup Oracle
  • Check_recovery.sh program to run sqlplus and return its values remotely. Linux/Unix
  • Oracle Recommended Patches — Oracle Database ID 756671.1 Oracle
  • Goldengate document from Porus Oracle
  • Roles and Stored Procs II Oracle
  • import-export with multiple files Oracle
  • tar and untar a dolder with all its subfolder. Linux/Unix
  • How to specify 2 arch location to avoid any kind of DB hanging. 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

  • find_longsql.sql Oracle
  • 272332.1 CRS 10g Diagnostic Collection Guide Oracle
  • eplan.sql Oracle
  • Rman Notes -1 Oracle
  • SYSOPER Mystery Oracle
  • How To Transfer Passwords Between Databases (ref note: 199582.1) Oracle

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • 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
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Remove duplicate rows from table Oracle
  • Temporary Tablespsace Temp tablespace behaviour Oracle
  • Export Import with QUERY Oracle
  • Free conference number from http://www.freeconference.com Oracle
  • Committing distributed transaction using commit force Oracle
  • newupload.html PHP/MYSQL/Wordpress
  • normal maintenance for exp-imp and renaming table Oracle
  • pvm_rbs1.sql (to collect rbs info from db) Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme