Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Drop tempfiles from database Oracle
  • Building Our Own Namespaces with “Create Context” Oracle
  • DBMS_Shared_pool pinning triggers Oracle
  • currwaitobj.sql SQl_ID and SQL statement you can get from currwaitobj.sql Oracle
  • SQL_PROFILE – I explaination Oracle
  • Rollback force for distributed transactions Oracle
  • Display the top 5 salaries for each department using single SQL Oracle
  • to see when crontab is changed. Linux/Unix
  • How does one overcome the Unix 2 Gig file limit? Linux/Unix
  • Processes Parameter decision Oracle
  • block_ident.sql Oracle
  • Remove DOS CR/LFs (^M) Linux/Unix
  • oracle fast start failover best practice Oracle
  • Jai Shree Ram Linux/Unix
  • load SPM baseline from cursor cache Oracle

run this before doing any dbchange pvm_pre_change.sql

Posted on 08-Jul-2009 By Admin No Comments on run this before doing any dbchange pvm_pre_change.sql

column currdate new_value pvmdt noprint

select ‘pvm_comp_’ || to_char(SYSDATE, ‘DDMONRRRR_HH24MI’) || ‘.sql’ currdate from v$instance;

spool &pvmdt

set lines 120 pages 2000

set head off

set feedback off

prompt set pages 5000 lines 120

prompt select ‘prompt ‘||a.owner||’.’||a.object_name||’ – ‘||a.object_type|| chr(10)||

prompt ‘alter ‘||

prompt decode(a.object_type,’PACKAGE BODY’,’PACKAGE’,object_type) || ‘ “‘||

prompt a.owner||'”.’||a.object_name||’ compile ‘||

prompt decode(a.object_type,’PACKAGE BODY’,’BODY;’,’;’)

prompt from

prompt dba_objects a

prompt where a.status = ‘INVALID’

prompt and object_id not in

prompt (

exec dbms_output.enable(NULL);

set serveroutput on size 1000000

declare

v_objid number(10);

total_count number(10);

v_counter number(10) := 1;

cursor c1 is select object_id from dba_objects where status=’INVALID’;

begin

select count(1) into total_count from dba_objects where status=’INVALID’;

for cur1 in c1 loop

dbms_output.put_line(cur1.object_id);

if v_counter < total_count then
dbms_output.put_line(‘,’);

end if;

v_counter := v_counter + 1;

end loop;

end;

/

prompt )

prompt /

set feedback on

spool off

Oracle, SQL scripts

Post navigation

Previous Post: Implementing Listener Security
Next Post: remove archfiles only when it is applied to DR rm_archfiles.sh

Related Posts

  • Standby Database Behavior when a Datafile is Resized on the Primary Database Note:123883.1 Oracle
  • Adding Datafile on Primary Server and Impact on Standby Server Oracle
  • DBMS_UTILITY PACKAGE Oracle
  • tblwopk.sql tablewopk.sql Oracle
  • findinfo.sql (SQL for getting CPU and Active session info) Oracle
  • Jai Shree Ram 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 (400)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (348)
  • SQL Server (6)
  • Uncategorized (3)
  • Videos (0)

Recent Posts

  • Running PDB on single node in RAC09-Apr-2026
  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026
  • Creating a Container Database using dbaascli08-Apr-2026
  • track_autoupgrade_copy_progress.sql01-Apr-2026
  • refre.sql for multitenant01-Apr-2026
  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix
  • good linux notes Linux/Unix
  • Rman Notes -1 Oracle
  • How to find who is using which Rollback segment and how many rows or blocks in that rollback segments, Oracle
  • Deleting first line and lastline of a file using sed Linux/Unix
  • T-SQL Vs PL/SQL Syntax SQL Server
  • Checking SQL Server Version SQL Server
  • Find execution plan from dba_hist_sql_plan for a specific SQL_ID and PLAN_HASH_VALUE fplan.sql Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme