Friday, November 13, 2015

Mount Point Utilization in readable format

Mount Point Utilization in readable format HP UX


df -Pk | awk '
BEGIN {print "Filesystem                          Mount Point                 Total GB   Avail GB    Used GB  Used"
       print "----------------------------------- ------------------------- ---------- ---------- ---------- -----"}
END {print ""}
/dev/ || /^[0-9a-zA-Z.]*:\// {
printf ("%-35.35s %-25s %10.2f %10.2f %10.2f %4.0f%\n",$1,$6,$2/1024/1024,$4/1024/1024,$3/1024/1024,$5)
}'


should work for other servers too.


Sunday, November 8, 2015

How much Archives generated Today with Switches - Script

you can modify the below script by modifying sysdate -1,-2,-3 .. etc for the number of days you want.



set pagesize 10000 linesize 10000
set feedback 0
column date format a18

select  to_char(first_time, 'YYYY-MM-DD Dy') as "date",
        round( sum((blocks + 1) * block_size)
          / 1024 / 1024 / 1024) as "size_gb",
        count (*) as "number_of_switches_per_day"
  from  v$archived_log
  where dest_id = 1
  group by to_char(first_time,'YYYY-MM-DD Dy')
  order by to_char(first_time,'YYYY-MM-DD Dy');

select  round(sum((blocks + 1) * block_size)
              / 1024 / 1024 / 1024) as "todays_size_gb",
        count (*) as "number_of_switches_today"
  from  v$archived_log
  where dest_id = 1
    and first_time >= sysdate - 1;


Monday, November 2, 2015

Recompile Objects Script

set heading off;
set feedback off;
set echo off;
Set lines 999;

Spool run_invalid.sql

select
'ALTER ' || OBJECT_TYPE || ' ' || OWNER || '.' || OBJECT_NAME || ' COMPILE;'
from dba_objects where status = 'INVALID' and
object_type in ('PACKAGE','FUNCTION','PROCEDURE');

spool off;

set heading on;
set feedback on;
set echo on;

@run_invalid.sql