SQL Dev 2.1 - Session browser Active SQL showing duplicate queries

Haven't noticed this before in any other version but then hadn't realy been looking but when i use the session browser to check code running on the DB in the ACTIVE SQL tab i ocassionally see duplicate sql statments, which can be misleading, see below for an example.
SELECT SUM(AID.AMOUNT),
DECODE(APS.PAYMENT_STATUS_FLAG,'Y','Paid','P','Partially Paid','Not Paid')
FROM PO_LINE_LOCATIONS_ALL PLL,
PO_DISTRIBUTIONS_ALL PDA,
AP_INVOICE_DISTRIBUTIONS_ALL AID,
AP_INVOICES_ALL AIA,
AP_PAYMENT_SCHEDULES_ALL APS
WHERE PLL.PO_LINE_ID = :B1
AND PLL.LINE_LOCATION_ID = PDA.LINE_LOCATION_ID
AND PDA.PO_DISTRIBUTION_ID = AID.PO_DISTRIBUTION_ID
AND AIA.INVOICE_ID = AID.INVOICE_ID
AND APS.INVOICE_ID = AIA.INVOICE_ID
AND AIA.CANCELLED_BY IS NULL
GROUP BY DECODE(APS.PAYMENT_STATUS_FLAG,'Y','Paid','P','Partially Paid','Not Paid')
SELECT SUM(AID.AMOUNT),
DECODE(APS.PAYMENT_STATUS_FLAG,'Y','Paid','P','Partially Paid','Not Paid')
FROM PO_LINE_LOCATIONS_ALL PLL,
PO_DISTRIBUTIONS_ALL PDA,
AP_INVOICE_DISTRIBUTIONS_ALL AID,
AP_INVOICES_ALL AIA,
AP_PAYMENT_SCHEDULES_ALL APS
WHERE PLL.PO_LINE_ID = :B1
AND PLL.LINE_LOCATION_ID = PDA.LINE_LOCATION_ID
AND PDA.PO_DISTRIBUTION_ID = AID.PO_DISTRIBUTION_ID
AND AIA.INVOICE_ID = AID.INVOICE_ID
AND APS.INVOICE_ID = AIA.INVOICE_ID
AND AIA.CANCELLED_BY IS NULL
GROUP BY DECODE(APS.PAYMENT_STATUS_FLAG,'Y','Paid','P','Partially Paid','Not Paid')
SELECT SUM(AID.AMOUNT),
DECODE(APS.PAYMENT_STATUS_FLAG,'Y','Paid','P','Partially Paid','Not Paid')
FROM PO_LINE_LOCATIONS_ALL PLL,
PO_DISTRIBUTIONS_ALL PDA,
AP_INVOICE_DISTRIBUTIONS_ALL AID,
AP_INVOICES_ALL AIA,
AP_PAYMENT_SCHEDULES_ALL APS
WHERE PLL.PO_LINE_ID = :B1
AND PLL.LINE_LOCATION_ID = PDA.LINE_LOCATION_ID
AND PDA.PO_DISTRIBUTION_ID = AID.PO_DISTRIBUTION_ID
AND AIA.INVOICE_ID = AID.INVOICE_ID
AND APS.INVOICE_ID = AIA.INVOICE_ID
AND AIA.CANCELLED_BY IS NULL
GROUP BY DECODE(APS.PAYMENT_STATUS_FLAG,'Y','Paid','P','Partially Paid','Not Paid')
The reason seems to be that the Session Browser query:
SELECT REPLACE(q.sql_text,chr(0)) sql_text
FROM v$session s,
v$sql q
WHERE s.sql_address = q.address
AND s.sql_hash_value = q.hash_value
AND s.sid = :SID
is picking up all the different child number queries from v$sql, is there anyway to only pick up the child that you are using to avoid the strange query output?
Thanks in advance
Trotty

