Top command in oracle

hi! i want to know about the top command used in oracle , Please if some body can send relevant information then i will be highly obliged

Past few days I am getting crazy by reading question on this form. Someone recently asked that, apart from dedicated and shared mode, there is another type of mode database available in oracle. It really drives me crazy and now, someone ask TOP.
Whoever asking question, should be more clear about his doubt. They simple ask short question and expect optimal answer. And the topic prolongs by asking what is your OS, what is your oracle version, when you are getting this error and etct. stuff.
The one who is asking question, he should first be clear in his doubts, and search or google for an answer and still he has doubt, he can express all his doubts. In this way, one can learn manything.
Jaffar

Similar Messages

  • 0% idle time of cpu states from top command in oracle 8i /solaris 5.9

    Hi,
    for long time idle time is 0% in top command :
    database version:oracle 8.1.7.4.0
    operating system : sun solaris 5.9
    load averages: 9.32, 5.78, 6.13 15:22:13
    404 processes: 387 sleeping, 13 running, 4 on cpu
    CPU states: 0.0% idle, 78.2% user, 21.8% kernel, 0.0% iowait, 0.0% swap
    Memory: 16G real, 7535M free, 5842M swap in use, 9965M swap free
    PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
    6928 oracle 11 20 0 0K 0K run 2:20 12.62% oracle
    23518 oracle 21 31 0 0K 0K run 24:37 11.69% oracle
    9664 oracle 20 30 0 0K 0K run 12:41 10.83% oracle
    15764 oracle 12 21 0 0K 0K run 2:18 10.28% oracle
    9214 oracle 19 21 0 0K 0K run 5:52 8.58% oracle
    13734 oracle 173 21 0 0K 0K cpu/3 311:23 6.11% oracle
    19271 oracle 1 59 0 0K 0K cpu/0 726:20 4.45% oracle
    10436 oracle 1 59 0 0K 0K sleep 81:41 4.39% oracle
    22400 oracle 11 59 0 0K 0K sleep 3:22 4.35% oracle
    9297 oracle 20 59 0 0K 0K cpu/2 7:39 3.66% oracle
    22175 oracle 19 59 0 0K 0K sleep 6:55 3.41% oracle
    9494 oracle 1 30 0 0K 0K run 0:02 2.99% oracle
    10719 oracle 1 59 0 0K 0K sleep 132:48 1.55% oracle
    210 oracle 1 59 0 0K 0K sleep 86:56 1.04% oracle
    22084 oracle 24 59 0 0K 0K sleep 2:50 0.92% oracle
    and sometime load average goes to 25-30 and cpu states is 0% idle in that load so how i can tune my database:
    Regards
    Prakash

    Hi,
    here 0% idle, 0% iowait
    one of the query explain plan i am posting over here:
    Operation     Object Name     Rows     Bytes     Cost     TQ     In/Out     PStart     PStop
    SELECT STATEMENT Hint=CHOOSE          77 K          11800                     
    COUNT STOPKEY                                        
    VIEW          77 K     32 M     11800                     
    SORT UNIQUE STOPKEY          77 K     10 M     8384                     
    HASH JOIN OUTER          77 K     10 M     4968                     
    HASH JOIN          77 K     9 M     4477                     
    HASH JOIN          54 K     2 M     3071                     
    TABLE ACCESS FULL     GA_INSTANCE     10      140      1                     
    HASH JOIN          75 K     2 M     3069                     
    HASH JOIN          75 K     1 M     2351                     
    INDEX FAST FULL SCAN     CUST_ACCT_ADDR_PK     75 K     960 K     282                     
    TABLE ACCESS FULL     ADDRESS     199 K     1 M     1960                     
    TABLE ACCESS FULL     CUST_ACCT     112 K     1 M     593                     
    TABLE ACCESS FULL     IQARA_CNR_ACT_LOG     89 K     6 M     1150                     
    TABLE ACCESS FULL     NI_STATIC_IP_ADDR     21 K     317 K     60                     
    Reagrds
    Prakash

  • Query on Linux 'top' command in Linux for oracle user

    This is the output of 'top' command in one of my linux server hosting One Oracle instance with 600MB SGA and 400MB PGA. One one instance is up in this server.
    top - 14:36:37 up 4:26, 3 users, load average: 0.05, 0.11, 0.28
    Tasks: 124 total, 1 running, 123 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.2% us, 0.1% sy, 0.0% ni, 66.6% id, 33.1% wa, 0.0% hi, 0.0% si
    Mem: 12299332k total, *2569836k* used, 9729496k free, 61288k buffers
    Swap: 20972816k total, 0k used, 20972816k free, 2274852k cached
    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    6345 oracle 16 0 37132 1752 1172 S 0.0 0.0 0:00.08 sshd
    6346 oracle 16 0 54004 1536 1208 S 0.0 0.0 0:00.02 bash
    6423 oracle 16 0 45376 10m 6228 S 0.0 0.1 0:00.25 tnslsnr
    6471 oracle 16 0 740m 17m 13m S 0.0 0.1 0:00.02 oracle
    6473 oracle 16 0 739m 15m 12m S 0.0 0.1 0:00.01 oracle
    6475 oracle 16 0 739m 32m 29m S 0.0 0.3 0:00.07 oracle
    6477 oracle 16 0 742m 50m 44m S 0.0 0.4 0:00.27 oracle
    6479 oracle 16 0 754m 23m 19m S 0.0 0.2 0:00.43 oracle
    6481 oracle 16 0 739m 24m 20m S 0.0 0.2 0:00.61 oracle
    6483 oracle 16 0 740m 88m 83m S 0.0 0.7 0:00.71 oracle
    6485 oracle 16 0 739m 22m 19m S 0.0 0.2 0:00.01 oracle
    6487 oracle 16 0 740m 30m 25m S 0.0 0.3 0:00.15 oracle
    6489 oracle 16 0 741m 55m 48m S 0.0 0.5 0:00.29 oracle
    6491 oracle 16 0 739m 24m 20m S 0.0 0.2 0:00.01 oracle
    6493 oracle 16 0 739m 15m 11m S 0.0 0.1 0:00.01 oracle
    6495 oracle 16 0 739m 14m 11m S 0.0 0.1 0:00.00 oracle
    6622 oracle 16 0 739m 16m 13m S 0.0 0.1 0:00.00 oracle
    6626 oracle 16 0 740m 79m 74m S 0.0 0.7 0:01.95 oracle
    6636 oracle 16 0 740m 28m 23m S 0.0 0.2 0:00.06 oracle
    6638 oracle 16 0 739m 16m 12m S 0.0 0.1 0:00.01 oracle
    6846 oracle 16 0 739m 19m 16m S 0.0 0.2 0:00.02 oracle
    6848 oracle 16 0 739m 24m 21m S 0.0 0.2 0:00.04 oracle
    6850 oracle 16 0 739m 19m 16m S 0.0 0.2 0:00.02 oracle
    6852 oracle 16 0 739m 19m 16m S 0.0 0.2 0:00.01 oracle
    6854 oracle 16 0 739m 30m 26m S 0.0 0.3 0:00.12 oracle
    6856 oracle 15 0 739m 28m 24m S 0.0 0.2 0:00.18 oracle
    6858 oracle 15 0 740m 40m 35m S 0.0 0.3 0:06.39 oracle
    6862 oracle 16 0 739m 32m 28m S 0.0 0.3 0:02.25 oracle
    6864 oracle 16 0 739m 19m 16m S 0.0 0.2 0:00.02 oracle
    6866 oracle 16 0 739m 19m 16m S 0.0 0.2 0:00.03 oracle
    6868 oracle 16 0 739m 19m 16m S 0.0 0.2 0:00.02 oracle
    7480 oracle 15 0 37264 1668 1092 S 0.0 0.0 0:00.15 sshd
    7481 oracle 15 0 54004 1528 1196 S 0.0 0.0 0:00.05 bash
    10333 oracle 16 0 739m 20m 16m S 0.0 0.2 0:00.00 oracle
    10337 oracle 15 0 6168 1080 768 R 0.0 0.0 0:00.00 top
    Total RAM as seen from top command is 12G.
    *2569836* - Total RAM which is being used currently .
    How can I see the total RAM used by all Oracle Processes running in this server. The server is Linux X86 64 Bit. Can I sum up the values under 'VIRT' column of 'top' command to see the total RAM used ?
    Is there a way to see the total RAM and CPU used by Oracle from top ?
    'VIRT' is the virtual memory - In what way is this related to the figure above, which is the physical memory (RAM) ?
    Thanks in Advance
    SSN
    Edited by: SSNair on Oct 21, 2010 2:39 AM

    Oracle used shared memory to implement the SGA, which constituted the largest memory consumption of the Oracle instance. The problem is that in many modern OS, including linux, it is hard to define the actual memory usage fo a software. This is because the memory used by a process is actually composed of shared (e.g., shared memory, shared library, executable code) and private (e.g., the heap, the stack) components. Utilities like top, ps, etc reports all memory visible by a process, disregarding whether it is shared or not. As a result, the total of VIRT etc will be inflated by the shared components. For a more accurate figure of memory usage, shared memory / library / code should be counted once.
    Before 11g, Oracle used System V ipc, and the amount of memory allocated can be checked using ipcs. In 11g, Oracle switched to /dev/shm, use df to check the memory allocation. (Thanks user11150436)
    The "Mem used" figure in top is the actual usage of the memory: shared memory and library are not multi-counted. However, Linux will always cache (read before actually requested) and buffer (write after signalling completion) disk I/O. Therefore, "Mem used" is almost always very close to the amount of physical memory. "Mem used" - "buffers" - "cached" reflects the memory actually used by the OS and all programs more accuately.
    And you can use the pmap utility to check the memory map. Then you classify the sharable and unsharable memory usage to calculate a more accurate result suiting your need. You need OS knowledge to understand the output.

  • How to find memory taken by Oracle processes using top command

    I wanted to know how to find the memory taken by Oracle processes using top command. The output of the top command is as follows as an example:
    Mem: 16436072k total, 16215708k used, 220364k free, 395128k buffers
    Swap: 25165816k total, 1168288k used, 23997528k free, 13366520k cached
    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    27281 oraprod 15 0 6705m 1.3g 1.3g S 0.0 8.6 61:44.71 oracle
    27383 oraprod 15 0 6702m 1.2g 1.2g S 0.0 7.7 2:22.75 oracle
    5199 oraprod 16 0 6745m 1.1g 1.0g S 0.0 6.8 2:51.23 oracle
    The different Oracle processes could be Oracle database, Oracle listener, Oracle enterprise manager etc.
    I hope, my question is clear as to how to find the memory taken by a process using top command.
    Please revert with the reply to my query.
    Regards

    a short and correct answer would be: you can't.
    As oracle uses a fair amount of shared memory, and that shared memory is attached to most of the oracle processes, the same memory appears a number of times.
    you should rephrase your question / what is it you want to achieve?
    you can ask oracle how much memory is assigned to it, v$sga, v$sgastat, v$process (for PGA). moreover, you as DBA are the one who configured that.
    you can look at major an minor faults per process to see what is causing the paging (if you have any).
    you can also look at the /proc/pid/statm pseudofilesystem for your oracle pids.

  • How to find the contents of proc from top command

    I had a doubt related to how to find the contents of a procedure or the statements from the PID displayed in top command if it can be done from TOAD or
    sqlplus. If we can find out the details from top like:-
    21211 oracle 16 0 3228 1012 764 R 0 0.0 0:07.68 top
    1 root 16 0 1732 552 472 S 0 0.0 0:01.29 init
    say, what is the process with PID 21211 and 1 are doing?
    I hope, my question is clear.
    Please, help in solving the doubt.
    regards

    Join v$process, v$session, and v$sql
    SQL> ed
    Zapisano file afiedt.buf
      1  SELECT p.pid, s.sid, s.serial#, sq.sql_text
      2    FROM v$session s,
      3      v$process p,
      4      v$sql sq
      5    WHERE s.paddr = p.addr
      6*   AND sq.address = s.sql_address
    SQL> /
           PID        SID    SERIAL# SQL_TEXT
            37        128          2 BEGIN EMD_NOTIFICATION.QUEUE_READY(:1, :
                                     2, :3); END;
            19        149       4566 SELECT p.pid, s.sid, s.serial#, sq.sql_t
                                     ext   FROM v$session s,     v$process p,
                                          v$sql sq   WHERE s.paddr = p.addr
                                      AND sq.address = s.sql_address
    SQL>Edited by: Łukasz Mastalerz on Feb 12, 2009 1:27 PM

  • Question on top command output in solaris

    Platform : Solaris 5.10
    In the top output, if you look at the CPU colum, you can see that one process (2415) is consuming 95.84 % of CPU, another process (28533) is consuming 91.81%. How can this happen ? If one process is consuming 95.84 , then less 5% of CPU is available to all other processes . Right?
    load averages:  4.24,  4.02,  3.89;                    up 57+10:17:11     14:36:35
    252 processes: 245 sleeping, 1 zombie, 6 on cpu
    CPU states: 40.7% idle, 46.7% user, 12.6% kernel,  0.0% iowait,  0.0% swap
    Memory: 16G phys mem, 1002M free mem, 31G swap, 31G free swap
       PID USERNAME LWP PRI NICE  SIZE   RES STATE    TIME    CPU COMMAND
      2415 oracle     1   0    0 6267M 6182M cpu     45.7H 95.84% oracle   -------- ???
    28533 oracle     2   0    0 5245M 5166M cpu     88:23 91.81% oracle   -------- ???
    12062 oracle     2   0    0 5245M 5166M cpu    194:39 82.03% oracle
      3459 oracle     1   0    0 1380K  996K cpu      9:55 73.00% gzip
      2276 oracle     2  35    0 5244M 5165M sleep    0:16 12.84% oracle
    13629 oracle     2  33    0 5244M 5165M sleep    4:51 12.44% oracle
      7784 oracle     2  32    0 5349M 5270M sleep    1:51 11.85% oracle
      5217 oracle     1 100  -20 5248M 5154M sleep   17.5H  3.05% oracle
      5225 oracle     1 100  -20 5248M 5154M sleep   17.3H  2.87% oracle
    14569 oracle     1 100  -20 6273M 6175M sleep   28.0H  1.61% oracle
    14565 oracle     1 100  -20 6271M 6173M sleep   28.8H  1.56% oracle
      1052 root      44  59    0   61M   36M sleep  319:29  1.41% crsd.bin
    15734 oracle     3   0    0   33M   12M sleep  591:32  1.11% tnslsnr
      5237 oracle     2  59    0 5275M 5181M sleep   79:47  0.51% oracle
      5235 oracle     2  59    0 5271M 5177M sleep   81:17  0.44% oracle

    I think you are right. This machine has 8 CPUs and there are 15 lines in the output . May be each line in the top result is for each core.
    Result of psrinfo showing the number of CPUs
    $ /usr/sbin/psrinfo
    0       on-line   since 04/12/2011 09:19:34
    1       on-line   since 04/12/2011 09:19:42
    2       on-line   since 04/12/2011 09:19:44
    3       on-line   since 04/12/2011 09:19:46
    4       on-line   since 04/12/2011 09:19:48
    5       on-line   since 04/12/2011 09:19:50
    6       on-line   since 04/12/2011 09:19:52
    7       on-line   since 04/12/2011 09:19:54Edited by: Tadeusz on Jun 8, 2011 8:13 AM

  • Does "top" command work in Solaris?

    Does "top" command work in solaris?
    # uname -a
    SunOS rac1 5.10 Generic_120012-14 i86pc i386 i86pc
    # top
    top: not found
    Edited by: user11936985 on Aug 29, 2011 8:44 AM

    Top has two sections, the summary information at the top of the screen which gives load averages, process counts, etc. and a bottom section which lists the "top processes". The prstat command standard report is similar to the bottom section of top. So if that is what you need, then prstat is an adequate substitute. It doesn't report the information in top's summary section. On the other hand, prstat is actually a much more powerful tool than top, especially is you use some of the other options. For example, "prstat -a" gives you the "top process" report plus a summary report of usage by user. If you use "prstat -J" you get a top process report with a summary by project and "prstat -Z" gives a top process report with a summary by zone. You can use options like -v or -m to get more information on each process in the "top process" section. There are other options mentioned in the manual page.
    Top works and works well on Solaris. You can get a copy form sunfreeware and probably other sources as well. It doesn't come from Oracle with Solaris 10 (but does come with Solaris 11). If you're a Linux shop you might want it because it is familiar. However, you may want to look at prstat as well because it can provide some useful information that top does not.

  • How do I write this SQL command in Oracle

    Hi all
    I wriote this SQ L statement in Ms SQL Server. How do I write this sql command in Oracle?
    ALTER VIEW dbo.ConsumptionAS SELECT TOP 100 PERCENT ID,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200711' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Nov2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200712' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Dec2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200801' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jan2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200802' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Feb2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200803' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Mar2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200804' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Apr2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200805' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS May2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200806' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jun2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200807' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jul2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200808' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS Aug2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200809' AND NbrDaysUsed != 0 THEN (QtyUsed NbrDaysUsed) * 748.05 ELSE 0 END)) AS Sep2008
    FROM dbo.MasterConsumption WHERE YEAR_MONTH >= '200710' AND YEAR_MONTH <= '200809' GROUP BY ID ORDER BY ID
    I am very interested in this part:
    SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007
    thanks
    Edited by: user631364 on Oct 27, 2008 8:25 AM
    Edited by: user631364 on Oct 27, 2008 8:26 AM
    Edited by: user631364 on Oct 27, 2008 8:27 AM

    Thank you!!
    Now let me aslk the second part of my question.
    This sql command:
    ALTER VIEW dbo.ConsumptionAS SELECT TOP 100 PERCENT ID,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200710' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Oct2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200711' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Nov2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200712' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Dec2007,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200801' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jan2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200802' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Feb2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200803' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Mar2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200804' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Apr2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200805' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS May2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200806' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jun2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200807' AND NbrDaysUsed != 0 THEN (QtyUsed/ Days_Usage) * 748.05 ELSE 0 END)) AS Jul2008 ,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200808' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS Aug2008,
    CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = '200809' AND NbrDaysUsed != 0 THEN (QtyUsed NbrDaysUsed) * 748.05 ELSE 0 END)) AS Sep2008
    FROM dbo.MasterConsumption WHERE YEAR_MONTH >= '200710' AND YEAR_MONTH <= '200809' GROUP BY ID ORDER BY ID
    was created with this query in SQL Server and then I saved it in a store procedure, that I scheduled to run montlhy
    SET ANSI_NULLS ON
    DECLARE @SQLString NVARCHAR(4000)
    /* Build the SQL string once.*/
    SET @SQLString = 'ALTER VIEW dbo.Consumption AS SELECT TOP 100 PERCENT ID, CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = ' +
    "'" + dbo.CONLastMonth_fn(getdate(), month(getdate()) - 12) +
    "'" +
    ' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS ' +
    dbo.CONMonthInEnglish(getdate(), month(getdate()) - 12) +
    … (GOES FROM current month -12 to current month -1)
    , CONVERT(decimal(10, 2), SUM(CASE WHEN YEAR_MONTH = ' +
    "'" + dbo.CONLastMonth_fn(getdate(), month(getdate()) - 1) +"'" +
    ' AND NbrDaysUsed != 0 THEN (QtyUsed/ NbrDaysUsed) * 748.05 ELSE 0 END)) AS ' +
    dbo.CONMonthInEnglish(getdate(), month(getdate()) - 1) +
    ' FROM dbo.MasterConsumption WHERE YEAR_MONTH >= ' +
    "'" + dbo.CONLastMonth_fn (getdate(), month(getdate())-12 ) +"'" +
    ' AND YEAR_MONTH <= ' +
    "'" + dbo.CONLastMonth_fn (getdate(), month(getdate())-1 ) +"'" +
    ' GROUP BY ID ORDER BY ID '
    EXEC sp_executesql @SQLString
    Is that something that can be done in Oracle in the same way?
    Do you use another approach?
    please advice
    Edited by: user631364 on Oct 27, 2008 10:19 AM
    Edited by: user631364 on Oct 27, 2008 10:21 AM
    Edited by: user631364 on Oct 27, 2008 10:21 AM
    Edited by: user631364 on Oct 27, 2008 10:22 AM
    Edited by: user631364 on Oct 27, 2008 10:23 AM
    Edited by: user631364 on Oct 27, 2008 10:23 AM
    Edited by: user631364 on Oct 27, 2008 10:24 AM

  • What does %cpu mean in top command

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    3166 apache 15 0 29444 6112 1524 S 6.6 2.4 0:00.79 httpdPID – process ID of the process
    in this above command my database showing %cpu% 90% for an oracle process.Please anyone can explain me what does it mean and is it critical

    Hi;
    As Aman mention, make some googling my friend. Your answer there ;)
    From googling:
    top command explained << video
    www.metacafe.com/watch/6896501/linux_top_command_explained/
    Tutorial:
    http://www.linux-masters.com/2009/09/top-command-explained.html
    http://linux.about.com/od/commands/l/blcmdl1_top.htm
    http://www.tech-faq.com/how-to-use-the-unix-top-command.html
    Regard
    Helios

  • TOP COMMAND FOR MEMORY AVALABILITY

    Hi
    My database is 10g.
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE     10.2.0.4.0     Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    I want to check the resource availability i got the info from top command
    Memory: 128G real, 6595M free, 67G swap in use, 275G swap free
    PID USERNAME LWP PRI NICE SIZE RES STATE TIME CPU COMMAND
    20745 oracle 2 44 0 0K 0K sleep 70:21 0.65% oracle
    25404 oracle 1 55 0 0K 0K sleep 2:30 0.60% oracle
    12551 oracle 2 59 0 0K 0K sleep 10:31 0.33% oracle
    16841 odiuser 1 59 0 11M 3408K cpu/51 0:02 0.06% top
    22475 oracle 1 53 2 0K 0K sleep 18:12 0.03% oracle
    13007 oracle 2 59 0 0K 0K sleep 12:30 0.03% oracle
    14879 oracle 2 59 0 0K 0K sleep 2:38 0.02% oracle
    13035 oracle 1 59 0 0K 0K sleep 6:46 0.02% oracle
    22471 oracle 2 53 2 0K 0K sleep 16:28 0.02% oracle
    13029 oracle 2 59 0 0K 0K sleep 5:30 0.02% oracle
    13000 oracle 1 59 0 0K 0K sleep 3:47 0.02% oracle
    2770 oracle 27 29 10 259M 162M sleep 2:09 0.01% java
    28056 odiuser 26 47 4 333M 189M sleep 286:00 0.01% java
    11218 oracle 2 54 0 0K 0K sleep 4:22 0.01% oracle
    17757 oracle 1 59 0 0K 0K sleep 0:00 0.01% oracle
    how to analyze the with above inforamtion whether it has enough memory or not.
    load averages: 0.79, 1.12, 1.33 06:25:09
    181 processes: 180 sleeping, 1 on cpu
    CPU states: 97.7% idle, 1.6% user, 0.7% kernel, 0.0% iowait, 0.0% swap
    can anyone analyze help me to analyze the following
    load averages
    processes
    cpu states
    Please advice.

    Your system was sitting idle for 97.7%
    NO swaaping is gioin on, for more info you can corsscheck the same with VMSTAT,IOSTAT
    for more info about top command utility
    http://linux.about.com/od/commands/l/blcmdl1top.htm_

  • TOP  command output

    Hi,
    Can anybody describe the following TOP Command output...
    ==========================================
    Tasks: 197 total, 1 running, 196 sleeping, 0 stopped, 0 zombie
    Cpu(s): 12.0% us, 0.7% sy, 0.0% ni, 71.8% id, 15.5% wa, 0.0% hi, 0.0% si
    Mem: 4147796k total, 4120904k used, 26892k free, 25708k buffers
    Swap: 8191992k total, 160k used, 8191832k free, 3624432k cached
    4615 root 16 0 54320 15m 5952 S 24 0.4 4:41.11 X
    1915 oratest 16 0 923m 620m 485m S 20 15.3 17:09.41 oracle
    1730 oratest 16 0 385m 64m 23m S 4 1.6 0:54.07 java
    1912 oratest 15 0 23516 9.9m 5368 S 1 0.2 0:36.71 sqlplus
    1726 oratest 16 0 385m 64m 23m S 1 1.6 0:03.35 java
    1913 oratest 16 0 385m 64m 23m S 1 1.6 0:13.00 java
    2135 oratest 16 0 2448 1028 760 R 1 0.0 0:00.13 top
    1887 oratest 15 0 689m 23m 21m D 0 0.6 0:20.74 oracle
    1 root 16 0 3468 592 504 S 0 0.0 0:01.06 init
    2 root RT 0 0 0 0 S 0 0.0 0:00.04 migration/0
    3 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/0
    4 root RT 0 0 0 0 S 0 0.0 0:00.03 migration/1
    5 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/1
    6 root RT 0 0 0 0 S 0 0.0 0:00.04 migration/2
    7 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/2
    8 root RT 0 0 0 0 S 0 0.0 0:00.03 migration/3
    9 root 34 19 0 0 0 S 0 0.0 0:00.00 ksoftirqd/3
    10 root 5 -10 0 0 0 S 0 0.0 0:00.00 events/0
    11 root 5 -10 0 0 0 S 0 0.0 0:00.00 events/1
    12 root 5 -10 0 0 0 S 0 0.0 0:00.00 events/2
    13 root 5 -10 0 0 0 S 0 0.0 0:00.00 events/3
    14 root 5 -10 0 0 0 S 0 0.0 0:00.00 khelper
    15 root 15 -10 0 0 0 S 0 0.0 0:00.00 kacpid
    ================================================
    Why it is showing the Memory Free is 26 MB only...
    Only one Database is running on this Machine SGA is around 600MB only.....
    Why it is showing 26 MB Free of memory ....Can anybody please describe the TOP Command output.....

    Hi, this doest look too good... " Swap: 8191992k total, 160k used"
    this means you'r using some of you'r swap, "25708k buffers" and not becouse of you'r buffers.
    try using ps -ef or top ( and sort by memory by hitting "m" ) and search for the process that uses you'r memory.

  • Using top command

    Hi
    I'm using Sun OS 5.8, using top command I have process with value 3048M in SIZE column, why ?, what is the normal value for SIZE column ?
    Why I have 11885M free in Memory ?
    Where is the 12G of memory ?
    load averages: 6.00, 6.19, 5.80 12:30:13
    877 processes: 870 sleeping, 1 running, 6 on cpu
    CPU states: 50.2% idle, 35.9% user, 6.0% kernel, 7.8% iowait, 0.0% swap
    Memory: 12G real, 1185M free, 157M swap in use, 10G swap free
    PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
    12263 apps11i 1 34 0 3048M 3030M sleep 0:28 1.62% oracle
    5302 apps11i 1 -24 0 3044M 3027M cpu/17 1:19 0.68% oracle
    5568 apps11i 1 34 0 3038M 3016M sleep 0:07 0.68% oracle
    13767 apps11i 1 -24 0 3040M 3018M sleep 0:06 0.61% oracle
    24875 oracle8 1 -24 0 0K 0K sleep 7:48 0.57% oracle
    20155 oracle8 1 34 0 0K 0K sleep 11:34 0.53% oracle
    Thanks

    There is as such no fixed value for size each process running on the system is allocated certain amount of vitrual address space in memory for its execution which is based on the algorithm "no of bits in ur processor."
    SO the memory usage what u see is perticular to that process in it's given address space in memory which would vary from process to process depending on the tasks the process handles.
    These commands give an in depth activity of ur system ,regarding the paging swaping idle process
    #vmstat
    #sar
    #iostat
    #uptime
    #ipc // usefull if ur running oracle "reports on the semaphores//
    cheers,

  • How can I use unix commands from oracle report

    I have to use the following command from oracle reports.
    In oracle forms we can use the HOST command but what about oracle reports2.5.
    I have to email the attached file 100245.pdf from oracle reports to the given email id
    uuencode 100245.pdf 100245.pdf | mailx -s "test" [email protected]

    Hi,
    It's because .bat (or .cmd) files are scripts and not executables and are interpreted using the command line executable - which is normally cmd.exe (although you can buy others).
    So you need to call cmd.exe passing the bat file name as a parameter, something like
    cmd.exe /c batchfilename
    Without the /c you will never get a response.
    However, this brings us to the bizarre conclusion that you are going to:
    call cmd.exe (a shell interpreter)
    to launch a batch file
    that calls cygwin (another shell interpreter)
    which then runs ls
    When shouldn't that just be:
    call cmd.exe to run the dir command
    Or better yet, If you are just after a file name listing and you seem to understand Java stored procs, why not just write a JSP to list the contents of a directory? No problems with OS dependant commands, scripts and 3rd party interpreters. Plenty of examples of that out on the internet as well.
    HTH
    Chris

  • How can I use custom WLST commands for Oracle SOA Suite in Weblogic

    Hi There,
    I'm trying to view and search the weblogic log files using WLST on a Solaris/Unix system.
    I have come across this "custom WLST commands for Oracle SOA Suite" and thought of using the custom logging commands to get my task done.
    However, my WLST shell is not recognizing the commands and giving me the NameError!
    wls:/devDomain1/domainRuntime> listLogs()
    Traceback (innermost last):
    File "<console>", line 1, in ?
    NameError: listLogs
    I tried the commands listLogs, displayLogs, getLogLevel & setLogLevel but in vain!
    I have followed the instructions as per the oracle recommendation of using Custom WLST commands (http://docs.oracle.com/cd/E29597_01/core.1111/e10105/getstart.htm#ASADM10692) as below
    - Launched the WLST shell from Oracle Home.
    cd ORACLE_HOME/common/bin
    ./wlst.sh
    - Tried to run the listLogs command from domainRuntime()
    I would like to know if I need to import any additional libraries to run the custom WLST commands for Oracle SOA Suite in my WLST shell?
    I have only weblogic 10.3.1 server installed on my Solaris 10 machine on which I have deployed the OSB application software.
    There is no SOA Suite installed.
    Or is there any other way I can browse the Server Log file and get the list of log messages? Basically I would like to use this feature in my script to customize it according to my requirement of listing specific error logs which I can work it out if I know how to make these commands work.
    Please advise if this is possible and how?
    Cheers.
    Satish

    I have tried on my OSB installation (no SOA Suite here), the command listLogs() works (I was in online mode, after a connect), and the classpath is:
    CLASSPATH=/opt/oracle/fmw11_1_1_5/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/oracle/fw11_1_1_5/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/usr/lib/jvm/java-1.6.0-sun-1.6.0.33.x6_64/lib/tools.jar:/opt/oracle/fmw11_1_1_5/wlserver_10.3/server/lib/weblogic_sp.jar:/opt/oracle/fmw11_1_1_5/wlserver_10./server/lib/weblogic.jar:/opt/oracle/fmw11_1_1_5/modules/features/weblogic.server.modules_10.3.5.0.jar:/opt/oracle/fmw111_1_5/wlserver_10.3/server/lib/webservices.jar:/opt/oracle/fmw11_1_1_5/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/optoracle/fmw11_1_1_5/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/opt/oracle/fmw11_1_1_5/oracle_common/moules/oracle.jrf_11.1.1/jrf-wlstman.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/lib/adfscripting.jar:/opt/oracl/fmw11_1_1_5/oracle_common/common/wlst/lib/adf-share-mbeans-wlst.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/lb/mdswlst.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/resources/auditwlst.jar:/opt/oracle/fmw11_1_1_5/oracle_cmmon/common/wlst/resources/igfwlsthelp.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/resources/jps-wlst.jar:/optoracle/fmw11_1_1_5/oracle_common/common/wlst/resources/jrf-wlst.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/reources/oamap_help.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/resources/oamAuthnProvider.jar:/opt/oracle/fmw111_1_5/oracle_common/common/wlst/resources/ossoiap_help.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/resources/osoiap.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/resources/ovdwlsthelp.jar:/opt/oracle/fmw11_1_1_5/oracle_comon/common/wlst/resources/sslconfigwlst.jar:/opt/oracle/fmw11_1_1_5/oracle_common/common/wlst/resources/wsm-wlst.jar:/optoracle/fmw11_1_1_5/utils/config/10.3/config-launch.jar::/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/derby/lib/derbynet.ar:/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/derby/lib/derbyclient.jar:/opt/oracle/fmw11_1_1_5/wlserver_10.3/common/drby/lib/derbytools.jar::
    The wlst.sh I have used is /opt/oracle/fmw11_1_1_5/osb/common/bin/wlst.sh
    I hope this can help

  • SYSTEM HANGS WHILE RUNNING EXP COMMAND IN ORACLE 10G

    WHEN WE ARE RUNNING THE EXP (EXPORT) COMMAND IN ORACLE 10G
    TO TAKE THE BACKUP IT GETS HANGED FOR A LONG TIME AND THEN IN THE LOG FILE WE FIND THE FOLLOWING ERROR MESSAGE.
    SOMETIMES AFTER RESTARTING THE SERVER WE ARE ABLE TO RUN THE EXP COMMAND.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    About to export specified users ...
    . exporting pre-schema procedural objects and actions
    . exporting foreign function library names for user MANHAR
    . exporting PUBLIC type synonyms
    . exporting private type synonyms
    . exporting object type definitions for user MANHAR
    About to export MANHAR's objects ...
    . exporting database links
    . exporting sequence numbers
    . exporting cluster definitions
    *********************************** AT THIS POINT THE SYSTEM HANGS FOR A LONG TIME.
    EXP-00056: ORACLE error 24324 encountered
    ORA-24324: service handle not initialized
    EXP-00056: ORACLE error 24324 encountered
    ORA-24324: service handle not initialized
    EXP-00000: Export terminated unsuccessfully
    THE EXP COMMAND THAT WE USE IS AS FOLLOWS:
    EXP MANHAR/MANHAR FILE=F:\BACKUP\MANHAR.DMP LOG=F:\BACKUP\MANHAR.LOG BUFFER=1000000 GRANTS=Y CONSTRAINTS=Y
    WE ARE RUNNING THE EXP COMMAND ON THE SERVER ITSELF.
    THE SERVER OPERATING SYSTEM IS WINDOWS 2003 SERVER.
    Kindly give us a solution at the earliest.

    You should ask Oracle support for help. There's only one entry for this error stack (Bug 3361288 - Export of XMLSCHEMA may fail with ORA-24324 in UTF8), but it should have been fixed for your DB version and , as far as I can see, you don't have a Unicode database.
    Werner

Maybe you are looking for