More on Oracle Monitoring Scripts

(We marked visited pages blue)
  • List top SQL statements in Oracle
  • Find Top Disk reads for a User in Oracle
  • Find Top Disk Reads in Oracle
  • Uptime Script

    Find database uptime.

    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
    /


    Leave a comment or a question in the comment area bellow if you fell like


    Be a sport and

    Search

    Loading... Please wait

    Subscribe to our Newsletter

    Be a sport and

    x