'uptime'에 해당되는 글 1건

  1. 2010.02.25 오라클 시스템 uptime 확인하는 쿼리
ORACLE/SCRIPT2010. 2. 25. 10:51
반응형
col host_name form a10 heading "Host"
col instance_name form a8 heading "Instance" newline
col stime form a40 Heading "Database Started At" newline
col uptime form a60 heading "Uptime" newline
set heading off

select 'Hostname      : ' || host_name
      ,'Instance Name : ' || instance_name
      ,'Started At    : ' || to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') stime
      ,'Uptime        : ' || floor(sysdate - startup_time) || ' days(s) ' ||
       trunc( 24*((sysdate-startup_time) -
       trunc(sysdate-startup_time))) || ' hour(s) ' ||
       mod(trunc(1440*((sysdate-startup_time) -
       trunc(sysdate-startup_time))), 60) ||' minute(s) ' ||
       mod(trunc(86400*((sysdate-startup_time) -
       trunc(sysdate-startup_time))), 60) ||' seconds' uptime
from v$instance
반응형

'ORACLE > SCRIPT' 카테고리의 다른 글

ORACLE INDEX,TABLE정보 조회  (0) 2010.04.28
과도한 I/O 유발 쿼리 찾기  (0) 2010.04.15
제약조건 확인  (0) 2010.01.03
sqlplus에서 spool사용 insert문으로 data 뽑아내기  (0) 2009.12.24
oracle 실행한 쿼리 조회  (0) 2009.10.13
Posted by [PineTree]