Sunday, 9 September 2012

Health Check Scripts for R12 APPS/DB
1.Display disk free space in Linux
         df -h
2.Display Memory Usage in Linux
         free -m
3.List the processes running on the system & to check load averages
         top
4.Process status of the database
         ps -ef | grep pmon
5.Process status of the listener
         ps -ef | grep tns

6.sqlplus / as sysdba

6(i).To find the size of the tablespaces

set pages 999
col tablespace_name format a40
col "size MB" format 999,999,999
col "free MB" format 99,999,999
col "% Used" format 999
select tsu.tablespace_name, ceil(tsu.used_mb) "size MB"
, decode(ceil(tsf.free_mb), NULL,0,ceil(tsf.free_mb)) "free MB"
, decode(100 - ceil(tsf.free_mb/tsu.used_mb*100), NULL, 100,
               100 - ceil(tsf.free_mb/tsu.used_mb*100)) "% used"
from (select tablespace_name, sum(bytes)/1024/1024 used_mb
from dba_data_files group by tablespace_name union all
select tablespace_name || '  **TEMP**'
, sum(bytes)/1024/1024 used_mb
from dba_temp_files group by tablespace_name) tsu
, (select tablespace_name, sum(bytes)/1024/1024 free_mb
from dba_free_space group by tablespace_name) tsf
where tsu.tablespace_name = tsf.tablespace_name (+)
order by 4
/

6(ii).To find the Database size 

col "Database Size" format a20
col "Free space" format a20
col "Used space" format a20
select round(sum(used.bytes) / 1024 / 1024 / 1024 ) || ' GB' "Database Size"
, round(sum(used.bytes) / 1024 / 1024 / 1024 ) - 
round(free.p / 1024 / 1024 / 1024) || ' GB' "Used space"
, round(free.p / 1024 / 1024 / 1024) || ' GB' "Free space"
from    (select bytes
from v$datafile
union all
select bytes
from v$tempfile
union all
select bytes
from v$log) used
, (select sum(bytes) as p
from dba_free_space) free
group by free.p
/

6(iii).To find the INVALID objects
select count (*) from dba_objects where status='INVALID';

6(iv).To find the location of the alertlog files
show parameter background_dump_dest;

7.To find the total library process running
ps -fu $LOGNAME | grep -i libr | wc -l


No comments:

Post a Comment