spool /export/home/oracle/scripts/idle_cpu.txt
set linesize 120
set pagesize 120
SELECT TO_CHAR (start_date, ‘DD-MON-RRRR:HH24:MI’) start_dt, user_cpu,
system_cpu, idle_cpu, wait_cpu
FROM stats$vmstat2
where idle_cpu<=30
and start_date>=(SYSDATE – 1/48) AND ROWNUM <2 ORDER BY start_date DESC;
spool off