Hello All;
The front end is Oracle Forms/ Reports 6i Patch 16.
I will try TKprof.
I found here someone asking on the same case,
Database is too slow.....
He was advices to 1- Compute Statistics 2- reorganize tables 3- re-build indexes
I done it in the order a-Import Tables b-Rebuild indexes c-Compute Statistics.
Shall I do it in order 1 2 3 ? or 1 & 3 will be ok?
Can I issue
sql> Alter table <name> move tablespace <tablespace_name>;
on the original tablespace or I need to provide new tablespace?
Best Regards,
Naji Ghanim

Similar Messages

  • SQL Dev 2.1 connected to a SQL Server query

    I use SQL developer to query oracle db's and from the Query result, if i right click i get the following options;
    Save grid as report...
    Single record view...
    Count Rows...
    Find/Highlight...
    Export Data
    However when i do this against an SQL server I only get teh following;
    Save grid as report...-this is grayed out and can not be used.
    Single record view...
    Count Rows...
    Find/Highlight...
    I do not get the export option, does anyone know why? or what I can do to get it?

    With SQL Developer 2.1.0 the export feature was removed for all not oracle database.
    In 2.1.1 the export feature is working again so if you need to export on SQL server you should upgrade to 2.1.1.

  • Can SQL Dev compare difference of 2 sql scripts?

    I need to compare structure of table that has changed by someone but I don't know which table has been modified. I found that SQL Dev can export meta data into sql file and have version control either. I'm not sure can we compare this 2 sql scripts with version control to detect some change in table structure or not?
    Or if has any others solution, Please help.
    Regards,
    Sutthisak S.

    If you open the script in sqldev, you get a History tab next to the Worksheet. Selecting a revision will compare against that.
    To compare against another file, select File - Compare With - Other File.
    If the internal compare doesn't convince you, there are free alternatives out there, like WinMerge, or my personal favourite (but commercial) Beyond Compare.
    Have fun,
    K.

  • SQL Developer Session Browser?

    Does SQL Developer have any counterpart of TOAD's Session Browser (to see who else is hitting the database and with what queries)?

    Thanks to both of you! This forum rocks! I am in the process of putting together a recommendation that we move from TOAD to SQL Developer; and tracking down some of the most-loved TOAD features in SQL Developer is sometimes difficult for a newbie like myself.
    Again, many thanks!
    Dave

  • V4.0.0.13 Active SQL Tab in Sessions

    I select a session and in the display for Active SQL I get sql that has nothing to do with my session nor my OS_USER

    What SQL do you get?

  • Explain plan for SQL running in a session

    Hi. Can you get the explain plan information for sql that's currently running in a session? I know I can use the session report to see the active SQL, but I don't know if it's possible to get the explain plan information from there, like you can with TOAD's session manager.

    I've put together a query for the v$sql_plan in 9iR2.
    Depending on what you use, you can probably drop some columns (eg OTHER and partition columns) and you could drive it from the v$session by getting the hash_value from there for the sid you are interested in :
    (select * from v$sql_plan where hash_value =
    (select sql_hash_value from v$session where sid=:sid))
    select level, optimizer, lpad('_',1*(level-1),'_')||operation operation,
    options, object_owner||'.'||object_name obj_name, search_columns,
    ltrim(to_char(cardinality,'999,999,999')) no_rows,
    ltrim(to_char(bytes/1024,'999,999')) kbytes, cost tot_cost,
    object_node link, id, parent_id, other_tag||':'||other other,
    partition_start, partition_stop, cpu_cost, io_cost,
    access_predicates, filter_predicates,
    round(temp_space/(1024*1024),2) temp_space_mb
    from (select * from v$sql_plan where hash_value = :hash_val)
    start with id=0
    connect by prior id = parent_id and prior child_number = child_number
    order by child_number, id, position;

  • Allow Custom Font Settings on SQL Dev

    Hi,
    Well this is just simply a polite bump on my request.
    I had posted on the forum about setting font on various SQL Dev component more that two years ago.
    2.1.1 UI : Inconsistency Fonts setting on SQL Dev
    And put on Exchange here :
    https://apex.oracle.com/pls/apex/f?p=43135:7:242850196580001::NO:RP,7:P7_ID:23701
    Well, to be honest, it seems although each released of SQL Dev introduced new feature, many of the users requested features on Exchange are simply neglected.
    Quite sad though, as the Exchange should be considered as the main customers wish to see on the next version.
    I just curious to know which any of the top 20 of the request marked as implemented on this SQL Dev 3.2?
    Even for this request status is Open for more than two years, and not even a single comment from the team.
    Perhaps they don't even care to read the Exchange though.
    And this new 3.2 coming out without early adopter release as it used to be.
    Well, for the bugs (or missed bugs) I've seen from some of the posts here, would simply have to wait another 6 months from now.
    What a waste....
    What I've seen is this long cycle issue has caused lots of retiring 'used-to-be-active' users.
    To put on weight for my request,
    Isn't it funny that you cannot distinguish the query result grid between 'Oracle' and '0racle' from this 0racle's tool (or was it Oracle's)?
    Regards,
    Buntoro

    Hi,
    In User Interface perspective, mostly stands for, What You See Is What You Get (WYSIWYG).
    Maybe that's what Sven's referring to, and that's one of the reason I started this thread.
    Let's just wait for the team to decide the broad range of Font settings which are customizable, perhaps including Edit dialog as one of the customizable. And let the forums to give their opinion.
    Regards,
    Buntoro

  • SQL Dev 1.5.3 Data Grid showing incorrect data

    After upgrading to SQL Dev 1.5.3, I have seen instances of incorrect data displayed in the data grid (when displaying many records at a time), both in the Table Browser and in SQL Worksheet.
    For example, in the grid, it shows a value 1234 for a column. Now when I query just that row, the correct results are shown.
    Has anyone noticed this?
    Thanks,
    Manish

    Any updates on this? I am hitting this bug and it makes life very uncomfortable as I cannot trust the results.
    SQL Developer 1.5.3 + JDK 1.6.11 on Windows XP.

  • Script to find the currently active sql

    hey,
    Can somebody post me a script to find the currently active sql in the database ???

    Hi,
    You can try these below:
    select s.username
           c1,t.sql_text
    from v$session s, v$sqltext t
    where
    s.sql_address = t.address and
    s.sql_hash_value = t.hash_value and
    s.username is not null
    order by s.username,s.prev_sql_addr,s.prev_hash_value,t.piece;
    or
    select sesion.sid,
           sesion.serial#,
           sesion.username,
           sesion.sql_id,
           sesion.sql_child_number,
           optimizer_mode,
           hash_value,
           address,
           sql_text
      from v$sqlarea sqlarea, v$session sesion
    where sesion.sql_hash_value = sqlarea.hash_value
       and sesion.sql_address    = sqlarea.address
       and sesion.username is not nullCheers

  • Is there a way to create SQL Dev reports with validated binds?

    Is there a way to create SQL Dev reports with validated binds similar to the way user defined extensions can have <prompts> with a <value> that is a SQL statement returning a list of possible values?
    This sure would make select appropriate values for binds in reports easier and less error prone.

    Maybe a forum search on "Windows registry" would turn up some useful things. You're not the first to ask this. You might save yourself and everyone else some time if you'd simply do that.

  • How to get the process id of a sql statement or a session  ....

    How to get the process id of a sql statement or a session . ..?
    Thanks

    What about this?
    SELECT pid
      FROM v$session s, v$process p
    WHERE p.addr = s.paddr
       AND s.sid = :sid;   -- replace :sid with your session idRegards.
    Al

  • Export arabic character into csv file turns into question mark in sql dev

    Hi,
    I am trying to export a table's output that contains some arabic and english mixed data, when I try to export it in csv, all the arabic characters change into question mark (?) but the same export is working fine on .xls or .xlsx.
    Since we have to export a huge data and csv is much faster thar .xls, kindly let me know why it is happening and what is the solution for this.
    Well, we are on Oracle 11gR2 and Sql Dev is 3.1
    Appreciate your time and experience sharing.
    Regards.

    Hi,
    Since you say it works for xls but not csv, and the only applicable preference setting ( Tools|Preferences|Database|Utilities|Export|Encoding ) should apply to all export formats, I would imagine this is a bug. Especially if the encoding specified in Preferences is consistent with the client OS settings. I was not able to find any prior bug logged against the Export utility for this issue.
    I logged a bug for this:
    Bug 13993410 - FORUM: ARABIC CHARACTER ENCODING RESPECTED FOR XLS BUT NOT CSV
    Regards,
    Gary
    SQL Developer Team

  • SQL Dev converts MS SQL to Oracle - issue with numeric prefix column name

    Hi,
    We're working on migrating MS SQL data into Oracle 10g. An issue we encountered is that some of MS SQL's tables have column names with numeric prefix like 1Q07, 2Q07, ..., 4Q08, and so on. The converted model as well as script can be created. But one thing I notice is that SQL Dev appends a prefix "A" for column names with numeric prefix. This makes sense because Oracle does not allow a column with number. But somehow this does not work with only 4Q
    1Q04 => A1Q01
    2Q07 => A2Q07
    3Q08 => A3Q08
    4Q08 => 4Q08 ???
    Why? Any place in the tool where I can override this?
    Obviously I can manually modify column name 4Q08 to A4Q08 in the script. But by doing this when moving data, it would fail because tool has no knowledge of updated column name.
    Thanks in advance.

    Hi ittichai,
    In <repository>.MIGRATION_TRANSFORMER body
    FUNCTION first_char_check(p_work NVARCHAR2) RETURN NVARCHAR2
    v_allowed := C_DISALLOWED_CHARS || '012356789_$';
    should be
    v_allowed := C_DISALLOWED_CHARS || '0123456789_$';
    If you make this change and convert the 4Q08 will be
    A4Q08 is expected, without any manual rename.
    -Turloch
    Message was edited by:
    Turloch O'Tierney

  • How to set SQL trace in OCI session ?

    Hello,
    In a SQL*Plus session, I can use the SQL statement "alter session set sql_trace=true;" to set SQL trace in that session only. I assume I could execute the same SQL statement from C code in an OCI client and achieve the same goal.
    However, if I cannot change the code of this OCI client, is there a way to set SQL trace for that single session alone, without changing the C code? Say, through an environment variable, configuration file, etc.?
    Thanks.

    I am not aware of a way to selectively enable the server-side tracing without modifying the client code.
    There is client tracing available by setting the environment variable EVENT_10842 as follows:
    "server=<>;user=<>;stmt=<>;level=<>;interval=<>"
    e.g.
    setenv EVENT_10842 "server=inst1,inst2;user=scott,system;stmt=all;level=15"
    Where:
    "server" is a comma separated list or "all"
    "user" is a comma separated list or "all"
    "stmt" can be INSERT,UPDATE,DELETE,SELECT or "all"
    The following levels are supported:
    1 - Trace all server attach and server detach calls for servers listed in "server" attribute of the environment variable.
    2 - Trace all session begin, logon, session end, logoff calls for the users listed in "user" attribute of the environment variable.
    3 - Trace all prepare, execute, fetch calls for the specified statement types listed in "stmt" attribute of environment variable.
    4 - Trace all Bind, Define, Describe calls.
    5 - Trace all OCI LOB calls
    7 - Get statistical info on all connection pooling /connection related calls
    8 - Get statistical info on all session info
    9 - Get statistical info on all handle info
    10 - Get statistical info on time taken in execute and fetch calls
    11 - Get statistical info on transaction related calls
    15 - Trace all calls with statistical info.

  • SQL Dev 2.1:Ability to save and load visual query models?

    At SQL Dev 2.1, do we now have the ability to save and load visual query models as with TOAD? Or has that functionality been rolled into the for-pay Data Modeler extension? Seemed strange to hide the functionality deep within SQL Worksheet, then not allow query models to be saved or loaded. From what I recall, load/save was scheduled to be in 2.0.
    I've not yet downloaded and installed 2.1, but also as I recall, it was promised to be a significant (e.g. new-feature rich) release. Has it lived up to that promise? Hoping also that it's not so buggy as to not merit an upgrade. At my workplace, folks have different versions of SQL Dev 1.X installed, each for the purpose of retaining functionality that got broken in future releases, etc. Would love to be able to advise them to retire their 1.X installs in favor of 2.1.
    Edited by: Dana N on Jan 21, 2010 6:45 AM

    Dana, We are working on the query builder. We have not done anything with it in recent releases as we knew that it needed completely overhauled and a
    couple of bug fixes were not going to give us the query builder we needed. Sue will be able to tell you more as the we get closer to releasing it as a feature.Thanks Barry. I know it's probably impossible to give firm dates, but my colleagues would love to know, ballpark, when query builder might be ready. Any particular year/quarter that's targeted for?
    A lot of the bugs in the 2.1 are probably my fault as we decided to build a framework which allowed tasks to be scheduled like eclipse and push them to the
    background. Coupled with this, we tore apart the worksheet to allow us to fit tasks in, but to also give us the ability to do some of the enhancement requests
    that you guys, our users, have been asking for. While its not perfect, I believe its getting much better from both a functionality and performance standpoint. The
    worksheet will not change again and there are no enhancements logged or scheduled which will do that. The issues that have come as part of 2.1 are being
    addressed and we are fixing the highest priority ones as we speak. One of my priorities is to make these components as rock solid as possible.Thanks again. It really is a nice tool to work with, and I'm grateful to have it. I would choose stability for existing features over new ones, but I suppose there always has to be a balance in development. What was really scary in the past was getting bizarre / wrong answers in query results--that's a complete show stopper; e.g. clicking on a row/col intersection in a result set row would show strange and false values. New features can wait, but core functionality must be solid. If one can't presume integrity of query results, it's game over--using a version of SQL Developer that returns inconsistent result sets between runs could be Considered Harmful, or so it is to me.
    Anyway, thanks for responding and I hope Oracle Corp gets you whatever assistance you need to improve the quality of existing functionality while adding new features; with one not being at the expense of the other. :-) Glad also to see Sue has authored a book on the tool. Hopefully that will drive customer demand and force increased allocation of development resources toward the product. I'd like to think having out-of-the-box tools that are a joy to use might even increase market share.
    Data Modeler I would love to use, but am completely priced out of it. Enterprise Architect from Sparx Systems is the best value there so far as I can tell.
    Dana

