Different output for the same query in SQL Server and Oracle

I have two tables table1 and table2

-table1 has two columns c1 int and varchar c2. There are no constraints added in it. It contains data as shown below

C1 c2
-------------------
d 6
5 d
102 g
6%
f 103
5.
501 j
1 g
601 n
2 m

-table2 has only a single column c1 int. There is no added in constraints. It contains data as shown below

C1
----
6
1
4
3
2

now when I run below, given the query in sql server and oracle it gives me different results

Select *.
FROM table1
table2 on table2.c1 = table1.c1 inner join (SELECT ROW_NUMBER() (any ORDER by ASC c1) AS c1 from table2)

output of SQL server
------------------------
C1 c2 c1
--------------------------------
1 g 1
2 m 2
3 h 3
4 g 4
5 d 5


release of Oracle
----------------------
C1 C2 C1
---------------------------------
5 d 5
4 g 4
3 h 3
1 g 1
2 m 2


If you notice the first column in the two outputs. It is sorted in sql server and no oracle.

Why he behaves differently in oracle? Is there a way I can fix this problem in oracle?

Thank you
Jigs

It is NOT a behavior "differently" in Oracle; you did not specify just an order that you expect of your results, so you'll get output in what order the fantasies of the database showing (ie. no guaranteed order). It is an artifact of the way the database chooses to collect the data and databases (or same sets of data within the same database) can and will most likely behave differently.

Same SQL Server will not be guaranteed to always get your data in an orderly manner if you exclude the order by clause, even if you think that there always display the data in an orderly manner.

Your solution is to add an order by clause, in the TWO databases, to force the order of the data output.

Tags: Database

