Oracle startup and shutdown script: very famous (dbora) ;)

This is the most complete dbora script i came up with, i used linux subsystem and pid file for complete status workings… please have a look and n point out if there is anything to be done further in it…   #!/bin/sh # chkconfig: 345 55 25 # /etc/init.d/dbora # Description: Starts and stops the Oracle database and listener # Author: ConArtist # Date: 21/04/14 # source function library .

Which query takes the most CPU in oracle database?

Here is a simple sql query which will show which query is misbehaving and consuming the most CPU usage SELECT ss.username,        ss.OSUSER,        ss.TERMINAL,        se.SID,        VALUE / 100 cpu,        sq.SQL_TEXT   FROM v$session ss, v$sesstat se, v$statname sn, v$sql sq  WHERE se.STATISTIC# = sn.STATISTIC#    AND NAME LIKE '%CPU used by this session%'    AND se.SID = ss.SID    AND ss.STATUS = 'ACTIVE'    AND ss.username IS NOT NULL    AND ss.SQL_ID = sq.SQL_ID    AND VALUE / 100 >= 1  ORDER BY VALUE DESC; And when you see the top CPU using process, monitor its activity through this query: SELECT nvl(ses.username,'ORACLE PROC')||' ('||ses.sid||')' USERNAME,        SID,          MACHINE,        REPLACE(SQL.SQL_TEXT,CHR(10),'') STMT,       ltrim(to_char(FLOOR(SES.LAST_CALL_ET/3600), '09')) || ':'        || ltrim(to_char(FLOOR(MOD(SES.LAST_CALL_ET, 3600)/60), '09')) || ':'