Query to find out which process consuming more cpu?

Hi All,
some one please tell me the query to find out which process is consuming more
cpu resources?
Thanks and Regards
Srikanth

Use V$SESSTAT to determine which sessions are using most CPU, and investigate what SQL these users/sessions are executing:
SQL> select ss.sid, se.command, ss.value CPU, se.username, se.program
from v$sesstat ss, v$session se
where ss.statistic# in
(select statistic#
from v$statname
where name = 'CPU used by this session')
and se.sid=ss.sid
order by ss.value desc;

Similar Messages

  • How to find top 10  SQL statments which are consuming more cpu time.

    hi all,
    Is there any command or script to monitor the top 10 sql statments which are consuming more cpu time.
    I know by using AWR REPORT we can find it, i want the command or script to find the top cpu utilization sql statments.
    Regards
    Subhash.

    Subhash,
    A quick and dirty Google search could have get you started with the following:
    Thread: how to get top CPU consuming sql oracle 10g
    Re: how to get top CPU consuming sql oracle 10g
    Oracle SQL top sessions
    http://www.dba-oracle.com/oracle10g_tuning/t_sql_top_sessions.htm
    "How to Find top 10 expensive sql's", version 9.2.0
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:73325450402303
    HTH,
    Thierry

  • Any good way to find out which process is running on which CPU, how long it

    Hi All
    any good way to find out which process is running on which CPU, how long it took, how many threads it has forked, which thread went to which CPU, etc. .
    RPS
    Message was edited by:
    RajeshPS

    Hi All
    any good way to find out which process is running on
    which CPU, how long it took, how many threads it has
    forked, which thread went to which CPU, etc. .Because the scheduler moves threads from CPU to CPU all the time, that would be a lot of information to store. I don't know any easy way to gather it.
    Under Solaris 10, you could write a dtrace script that noted every time one of the processes thread was enqueued or dequeued on a cpu and post-process that.
    That's probably the best way.
    Darren

  • Query to find out which workflow(s) use a particular message ? wf_messages

    Hi guys
    Hoping someone can help.
    I've a list of particular notfication messages, which are stored in the WF_MESSAGES_TL and WF_MESSAGES table, and I need to find out which workflows use them.
    Can anyone tell me what table I can query to find this out ?
    There's no referential integrity which I can use to find this out, and google has turned up nothing so far.
    Any ideas ?
    Thanks a lot
    Scott

    You can use this and tweak it around:
    select p.process_item_type, p.process_name, p.activity_name, a.message
    from wf_process_activities p, wf_activities a
    where p.process_item_type=a.item_type and
    p.activity_name=a.name and
    a.end_date is null;-- means the active/current activity
    Regards,
    Alejandro

  • I need to find out which processes in my labview programme are causing it to execute slowly?

    Basically, I require a program that takes readings from my apparatus every tenth of a second and writes it to my hard drive.  It starts fine but after 30 seconds or so it slows down to one reading per second.  My program is pretty lean but there must be something in there that is slowing it down.
    What can i use to to get a read-out of what processes my program is conducting and how long they take in order to find out what is cuasing delays in the execution?

    TommyP wrote:
    What can i use to to get a read-out of what processes my program is conducting and how long they take in order to find out what is cuasing delays in the execution?
    My guess is that your program does a lot of unecessary things. It would help if you could attach a simplified version of your code.
    How are you writing to the HD? (express VIs, storage VIs, lowlevel file IO, a new file with every write, appending to an existing file, etc. ? Binary file, formatted text, etc.)
    Do you keep the file open for the duration of the run or are you constanty opening and closing the file?
    How much data is in one "reading"? (bytes, kilobytes, megabytes ?)
    LabVIEW Champion . Do more with less code and in less time .

  • Query for finding out which components are in use

    Hi,
    I had a query once to check, if specific components are in use. Theres some internal view but i just can't remember. Can someone help me with this?
    EDIT: Damn it wrong board...
    Edited by: torgum on Nov 2, 2009 10:51 AM

    Key binding may vary as you switch between programs. I have some set to be "universal" but some applications manage to override those settings even though the key shortcuts in the application's menu show my programmed shortcuts.
    In your case I'd try disabling applications you suspect may potentially be effecting problems and see if you can track down which are affecting your other applications.

  • How to identify TOP 5 SQL consuming more CPU time without using statspack

    How to identify the TOP 5 SQL queries which are consuming more CPU time during the timespan of 24 hours for entire database. There are N number of users who have issued sql queries, out of which few users have disconnected and few user are still connected to the database(I need to consider all sessions). My database version is 9.0.1. I don't want to use statspack. Is there any way to identify TOP 5 SQL consuming more CPU time without affecting the performance of the database. Can any one help me on this? Its urgent!!.

    My database version is 9.0.1. I don't want
    to use statspack. Is there any way to identify TOP 5
    SQL consuming more CPU time without affecting the
    performance of the database. Can any one help me on
    this? Its urgent!!.I cant understand why you dont want to use statspack. As it is very easy to use and very quick to identify bottlenecks. Try using statspack. Its really wonderful.
    Particularly in your case statspack is the best.
    Regards,
    Sanju.

  • Syslogd Consuming more CPU utilization in Solaris 10

    Hi All,
    The Syslogd process consuming more CPU utilization in Solaris 10. Kindly help how to reduce this cpu utilization.
    Regards
    Siva

    Hi Robert,
    Both are same architecture. x86
    The following is the prstat o/p from the affected server. Pls note that one of the mount point in this server is in ZFS.
    prstat -l
    PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/LWPID
    26092 root 3933M 3930M cpu1 60 0 29:00:43 22% syslogd/56
    26092 root 3933M 3930M run 30 0 289:47:33 12% syslogd/18
    26092 root 3933M 3930M run 40 0 272:31:05 11% syslogd/22
    26092 root 3933M 3930M run 22 0 14:47:16 9.7% syslogd/65
    26092 root 3933M 3930M run 42 0 14:43:46 9.7% syslogd/63
    26092 root 3933M 3930M run 31 0 14:40:42 9.6% syslogd/66
    26092 root 3933M 3930M sleep 40 0 152:45:42 5.9% syslogd/21
    26092 root 3933M 3930M cpu0 53 0 6:41:58 4.1% syslogd/58
    26092 root 3933M 3930M run 52 0 6:23:13 4.0% syslogd/57
    26092 root 3933M 3930M sleep 43 0 6:29:21 3.9% syslogd/59
    26092 root 3933M 3930M sleep 52 0 5:55:14 3.6% syslogd/71
    More over we are continuously receiving the below error message in the /var/adm/messages, we don't know, from where the error arises from the syslog server.
    syslogd: malloc failed: dropping message from remote: Not enough space
    PRIVILEGE :[4] 'NONE'
    Edited by: Siva_Systems on Mar 29, 2010 5:06 AM
    Edited by: Siva_Systems on Mar 29, 2010 8:18 AM

  • How to find out which sub query returns more than one row

    Hi all,
    Can any one give me clue ,how to find out which sub query returns more than one row in the following query .
    /* Formatted on 2011/05/17 19:22 (Formatter Plus v4.8.8) */
    SELECT a.*, ROWNUM AS rnm
      FROM (SELECT DISTINCT '1' AS "Page View", ou.org_unit_name AS "Org",
                            prxm.mbr_idntfr AS "Beneficiary ID",
                               md.last_name
                            || ', '
                            || md.first_name AS "Beneficiary Name",
                            pci.idntfr AS "Tracking No.",
                            TO_CHAR (TRUNC (req.pa_rqst_date),
                                     'MM/dd/yyyy'
                                    ) AS "Request Date",
                            sts.status_name AS "Status",
                            req.pa_rqst_sid AS "Request #",
                            prxm.mbr_sid AS "Mbr_sid",
                            TO_CHAR
                                  (TRUNC (req.pa_revision_date),
                                   'MM/dd/yyyy'
                                  ) AS "Last Updated",
                            TO_CHAR (psd.TO_DATE, 'MM/dd/yyyy') AS "TO_DATE",
                            prxpl.prvdr_lctn_iid AS "PRVDR_LCTN_IID",
                            pd.prvdr_sid AS "PRVDR_SID", 'Y' AS "State View",
                            DECODE
                               ((SELECT DISTINCT pd.national_prvdr_idntfr
                                            FROM pa_request_x_provider_location prxplo
                                           WHERE prxplo.pa_rqst_sid =
                                                                   req.pa_rqst_sid
                                             AND prxplo.oprtnl_flag = 'A'
                                             AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                0, (SELECT prxplo.prvdr_lctn_idntfr
                                      FROM pa_request_x_provider_location prxplo
                                     WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                       AND prxplo.oprtnl_flag = 'A'
                                       AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                NULL, (SELECT prxplo.prvdr_lctn_idntfr
                                         FROM pa_request_x_provider_location prxplo
                                        WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                          AND prxplo.oprtnl_flag = 'A'
                                          AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                (SELECT DISTINCT pd.national_prvdr_idntfr
                                            FROM pa_request_x_provider_location prxplo
                                           WHERE prxplo.pa_rqst_sid =
                                                                   req.pa_rqst_sid
                                             AND prxplo.oprtnl_flag = 'A'
                                             AND prxplo.pa_prvdr_type_lkpcd = 'RR')
                               ) AS "NPI/ID",
                            DECODE
                               ((SELECT pd.org_bsns_name
                                   FROM pa_request_x_provider_location prxplo
                                  WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                    AND prxplo.oprtnl_flag = 'A'
                                    AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                NULL, (SELECT    pd.last_name
                                              || ', '
                                              || pd.first_name
                                              || ' '
                                              || pd.middle_name
                                         FROM pa_request_x_provider_location prxplo
                                        WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                          AND prxplo.oprtnl_flag = 'A'
                                          AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
                                (SELECT pd.org_bsns_name
                                   FROM pa_request_x_provider_location prxplo
                                  WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
                                    AND prxplo.oprtnl_flag = 'A'
                                    AND prxplo.pa_prvdr_type_lkpcd = 'RR')
                               ) AS "Prvdr Name",
                            TO_CHAR (psd.from_date,
                                     'MM/dd/yyyy'
                                    ) AS "Srvc From Date",
                            TO_CHAR (req.validity_start_date,
                                     'MM/DD/YYYY'
                                    ) AS "Due Date",
                            (fn_get_busniess_days (TRUNC (req.validity_start_date))
                            ) AS "Days<br>Left",
                            req.pa_mode_type_lkpcd AS "Source",
                            TO_CHAR (TRUNC (wmdtl.rtng_date),
                                     'MM/dd/yyyy'
                                    ) AS "Assigned On",
                            NVL (wmdtl.assigned_to_user_name,
                                 'Not Assigned'
                                ) AS "Assigned To",
                            req.org_unit_sid AS "OrgUnitSid",
                            TO_CHAR
                                 (wmdtl.modified_date,
                                  'MM/dd/yyyy hh24:mi:ss'
                                 ) AS "WTRD_MODIFIED_DATE",
                            TO_CHAR (wmdtl.rtng_date,
                                     'MM/dd/yyyy'
                                    ) AS "WTRD_RTNG_DATE",
                            req.status_cid AS "PA_STATUS_CID",
                            TO_CHAR (req.modified_date,
                                     'MM/dd/yyyy'
                                    ) AS "PA_REQ_MODIFIED_DATE",
                            prs.state_pa_srvc_type_code
                                                     AS "STATE_PA_SRVC_TYPE_CODE",
                            wmdtl.wm_pa_task_rtng_dtl_sid
                                                        AS "WM_TASK_RTNG_DTL_SID",
                            wmdtl.assigned_to_user_acct_sid
                                              AS "WTRD_Assigned_to_user_acct_sid",
                            (fn_get_busniess_days (TRUNC (req.validity_start_date))
                            ) AS "Days<br>LeftSort",
                            wmdtl.assigned_to_org_unit_sid
                                                  AS "WTRD_Assigned_to_OrgUntSid",
                            DECODE
                               ((SELECT COUNT (*)
                                   FROM pa_request_status prs
                                  WHERE prs.pa_rqst_sid = req.pa_rqst_sid
                                    AND prs.status_cid = 5
                                    AND prs.oprtnl_flag = 'I'),
                                0, 'N',
                                'Y'
                               ) AS "SHOW_UTILIZATION"
                       FROM   pa_request req,
                             pa_certification_identifier pci,
                             status sts,
                             pa_request_x_member prxm,
                             wm_pa_task_routing_detail wmdtl,
                             pa_service_date psd,
                             org_unit ou,
                             pa_request_service prs,
                             pa_request_x_provider_location prxpl,
                             provider_location pl,
                             provider_detail pd,
                             provider p,
                             mbr_dmgrphc md
                      WHERE req.oprtnl_flag = 'A'
                        AND req.status_cid NOT IN
                                     (20, 30, 70, 25, 80, 96, 85, 5, 97, 98, 101)
                        AND req.org_unit_sid IN
                               (3057, 3142, 3058, 3143, 3059, 3144, 3060, 3145,
                                3061, 3146, 3062, 3147, 3063, 3148, 3064, 3149,
                                3065, 3150, 3066, 3151, 3067, 3152, 3068, 3153,
                                3069, 3154, 3070, 3155, 3071, 3156, 3072, 3157,
                                3073, 3158, 3074, 3159, 3075, 3160, 3076, 3161,
                                3077, 3162, 3078, 3163, 3079, 3164, 3080, 3165,
                                3081, 3166, 3082, 3167, 3083, 3168, 3084, 3169,
                                3085, 3170, 3086, 3171, 3087, 3172, 3088, 3173,
                                3089, 3174, 3090, 3175, 3091, 3176, 3092, 3177,
                                3093, 3178, 3094, 3179, 3095, 3180, 3096, 3181,
                                3097, 3182, 3098, 3183, 3099, 3184, 3100, 3185,
                                3101, 3186, 3102, 3187, 3103, 3003, 75000104,
                                75000108, 2006, 75000103, 75000102, 75000113,
                                75000111, 75000109, 2001, 2009, 75000105,
                                75000107, 2004, 2010, 2013, 2014, 2005, 2011,
                                75000112, 2002, 1001, 2012, 75000106, 2007,
                                75000101, 2003, 75000110, 2008, 3001, 3002, 3019,
                                3104, 3020, 3105, 3021, 3106, 3022, 3107, 3023,
                                3108, 3024, 3109, 3025, 3110, 3026, 3111, 3027,
                                3112, 3028, 3113, 3029, 3114, 3030, 3115, 3031,
                                3116, 3032, 3117, 3033, 3118, 3034, 3119, 3035,
                                3120, 3036, 3121, 3037, 3122, 3038, 3123, 3039,
                                3124, 3040, 3125, 3041, 3126, 3042, 3127, 3043,
                                3128, 3044, 3129, 3045, 3130, 3046, 3131, 3047,
                                3132, 3048, 3133, 3049, 3134, 3050, 3135, 3051,
                                3136, 3052, 3137, 3053, 3138, 3054, 3139, 3055,
                                3140, 3056, 3141)
                        AND req.pa_rqst_sid = prs.pa_rqst_sid
                        AND prs.oprtnl_flag = 'A'
                        AND prs.pa_rqst_srvc_sid = psd.pa_rqst_srvc_sid
                        AND psd.oprtnl_flag = 'A'
                        AND req.pa_rqst_sid = pci.pa_rqst_sid
                        AND pci.oprtnl_flag = 'A'
                        AND req.pa_rqst_sid = prxm.pa_rqst_sid
                        AND prxm.oprtnl_flag = 'A'
                        AND md.oprtnl_flag = 'A'
                        AND md.status_cid = 2
                        AND TRUNC (SYSDATE) BETWEEN md.from_date AND md.TO_DATE
                        AND prxm.mbr_sid = md.mbr_sid
                        AND ou.org_unit_sid = req.org_unit_sid
                        AND ou.oprtnl_flag = 'A'
                        AND req.pa_rqst_sid = prxpl.pa_rqst_sid
                        AND prxm.pa_rqst_sid = prxpl.pa_rqst_sid
                        AND pci.pa_rqst_sid = prxm.pa_rqst_sid
                        AND pci.pa_rqst_sid = wmdtl.subsystem_task_sid
                        AND pci.pa_rqst_sid = prxpl.pa_rqst_sid
                        AND prxpl.pa_prvdr_type_lkpcd = 'RR'
                        AND prxpl.oprtnl_flag = 'A'
                        AND req.status_cid = sts.status_cid
                        AND sts.status_type_cid = 3
                        AND sts.oprtnl_flag = 'A'
                        AND prxpl.prvdr_lctn_iid = pl.prvdr_lctn_iid
                        AND p.prvdr_sid = pd.prvdr_sid
                        AND p.prvdr_sid = pl.prvdr_sid
                        AND pd.oprtnl_flag = 'A'
                        AND pd.status_cid = 2
                        AND TRUNC (SYSDATE) BETWEEN pd.from_date AND pd.TO_DATE
                        AND wmdtl.subsystem_task_sid = req.pa_rqst_sid
                        AND wmdtl.subsystem_lkpcd = 'PA'
                        AND wmdtl.oprtnl_flag = 'A'
                        AND req.pa_rqst_date > (SYSDATE - 365)
                                       ORDER BY TO_DATE ("Request Date", 'MM/dd/yyyy hh24:mi:ss') DESC,
                            "Beneficiary Name" ASC) a
    WHERE ROWNUM < 102;regards,
    P Prakash
    Edited by: BluShadow on 17-May-2011 15:01
    added {noformat}{noformat} tags around the code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    833560 wrote:
    Can any one give me clue ,how to find out which sub query returns more than one row in the following query .This is why smaller, simpler queries are easier to work with than huge ones - when something like this goes wrong smaller queries are much eaiser to debug. Unfortunately using smaller, easier-to-work with queries is not always an option
    Ganesh is right - you will have to dissect the big query bit by bit until you find the offending subquery. If there is another way I would like to find out about it too.
    The easiest way to do this is probably to use block comments to isolate parts of the query bit by bit until you find the offending part. If you carefully examine the subqueries you might be able to figure out which one is returning multiple rows without commenting everything
    Good luck!

  • How to find out which session is consuming the most of sga

    Hello,
    I have a server that is running out of swap space. I like to find out which oracle session is using a lot of the sga. Which data dictionary has this view? Thank you. 9208, linux 4.

    How did you configure SGA memory managment?
    How much real memory is available on the machine?
    How large did you make the SGA?
    How much PGA do you think you need?
    See Oracle version# Reference manual and start with
    v$process -- show pga per process and can be joined to v$session to identify front-end process
    v$pgastat
    v$sga
    v$sgastat
    HTH -- Mark D Powell --

  • ADF: How to find out which query has taken what time?

    Hi,
    I have an ADF application which has many SQL queried running on each button click/page load, so how to find out which query is taking what amount of time? So that i can identify the long running queries and modify them to improve the application performance.
    Thanks in advance.

    Hi,
    As suggested by Timo,you need to start tracing on oracle.jbo package for getting the SQL queries.But I think the second option suggested by him would be better.You will have to override executeQueryForCollection method in VO Impl class .Pseudo code would be
    @Override
    Take start time
    super.executeQueryForCollection
    Take end time

  • My Library has ten more songs than my iPod. How can I find out which songs are not syncing?

    My Library has ten more songs than my iPod. How can I find out which songs are not syncing?
    I recently had to purchase a new hard drive. Because the size of my music collection exceeds 140 GB, I stored all of my music on a separate external hard drive. When I exported everything back into my new iTunes library, I found that I had about 200 more songs than I had in the previous library. After deleting most of those extraneous songs, I was able to get my library close to where it was before. However, after syncing to my iPod Classic, I noticed that only 34,853 of the 34,863 loaded. How can I figure out which of those ten songs in my library did not sync to my iPod?
    Yellow12

    It may be that the 10 songs are unchecked. To find them select songs view.
    If there is a column Heading marked with a tick then click on it to sort by this column.
    If the Column is not there then View > View Options and select the Checked column which will then display
    Check the songs by putting ticks in the empty boxes and resynch. Now those tracks should go over as well

  • How do I find out which query are running??

    My client is connecting to the database and running application through the web. From the Unix system, I know his job took 99% of CPU time and running for 1 hour already. Is there anyway I can find out which query are running in the Oracle?? So I can tune this query?? thanks..

    Hi,
    You can use the following query to identify it.
    set linesize 100
    set pagesize 100
    SELECT substr(sql_text,1,40) sql,executions, rows_processed,
    rows_processed/executions "Rows/Exec",
    hash_value,address
    FROM V$SQLAREA WHERE executions > 100 AND rownum <= 10
    ORDER BY executions DESC;
    Rgds,
    Dhana

  • How can I find out which tables are having DDL locks?

    I can see related information by querying DBA_DDL_LOCKS view, but it doesn't give me the information which tables are having DDL locks.
    Is there a way I can find out which tables are having DDL locks?
    Thanks!

    Here's a long script written back in 2001. Still works:
    BREAK on sid on serial# on username
    COL sid        for 9999
    COL serial#    for 99999
    COL username   for a20
    COL type       for a20    trunc
    COL lmode      for a5     trunc
    COL lrequest   for a4     trunc
    COL detail     for a75    trunc
    SELECT   s.sid
           , s.serial#
           , s.username
           , DECODE(
                  l.TYPE
                -- Long locks
                , 'TM', 'dml/data enq (TM)'
                , 'TX', 'transac enq (TX) '
                , 'UL', 'pls usr lock (UL)'
                -- Short locks
                , 'BL', 'buf hash tbl (BL)'
                , 'CF', 'control file (CF)'
                , 'CI', 'cross inst f (CI)'
                , 'CU', 'cursor bind (CU) '
                , 'DF', 'data file (CF)   '
                , 'DL', 'direct load (DL) '
                , 'DM', 'mount/strtup (DM)'
                , 'DR', 'reco lock (DR)   '
                , 'DX', 'distrib tran (DX)'
                , 'FI', 'sga opn file (FI)'
                , 'FS', 'file set (FS)    '
                , 'IN', 'instance num (IN)'
                , 'IR', 'instce recvr (IR)'
                , 'IS', 'get state (IS)   '
                , 'IV', 'libcache inv (IV)'
                , 'JQ', 'job queue (JQ)   '
                , 'KK', 'log sw kick (KK) '
                , 'LS', 'log switch (LS)  '
                , 'MM', 'mount def (MM)   '
                , 'MR', 'media recvry (MR)'
                , 'PF', 'pwfile enq (PF)  '
                , 'PR', 'process strt (PR)'
                , 'RW', 'row wait (RW)    '
                , 'RT', 'redo thread (RT) '
                , 'SC', 'scn enq (SC)     '
                , 'SM', 'smon lock (SM)   '
                , 'SN', 'seqno instce (SN)'
                , 'SQ', 'seqno enq (SQ)   '
                , 'ST', 'space transc (ST)'
                , 'SV', 'seqno value (SV) '
                , 'TA', 'generic enq (TA) '
                , 'TD', 'dll enq (TD)     '
                , 'TE', 'extend seg (TE)  '
                , 'TS', 'temp segment (TS)'
                , 'TT', 'temp table (TT)  '
                , 'UN', 'user name (UN)   '
                , 'WL', 'write redo (WL)  '
                , 'TYPE = ' || l.TYPE) AS type
           , DECODE(l.lmode, 0, 'none', 1, 'null', 2, 'RS', 3, 'RX', 4, 'S', 5, 'SRX', 6, 'X', TO_CHAR(l.lmode)) A
    S lmode
           , DECODE(l.request, 0, 'none', 1, 'null', 2, 'RS', 3, 'RX', 4, 'S', 5, 'SRX', 6, 'X', TO_CHAR(l.request
    )) AS lrequest
           , DECODE(
                  l.TYPE
                , 'JQ', 'Job #' || j.job || ' (' || j.what || ') owned by: ' || j.username
                , 'MR', DECODE(s.user_type, 'BG', 'DICTIONARY OBJECT', LOWER(obj.owner) || '.' || LOWER(obj.name))
    || ' (' || LOWER(obj.TYPE) || ')'
                , 'RT', 'thread #' || LOWER(l.id1)
                , 'RW', 'file#' || LOWER(SUBSTR(l.id1, 1, 3)) || ', block#' || LOWER(SUBSTR(l.id1, 4, 5)) || ', ro
    w#' || LOWER(l.id2)
                , 'TD', 'object: ' || LOWER(obj.owner) || '.' || LOWER(obj.name) || ' (' || LOWER(obj.TYPE) || ')'
                , 'TM', 'object: ' || LOWER(obj.owner) || '.' || LOWER(obj.name) || ' (' || LOWER(obj.TYPE) || ')'
                , 'TS', DECODE(l.id2, 0, 'enqueue', 'new block allocation')
                , 'TX', DECODE(
                             lo.object_name
                           , NULL, 'rbs #' || TRUNC(l.id1 / 65536) || ', slot #' || LOWER(l.id1)
                           , 'rbs #' || TRUNC(l.id1 / 65536) || ', slot #' || LOWER(l.id1) || ', object: ' || LOWE
    R(lo.object_name))
                , 'UL', 'lock name: ' || la.name || ', expiration date: ' || TO_CHAR(la.expiration, 'DD-MON-RR HH2
    4:MI:SS')
                , 'WL', 'redo log file#' || LOWER(l.id1)
                , 'id1 = ' || l.id1 || ', id2 = ' || l.id2) AS detail
        FROM sys.v_$lock l
           , (SELECT a.sid
                   , a.serial#
                   , NVL(a.username, 'SYS (' || LOWER(b.name) || ')') AS username
                   , DECODE(a.username, NULL, 'BG', 'USER') AS user_type
                FROM sys.v_$session a
                   , sys.v_$bgprocess b
               WHERE a.paddr = b.paddr(+)) s
           , (SELECT o.obj#
                   , u.name AS owner
                   , o.name
                   , DECODE(
                          o.type#
                        , 0, 'NEXT OBJECT'
                        , 1, 'INDEX'
                        , 2, 'TABLE'
                        , 3, 'CLUSTER'
                        , 4, 'VIEW'
                        , 5, 'SYNONYM'
                        , 6, 'SEQUENCE'
                        , 7, 'PROCEDURE'
                        , 8, 'FUNCTION'
                        , 9, 'PACKAGE'
                        , 11, 'PACKAGE BODY'
                        , 12, 'TRIGGER'
                        , 13, 'TYPE'
                        , 14, 'TYPE BODY'
                        , 19, 'TABLE PARTITION'
                        , 20, 'INDEX PARTITION'
                        , 22, 'LIBRARY'
                        , 23, 'DIRECTORY'
                        , 24, 'QUEUE'
                        , 28, 'JAVA SOURCE'
                        , 29, 'JAVA CLASS'
                        , 30, 'JAVA RESOURCE'
                        , 32, 'INDEXTYPE'
                        , 33, 'OPERATOR'
                        , 34, 'TABLE SUBPARTITION'
                        , 35, 'INDEX SUBPARTITION'
                        , 39, 'LOB PARTITION'
                        , 40, 'LOB SUBPARTITION'
                        , 43, 'DIMENSION'
                        , 44, 'CONTEXT'
                        , 47, 'RESOURCE PLAN'
                        , 48, 'CONSUMER GROUP'
                        , 51, 'SUBSCRIPTION'
                        , 52, 'LOCATION'
                        , 'UNDEFINED') AS type
                FROM sys.obj$ o
                   , sys.user$ u
               WHERE o.owner# = u.user#) obj
           , (SELECT vlo.xidusn
                   , vlo.xidslot
                   , vlo.xidsqn
                   , vlo.process
                   , o.owner || '.' || o.object_name AS object_name
                FROM sys.v_$locked_object vlo
                   , sys.dba_objects o
               WHERE vlo.object_id = o.object_id) lo
           , (SELECT job
                   , schema_user AS username
                   , what
                FROM dba_jobs) j
           , sys.dbms_lock_allocated la
       WHERE l.sid = s.sid
         AND l.id1 = obj.obj#(+)
         AND l.id2 = j.job(+)
         AND TRUNC(l.id1 / 65536) = lo.xidusn(+)
         AND LOWER(l.id1) = lo.xidslot(+)
         AND l.id2 = lo.xidsqn(+)
         AND l.id1 = la.lockid(+)
         AND l.TYPE != 'MR'
    UNION ALL
                      /*** LATCH HOLDERS ***/
    SELECT   s.sid
           , s.serial#
           , s.username
           , 'latch'
           , 'X'
           , 'none'
           , h.name || ' addr=' || LOWER(RAWTOHEX(laddr)) AS object
        FROM sys.v_$process p
           , sys.v_$session s
           , sys.v_$latchholder h
       WHERE h.pid = p.pid
         AND p.addr = s.paddr
    UNION ALL
                      /*** LATCH WAITERS ***/
    SELECT   s.sid
           , s.serial#
           , s.username
           , 'latch'
           , 'none'
           , 'X'
           , name || ' latch=' || p.latchwait AS object
        FROM sys.v_$session s
           , sys.v_$process p
           , sys.v_$latch l
       WHERE latchwait IS NOT NULL
         AND p.addr = s.paddr
         AND p.latchwait = l.addr
    ORDER BY sid
           , serial#
           , username
           , 4
           , 5
           , 6
           , 7;

  • How to find out which URL Category (many) URLs belong to - via script

    Hi,
    It's about AsyncOS7.5 on WSA S360.
    After implementing URL Filtering I have following problem:
    If I'd like to access amazon.de for example, there are plenty of other Web Pages  referenced too.
    Some of them belong to allowed URL Categories and others to forbiden ones which makes the visited URL
    not show up properly.
    Since some times there are about 15 URLs affected I don't like to test each of them with the Policy Tracer
    in order to find out which ones are allowed and care for the others.
    Instead I thought of using a command or a script with a list of  URLs  for a much faster solution.
    Is there any such posibility?
    Thanks
    Jannis

    Hi Jannis,
    If you only would like to find the category of multiple URLs in one go so you can then compare to your policy (so you know which one is allowed and which one is blocked), you can use this portal (Cisco CCO ID is required to log in).
    https://securityhub.cisco.com/web/submit_urls
    Under Lookup or Submit URLs tab you can enter multiple URLs  and select the AsyncOS version to get their categorizations.
    On the scripting side, maybe it can be done outside the WSA so your client will send the request of the multiple URLs to the WSA and WSA returns their categories (with block page or response from WSA).
    Perhaps a scripting master here can add more information to your query.
    Thanks,
    Donny

Maybe you are looking for