Maybe you are looking for

  • Problem opening file in application server received by FTP.

    Hi, I am using FTP_COPY to receive file in application server. I am receiving file from FTP but I am unable to open them because the mode was set as 640 as in attributes. Could you please help me in how to receive in readable format... Any suggestion

  • Where can I get a list of top downloaded songs with the number of downloads?

    Also interested in finding a list of the top 100 downloaded podcasts with data, such as subscribers or downloads.

  • Using FB 4.7 Premium cannot run unit tests

    I have a licensed version of 4.7 Premium but cannot run unit tests. The message I get says "This feature requires a Flash Builder Premium License". I have uninstalled Fb 4.7 and then downloaded and reinstalled. Still the same issue. I have verified I

  • Pro please help!!! high lvl problem(russian language)

    Добрый День. Попробую подробно описать проблему на русском. 30.12.13 моя супруга подарила мне iPhone 5s, примерно в марте следующего года стала выскакивать табличка об авторизации в iCloud. Я перепробовал несколько вариантов, пароли не подошли и с то

  • Taking Backup

    Hi, I want to take backup of server database in client place. What are the methods to follow and what are the steps to do. Can anyone solve the problem. I am using Oracle 10g, WindowsXP, 1 GB RAM in Server and Oracle 10g, WindowsXP, 512 GB RAM in Cli