Similar Questions

  • Why I have two different execution plans for the same query on two different servers

    Hello everyone.

    I need your help to solve the problem quickly.

    In a nutshell, we have two servers that have the same version of Oracle RDBMS (11.2.0.4 EE). One of them for purposes of development and another is a production one.

    We have therefore two different execution plans for the same query executed on both servers. The only case of execution is OK and another is too slow.

    So I have to slow down the work of query using the same scheme to explain that young.

    Fence wire.

  • explain plan for the same query diff

    Hi experts,

    Please, help me understand explain the plan.  I have tow Server (server and two server). The server are same table, even the type of database, even version Oracle (gr 11 (2), same operating system (linux Redhat 5.5) and same table and index.

    but when I explain the plan for the same query on the two server. I got diff--diff to explain the plan. reason it has different, according to my understanding, it should be same. explain please, I share the explain plan and lower indices for the two server.

    Server a

    SQL > col COLUMN_NAME format a20

    SQL > select index_name, column_name, position_colonne from user_ind_columns where table_name = 'LOAN_RUNNING_DETAILS_SOUTH"of order 1.

    INDEX_NAME COLUMN_NAME POSITION_COLONNE

    ------------------------------ -------------------- ---------------

    DATE_IND1_S LOANDATETIME 1

    IND_MSI_LN_LNS1_S MSISDN 1

    IND_MSI_LN_LNS1_S LOANDATETIME 2

    IND_MSI_LN_LNS1_S LOANSTATUS 3

    LAST_INDEX L_INDX_MSISDN_S 1

    MSISDN L_INDX_MSISDN_S 2

    SQL > select decode (status, 'N/a', 'Part Hdr', 'Global') ind_type, index_name, NULL nom_partition, status

    2 from user_indexes where table_name = 'LOAN_RUNNING_DETAILS_SOUTH '.

    3 union

    4. Select 'Local' ind_type, index_name, nom_partition, status

    5 to user_ind_partitions where index-name in (select index_name in user_indexes where table_name = 'LOAN_RUNNING_DETAILS_SOUTH')

    6 order of 1,2,3;

    IND_TYPE INDEX_NAME NOM_PARTITION STATUS

    -------- ------------------------------ ------------------------------ --------

    Global DATE_IND1_S VALID

    Global IND_MSI_LN_LNS1_S VALID

    Global L_INDX_MSISDN_S VALID

    SQL > explain plan for the small circle of MSISDN, TID, of LOAN_RUNNING_DETAILS_SOUTH where LOANDATETIME < = sysdate-2 and LOANDATETIME > sysdate-15 and LOANTYPE = 1;

    He explained.

    SQL > SQL > set line 200

    @?/rdbms/admin/utlxpls.sql

    SQL >

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Hash value of plan: 3659874059

    ------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                       | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

    ------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                            |  1448K |    58 M | 21973 (2) | 00:04:24 |       |       |

    |*  1 |  FILTER |                            |       |       |            |          |       |       |

    |   2.   PARTITION LIST ALL |                            |  1448K |    58 M | 21973 (2) | 00:04:24 |     1.    11.

    |*  3 |    TABLE ACCESS FULL | LOAN_RUNNING_DETAILS_SOUTH |  1448K |    58 M | 21973 (2) | 00:04:24 |     1.    11.

    ------------------------------------------------------------------------------------------------------------------

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - filter(SYSDATE@!-2>SYSDATE@!-15)

    3 - filter("LOANTYPE"=1 AND "LOANDATETIME">SYSDATE@!-15 AND "LOANDATETIME"<=SYSDATE@!-2)

    16 selected lines.

    Second server

    SQL > select index_name, column_name, position_colonne from user_ind_columns where table_name = 'LOAN_RUNNING_DETAILS_SOUTH"of order 1.

    INDEX_NAME COLUMN_NAME POSITION_COLONNE

    ------------------------------ -------------------- ---------------

    DATE_IND1_S LOANDATETIME 1

    IND_MSI_LN_LNS1_S MSISDN 1

    IND_MSI_LN_LNS1_S LOANDATETIME 2

    IND_MSI_LN_LNS1_S LOANSTATUS 3

    LAST_INDEX L_INDX_MSISDN_S 1

    MSISDN L_INDX_MSISDN_S 2

    SQL > select decode (status, 'N/a', 'Part Hdr', 'Global') ind_type, index_name, NULL nom_partition, status

    2 from user_indexes where table_name = 'LOAN_RUNNING_DETAILS_SOUTH '.

    Union

    3 4 Select 'Local' ind_type, index_name, nom_partition, status

    5 to user_ind_partitions where index-name in (select index_name in user_indexes where table_name = 'LOAN_RUNNING_DETAILS_SOUTH')

    6 order of 1,2,3;

    IND_TYPE INDEX_NAME NOM_PARTITION STATUS

    -------- ------------------------------ ------------------------------ --------

    Global DATE_IND1_S VALID

    Global IND_MSI_LN_LNS1_S VALID

    Global L_INDX_MSISDN_S VALID

    SQL > explain plan for the small circle of MSISDN, TID, of LOAN_RUNNING_DETAILS_SOUTH where LOANDATETIME < = sysdate-2 and LOANDATETIME > sysdate-15 and LOANTYPE = 1;

    SQL > set line 200

    @?/rdbms/admin/utlxpls.sql

    SQL >

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Hash value of plan: 1161680601

    ----------------------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                       | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

    ----------------------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                            |     2.    84.     5 (0) | 00:00:01 |       |       |

    |*  1 |  FILTER                             |                            |       |       |            |          |       |       |

    |*  2 |   TABLE ACCESS BY INDEX ROWID | LOAN_RUNNING_DETAILS_SOUTH |     2.    84.     5 (0) | 00:00:01 | ROWID | ROWID |

    |*  3 |    INDEX RANGE SCAN | DATE_IND1_S |     2.       |     3 (0) | 00:00:01 |       |       |

    ----------------------------------------------------------------------------------------------------------------------------------

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - filter(SYSDATE@!-2>SYSDATE@!-15)

    2 - filter ("LOANTYPE" = 1)

    3 - access("LOANDATETIME">SYSDATE@!-15 AND "LOANDATETIME"<=SYSDATE@!-2)

    17 selected lines.

    Reg,

    Hard

    Hi , HemantKChitale,

    I also update statistics manual as you say, but not see 'TABLE ACCESS FULL' good result

    What should I do? my need of production tuning, but I cannot able tune this...

    SQL > exec dbms_stats.gather_table_stats (-online 'ttt' ownname, tabname => 'LOAN_RUNNING_DETAILS_SOUTH', cascade => TRUE, estimate_percent => NULL, method_opt => 'for all columns size 254', => of degree 4);

    PL/SQL procedure successfully completed.

    SQL > explain plan for the small circle of MSISDN, TID, of LOAN_RUNNING_DETAILS_SOUTH where LOANDATETIME<=sysdate-2 and="" loandatetime="">sysdate-15 and LOANTYPE = 1;

    He explained.

    SQL > set line 200

    @?/rdbms/admin/utlxpls.sql

    SQL >

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Hash value of plan: 3659874059

    ------------------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                       | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |

    ------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                            |  1874K |    75 M | 19626 (2) | 00:03:56 |       |       |

    |*  1 |  FILTER |                            |       |       |            |          |       |       |

    |   2.   PARTITION LIST ALL |                            |  1874K |    75 M | 19626 (2) | 00:03:56 |     1.    11.

    |*  3 |    TABLE ACCESS FULL | LOAN_RUNNING_DETAILS_SOUTH |  1874K |    75 M | 19626 (2) | 00:03:56 |     1.    11.

    ------------------------------------------------------------------------------------------------------------------

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - filter(SYSDATE@!-2>SYSDATE@!-15)

    3 - filter("LOANDATETIME">SYSDATE@!-15 AND "LOANTYPE"=1 AND "LOANDATETIME")<>

    16 selected lines.

  • Set a style different cases for the same placeholder (data fusion) used two times in the same text

    Hello.

    I have a document with some parties updated with the fusion of data (via placeholders). Is it possible to set a style of different cases for the same placeholder in the same text. See the example:

    Mike runs its < < vehicule_placeholder > > in the city. But its < < VEHICULE_PLACEHOLDER > > is meant to be shared.

    If the value of this placeholder in the file merger is 'bike', the sentence should be:

    Mike runs his bike in the city. But his BIKE is meant to be shared.

    Is this possible? How?

    Thank you.

    You can do it. A character style for this configuration placeholder text, set in all caps.

  • How to convert the hierarchical query of SQL Server (CTE) to Oracle?

    How to convert the hierarchical query of SQL Server (CTE) to Oracle?

    WITH cte (col1, col2) AS
    (
    SELECT col1, col2
    FROM dbo. [tb1]
    WHERE col1 = 12
    UNION ALL
    SELECT c.col1, c.col2
    FROM dbo. [tb1] AS c INNER JOIN cte AS p ON c.col2 = p.col1
    )
    DELETE one
    FROM dbo. [tb1] AS an INNER JOIN b cte
    ON a.col1 = b.col1

    Hello
    Something like this maybe:

    DELETE FROM dbo.tb1 a
     WHERE EXISTS (
      SELECT 1
        FROM dbo.tb1 b
      WHERE a.co11 = b.col1
          AND a.col2 = b.col2
       START WITH b.col1 = 12
      CONNECT BY b.col2 = PRIOR b.col1)
    

    Although you need to do here is to check that CONNECT it BY SELECT, returns records you wait first, then the DELETION should work too.

  • Interlink with Sql server and Oracle

    Hello

    We have some data in SQL Server.
    We need to link SQL Server and Oracle Database. To make reports in Oracle Apex.

    Please someone guide me to interconnect with Oracle database

    Kind regards
    Thérèse

    Therese,
    You can find more information on gateways in this available in My Oracle Support note-

    Note to master for the Oracle Gateway (Doc ID 1083703.1) products

    Kind regards
    Mike

  • data replication with ODI between SQL SERVER and ORACLE

    Hello world
    First of all, I want to migrate database SQL SERVER and ORACLE DB tables.
    And then make online (synchronous) replication from SQL SERVER to ORACLE using ODI.

    I have not used before ODI.
    How to use the ODI for this?

    1. create a master repository and connect to the "topology Manager.
    2. in the topology Manager, you must configure the following
    2.1 create a data server for the Oracle under Oracle database in the physical connection
    2.2. create a database for the SQL Server database server in SQL Server in the physical connection. To do this, the jdbc for sql server driver.
    2.3 implement the logical connection and frame
    2.4 create a workrepository in the topology manager repositories tab
    3. connect to the designer and follow these steps
    3.1 create a template for the SQL Server source and reverse (import) the datastores (tables) to the model.
    3.2 the value of the model for the target of the Oracle
    3.3 create a (mapping) interface, under the table in schema define the source and then add it to the target and bind
    3.3 on the flow tab, you must set the Modules (KMs) of knowledge to perform the load. You must have imported the KMs before creating the interface.
    3.4 in IKM put 'create table traget' to 'yes '.
    4 run the interface to load data from SQL to Oracle Server

    Thank you
    Fati

  • Both inputs of printer with different names for the same printer

    I try to add a new printer in Windows 7 64 bit laptop.  I chose to add a printer in printers and peripherals and selected add a network, wireless or Bluetooth printer.  I have two tickets for the same printer

    Why are there 2 inputs and one which should I use?

    These entries are actually at the same network address (192.168.1.10).  The second address Specifies a particular port (3910).  Software print server HP Jetadmin 'web-based' uses the 3910 port to receive the print requests.  See http://h20564.www2.hp.com/hpsc/doc/public/display?docId=emr_na-c03975926

    The second is probably 'discovery of Web Services' (see http://en.wikipedia.org/wiki/WS-Discovery).  You probably don't want to use it from the "Add printer" Wizard

    I suggest to select the first entry.  This is the normal way to network printers appear in the add a Printer Wizard.  For example:

    If you have any problems with printing, post back and I'll see if I can diagnose the things for you.

  • Problem of USB ports: remove the material does not work. It works on different computers for the same USB devices

    Original title: problem of USB ports:

    I have a computer dell laptop inspiron d1420 provided with Windows vista and I have upgraded to Windows 7 ultimate, I noticed that when I plug in a USB mass storage, when I try to remove it, I don't get the safe delete the message and lately when I try to remove it, I keep getting the message He's busy and I can't remove it. I tried the same USB on another PC and I have no problem at all. I connected a printer, USB cable and wondows llok have not the driver or didn't install the printer, he left as a device not specified with the name of the printer, but I can't print. I tried with another PC that is also running Windows 7 ultimate and I have no problem, windows has installed the driver, because I used the same printer and the same cable. What is the problem with my USB 4 ports and how to fix?

    Hello

    When you get this message while trying to remove a USB, it's basically a lock for this USB device by some process running on the computer. If we know which process is this locking mechanism, we could also find which Service is associated with this problem in the computer.

    To check this, you can use a program called Process Explorer. You can download this program from the following link. Once downloaded, extract the contents of the zip downloaded to a folder on your desktop. Inside this folder, you will see a file by the name of procexp , which is the executable for Process Explorer. The download link is:

    http://TechNet.Microsoft.com/en-us/Sysinternals/bb896653

    First, plug the USB to one of the USB ports. Then, once you have the executable to Process Explorer, right-click on it and then click run as administrator. Please allow all guests UAC can occur. Once the Process Explorer is running, please follow these steps to search for processes using the USB at the moment:

    1. click on Searchand then click on manage to find them or DLL on the options menu at the top.

    2. then in the pop - up which will turn up next, type the drive letter for the USB drive connected to the computer (for example G: or H:) right now and click on Search.

    3. he should then display all instances of the process that is using this USB at the moment with the corresponding process ID (PID).

    Now, once you have the names of processes using the USB at this time, you can terminate them by clicking on them and then clicking on Manage close. Once this is done, you should be able to eject the USB safely.

    I would like to ask the names of processes lock the drive in your computer. This should give us an idea of what we might have to take the next.

    In addition, for the other issue that you mentioned, in which the computer does not automatically and correctly detects the printer when it is connected to the computer, I suggest you to check whether or not your computer Plug-and-Play service is set to automatic. Here's how you can do this:

    1. press the Windows and the R on your keyboard to get to the top of the run box.

    2. type Services.msc in the run box and press enter on the keyboard. Allow all UAC prompts that may coming up next.

    3. once it opens the window of the Services for you, scroll down to the Plug-and-Play service and double-click it.

    4. in the properties box that will come next, the Startup type should be set to Auto and the Status of the Service must be started. If this isn't the case, please put these values.

    5. click on apply then OK, close all windows in the computer and restart the computer once.

    Once these steps was performed, please check if the problem remains the same. We know the results.

    I hope that these steps raises you in the right direction in order to solve this problem. Don't answer if you still need assistance, we will be happy to be of assistance.

  • Planning for SQL server and Oracle db

    Hi friends

    We intend to improve our environment Hyperion of 9.3.3 to 11.1.2.2. and we will go from SQL server as our RDBMS Oracle.

    If we change DBMS, do we have to rebuild the total application or is there an easy way to migrate from sql server to Oracle

    Please suggest

    Thank you

    Upgrade the application to 11.1.2.2 while remaining on the SQL Server, then use LCM to export the application, remove the application, update the data source to point to Oracle, use LCM to import.

    See you soon

    John

    http://John-Goodwin.blogspot.com/

  • Different plan for the same sql id

    Hello

    Our team of application reported recently that a query ran longer than usual.

    Search in tables AWR (dba_hist_active_sess_history & dba_hist_sqlstat), it was a change of plan_hash_value. The next day, without intervention from anyone (collect statistics did not run, no change in the tables involved) the sql used the former plan and completed quickly.

    The differences in the plan was the index that was used to access the table.

    What could be the reason for the optimizer to choose a bad plan and return once more the good thing. ?

    The code sql that has been run twice & three in one day and then it years off cursor cache.

    Regime shifts are normal.

    Flipfloppping plans are quite normal.

    I'd be willing to bet that a large percentage of your SQL shows variations in implementation plans and you never notice.

    And there are several reasons why you might get a different plan.

    1 bind variable peeking - it is normal SQL for the age from the cache and then get analyzed once again with different bind variable leading to different cardinality estimates and plans

    2. the statistics change - it is normal that the statistics of change over time causing different cardinality estimates and the various plans, especially if the histograms are involved and changing buckets

    3. data change - especially if you use dynamic sampling it is normal to get a different sample of data leading to different cardinality estimates and plans

    4 SYSDATE - it's normal for queries with SYSDATE in them to recognize that time is never on leave and which, in conjunction with statistics or data, can lead to different cardinality estimates and plans

    5. integrated optimization features - it's normal for features like ACS to kick in and notice that they got forecasts wrong in an execution plan and force the recalculation to a different plan with an adjusted cardinality.

    Using DBMS_XPLAN. DISPLAY_CURSOR or DISPLAY_AWR you can get different plans (provided that they are in memory or AWR). The notes section should indicate cardinality comments have been a factor. You can also get links peeked with format mask of "+ PEEKED_BINDS".

  • The execution plan changes for the same query.

    Hi all

    This issue was raised before also, but still not able to find the real cause of this.

    Thread1:
    Re: Research of fragmentation of the table in Oracle 8.1.6.3.0

    Thread2:
    CBC latch and buffer busy await you on the same table.

    It comes, sometimes hammers server 100% CPU utilization with free latch and buffer busy wait events.

    We found a single query consumes high CPU usage that is run by different sessions.

    This query have two types of execution plans, where one is accurate and is not (its primary key hit index index no appropriate means present on the table)

    Because its primary key index hit repeatedly at various sessions, some sessions are powerful db file sequential read and a few sessions waiting buffer busy waits for event. Also during this time a few sessions waiting for latch free event.

    My doubt is how to sql even with different literal values execution plan changes and causes a prob.
    select count(*),event from v$session_wait group by event;
      COUNT(*) EVENT
    ---------- ----------------------------------------------------------------
           165 SQL*Net message from client
             1 SQL*Net message to client
             3 buffer busy waits
             2 db file parallel read
            18 db file sequential read
            10 latch free
             5 log file sync
             1 pmon timer
             6 rdbms ipc message
             1 smon timer
    
    SQL> select sid from v$session_wait where event='db file sequential read';
           SID
    ----------
            26
            58
            82
           107
           116
           223
           212
           203
           192
           173
           161
           157
           150
           147
           254
           238
           229
           112
           101
            81
            68
    
    SQL> select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID;
    Enter value for sid: 161
    old   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID
    new   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=161
    
    SPID             SID    SERIAL# PROGRAM
    --------- ---------- ---------- ------------------------------------------------
    4231             161      49569 oracle@tfrdb3 (TNS V1-V3)
    
    
    SQL> select sql_text
    from v$process a,
         v$session b,  2    3
         v$sql c
    where a.addr = b.paddr and
         b.sql_hash_value = c.hash_value and
        a.spid = &PID;  4    5    6    7
    Enter value for pid: 4231
    old   7:     a.spid = &PID
    new   7:     a.spid = 4231
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM LOG WHERE ID = '09292AMR
    10B41FE' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'234225222' OR TYPE =
     18 AND LOG_SEQ='234225222') ORDER BY TIME_STAMP ASC
    
    SQL> set autotrace traceonly exp
    SQL> SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM amrwf1.LOG WHERE ID = '09292AMR10B41FE' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'234225222' OR TYPE =18 AND LOG_SEQ='234225222') ORDER BY TIME_STAMP ASC;
    
    Execution Plan
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=11 Card=2 Bytes=126)
       1    0   SORT (ORDER BY) (Cost=11 Card=2 Bytes=126)
       2    1     CONCATENATION
       3    2       TABLE ACCESS (BY INDEX ROWID) OF 'LOG' (Cost=4 Card=1
              Bytes=63)
    
       4    3         INDEX (UNIQUE SCAN) OF 'PK_LOG_LOG_SEQ' (UNIQUE) (Co
              st=3 Card=1)
    
       5    2       TABLE ACCESS (BY INDEX ROWID) OF 'LOG' (Cost=4 Card=1
              Bytes=63)
    
       6    5         INDEX (RANGE SCAN) OF 'PK_LOG_LOG_SEQ' (UNIQUE) (Cos
              t=3 Card=1)
    
    
    SQL> select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID;
    Enter value for sid: 147
    old   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID
    new   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=147
    
    SPID             SID    SERIAL# PROGRAM
    --------- ---------- ---------- ------------------------------------------------
    6255             147      38306 oracle@tfrdb3 (TNS V1-V3)
    
    SQL> select sql_text
    from v$process a,
         v$session b,
         v$sql c  2    3
    where a.addr = b.paddr and
         b.sql_hash_value = c.hash_value and
        a.spid = &PID;  4    5    6    7
    Enter value for pid: 6255
    old   7:     a.spid = &PID
    new   7:     a.spid = 6255
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM LOG WHERE ID = '09273AMR
    62B4894' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'223324996' OR TYPE =
     18 AND LOG_SEQ='223324996') ORDER BY TIME_STAMP ASC
    
    
    SQL> set autotrace traceonly exp
    SQL> SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM amrwf1.LOG WHERE ID = '09273AMR62B4894' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'223324996' OR TYPE =18 AND LOG_SEQ='223324996') ORDER BY TIME_STAMP ASC;
    
    Execution Plan
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1538 Card=736 Bytes=
              46368)
    
       1    0   SORT (ORDER BY) (Cost=1538 Card=736 Bytes=46368)
       2    1     TABLE ACCESS (BY INDEX ROWID) OF 'LOG' (Cost=1527 Card=7
              36 Bytes=46368)
    
       3    2       INDEX (RANGE SCAN) OF 'LOG_ID' (NON-UNIQUE) (Cost=32 C
              ard=736)
    
    
    
    SQL> select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID;
    Enter value for sid: 82
    old   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID
    new   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=82
    
    SPID             SID    SERIAL# PROGRAM
    --------- ---------- ---------- ------------------------------------------------
    6172              82      45378 oracle@tfrdb3 (TNS V1-V3)
    
    
    SQL> select sql_text
    from v$process a,
         v$session b,
         v$sql c
    where a.addr = b.paddr and
         b.sql_hash_value = c.hash_value and  2
      3      a.spid = &PID;  4    5    6    7
    Enter value for pid: 6172
    old   7:     a.spid = &PID
    new   7:     a.spid = 6172
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    How to avoid this... why its different execution plan using (I mean bad index PK)

    Is it possible to avoid this?

    If any details please check out some of my previous post on this specific URL (above)

    -Yasser

    My doubt is how to sql even with different literal values execution plan changes and causes a prob.

    Different literal values cause analysis difficult.
    Hard analysis includes the re-evaluation of the best path.
    Literal value is included in the assessment of the selectivity for the scan interval (log_seq >...)

    See
    http://www.centrexcc.com/A%20Look%20under%20The%20Hood%20Of%20CBO%20-%20The%2010053%20Event.ppt.PDF
    http://www.centrexcc.com/fallacies%20Of%20The%20Cost%20Based%20Optimizer.PDF
    more the book of Jonathan Lewis which other threads, I believe that you already have.

    You must lower your CPU.
    Previous discussions, if the situation is still the same, it sounded like hard analysis particularly with this SELECTION against the NEWSPAPER plays an important role in that.

    How to avoid this... why its different execution plan using (I mean bad index PK)

    The points raised in the previous discussion remain valid.
    -Do you have access to this SQL to change?
    for example using bind variable or trick it if necessary due to problems caused by data as discussed in the previous thread.
    - Or you could it repoint the view to a view and a hint?
    -If a particular user makes this sql, could affect you cursor_sharing just for this user. If not, you should consider implementing pan-Canadian database.

    Oracle 8.1.6 still?

  • Different results from the same calculations between SQL and PL/SQL

    This SQL statement:
    select 1074 * (4 / 48) from dual;
    Gives the 89.5 result.
    However this PL/SQL block
    declare
        tmp     NUMBER;
    begin
        SELECT 1074 * (4 / 48) into tmp from dual;
        dbms_output.put_line('Result '||tmp);
    end;
    Gives a different result:
    Result 89.49999999999999999999999999999999999996

    If I change and give my variable tmp, a precision and scale, (38.36) say the result is 89.5.

    Ed. I did about 10g (10.2.0.4.0) and 11g (11.1.0.7.0) with the same result in both.

    Published by: kendenny on July 9, 2010 10:19 for more information

    What is your current value of NUMLARGEUR in SQL * more (I assume that you use as your tool)?

    SQL> set numwidth 50
    SQL> select 1074 * (4 / 48) from dual;
    
                                           1074*(4/48)
    --------------------------------------------------
             89.49999999999999999999999999999999999996
    
  • Different users calling different numbers for the same account

    Hello

    As a society, we have a single account which allows us to make phone calls. We know that more than one user, we can access the same account at the same time, however, could both users make calls at the same time? I mean the different calls.

    Example:

    The user has call + 39 02xxxxxxx

    User B calls + 44 95xxxxxx

    (both at the same time)

    Thanks in advance!

    Simone

    Hi, Simone1984, and welcome to the community,

    I recommend a careful review of the conditions of use of Skype and the policies of fair use for subscriptions, according to these apply to your business:

    If I were an anti-fraud filter and I detected mulitple calls taking place at the same time, I would immediately take action, thinking that the account has been abused...

    Kind regards

    Elaine

    __________________________________________________________________________________________________
    Your question has been answered? Please click on the link to accept as a Solutionfor everyone can quickly find what works! As a post or want to say, 'Thank You ' -? Click on the button of congratulations!
    Reliable information: Brian Krebs: 3 basic rules for online safety

  • Two different front for the same VI?

    Hello world!

    For a project in my school, I need to use labview to project a grid on a projector and a camera to capture this control grid. I know it is possible to 'send' of frontage on a second screen (the projector in my case), but is it still possible to have a different front panel on the main screen? Do I need to use a Subvi for this?

    Thanks in advance!

    Lionel Schmied

    I did something similar to this from LV 5.  The 'projection' VI can be a Subvi, which runs in parallel with the main VI or a regular Subvi which is called in a loop in the Main VI whenever the value on the screen should be updated. The Subvi contains a hidden control for main entries and an indicator of picture for the image to be projected - no code is running inside the Subvi.  The main Panel VI is on the computer screen and may be sued for control or monitor, which is expected.  I have also written a 'Slide Show' program that behaves in the same way.

    Lynn

Maybe you are looking for

  • Flashing / blinking screen on Qosmio F50

    Hello I have a persistant problem with my F50 - 12L screen, suddenly, the brightness of the screen/flashing / display flashes monte and down all of a sudden (it's not weak, it happens when I'm not working as well) When I start my laptop, everything i

  • How can I change sighn on without password

    all I want is to not have to use the password

  • Why can't we kill application dead / crashed?

    I'm sick and tired of having to do a hard reboot, get this sorted out surely not SO hard to untangle.  Right now I got 2 dead / crashed process that cannot be killed one's Outlook and the other is Chrome and occasional Firefox... Give us permission t

  • OfficeJet pro 6830: transport cannot return the cartridge access area

    I'm trying to set up my new printer 6830, but I got the transport Jam error message: "remove any packaging from inside the printer.» After all packaging is removed, turn the printer off and then turn it back on. "My new printer came not with the thin

  • Intermittent wireless connectivity

    We have the ultra-thin laptop Dell Inspiron 14 "computer. We have the same intermittent lose of the ass of wireless connectivity, a lot of people I've seen here. The wireless on our laptop is 1703 802.11b/g/n. When I'm looking for updated drivers, he