Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Implementing Listener Security Oracle
  • send email from unix mailx with attachment. Linux/Unix
  • Adding a new disk and mount it automatically. on VMWARE LINUX Linux/Unix
  • run this before doing any dbchange pvm_pre_change.sql Oracle
  • Example of How To Resize the Online Redo Logfiles Note:1035935.6 Oracle
  • Gathering statistics with DBMS_STATS Oracle
  • Find Multiple levels of object dependencies : depen.sql Oracle
  • Query to Generate aggregate on every 30 mins. Oracle
  • All About Trace Fils Oracle
  • How to calculate PROCESSES parameter Oracle
  • Convert multiple rows to single column Oracle
  • Transfer SQL Profiles from One database to other database. Oracle
  • Wait time tuning research Oracle
  • Reading parameter file and printing Linux/Unix
  • tar and untar a dolder with all its subfolder. Linux/Unix

Load SPM baseline from AWR

Posted on 05-Jun-2025 By Admin No Comments on Load SPM baseline from AWR
accept v_sqlid prompt 'Enter sqlid '
accept v_phv prompt 'Enter PHV '
set serveroutput on
DECLARE
v_first_snapid number;
v_last_snapid number;
v_sqlset varchar2(1000);
loaded_plans number;
BEGIN
select max(ss.snap_id)-3, max(ss.snap_id)
into v_first_snapid, v_last_snapid
from DBA_HIST_SQLSTAT S, DBA_HIST_SNAPSHOT SS
where sql_id = '&v_sqlid'
and plan_hash_value = '&v_phv'
and ss.snap_id = S.snap_id
and ss.instance_number = S.instance_number
and executions_delta > 0 ;
loaded_plans := dbms_spm.load_plans_from_awr( begin_snap=>v_first_snapid,end_snap=>v_last_snapid,
basic_filter=>q'# sql_id='&v_sqlid' and plan_hash_value='&v_phv' #' );
dbms_output.put_line('loaded-plans= ' || loaded_plans);
dbms_output.put_line('v_first_snapid ' || v_first_snapid);
END;
/
Oracle, SQL scripts

Post navigation

Previous Post: Drop specific SQL plan baseline – spm
Next Post: Drop all SPM baselines for SQL handle

Related Posts

  • oracle tips… from http://www.bijoos.com/oracle/douknow.htm Oracle
  • Find_stale_dr.sql finding stale physical DR.. Oracle
  • Oracle 10g Wait Model Oracle
  • Consolidated Reference List Of Notes For Migration / Upgrade Service Requests -ID 762540.1 Oracle
  • Handling LOB data in Oracle Oracle
  • How to analyze statspack or AWR report. 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 (394)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (343)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • Checking SQL Server Version25-Jul-2025

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Transfer SQL Profiles from One database to other database. Oracle
  • Add new columns in dataframe Python/PySpark
  • executing Function from SQLPLUS prompt Oracle
  • Rownum with Order by Oracle
  • temp_use.sql diplays usage of temp ts Oracle
  • changing kernel parameter in Oracle Enterpise Linux Linux/Unix
  • Which environment is used by currently running process ( Very good) Linux/Unix
  • Oracle vs MYSQL Architecture differences (For DBAs) MYSQL

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme