AUTOTRACE stats different in SQL Developer vs SQL Plus

Using SQL Developer 3.2.20.09, database is 11.2 on Linux. I'd like to know why I get different stats when using AUTOTRACE in SQL Developer vs SQL Plus. If I do the following in SQL Developer and in SQL Plus I get a very different set of stats:
set autotrace on
select * from emp;
set autotrace off
I run this with "run worksheet" in SQL Developer and I see this set of stats:
Statistics
4 user calls
0 physical read total multi block requests
0 physical read total bytes
0 cell physical IO interconnect bytes
0 commit cleanout failures: block lost
0 IMU commits
0 IMU Flushes
0 IMU contention
0 IMU bind flushes
0 IMU mbu flush
I do the same in SQL Plus and I see these stats:
Statistics
0 recursive calls
0 db block gets
7 consistent gets
0 physical reads
0 redo size
1722 bytes sent via SQL*Net to client
519 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
14 rows processed
A very different set of stats. The stats in shown in SQL Plus seem to be much more useful to performance optimization over the one shown in SQL Developer. Why the different set of stats for each? Thanks.

Cross-referencing to another recent thread on this topic:
Re: set autotrace on statistics in sqldeveloper (oracle 11g) is wrong

Similar Messages

  • Explain plan results are different in SQL Developer than SQL Plus

    My Environment:
    SQL Developer 1.0.0.15.27
    Platform where SQL Developer is running: Windows XP 2002 SP2
    Oracle Database and Client 9.2.0.7
    Optimizer_mode: FIRST_ROWS
    I have the following SQL statement:
    SELECT a1.comp_id
    FROM temp_au_company a0, au_company a1
    WHERE :b2 = a0.temp_emp_code
    AND a0.comp_id = a1.comp_id
    AND a0.sls_terr_code != a1.sls_terr_code
    AND a1.last_mdfy_date > :b1
    When I run an Explain in SQL Developer I get the following access path (which is the one I really want):
    SELECT STATEMENT                          TABLE ACCESS(BY INDEX ROWID) FEDLINK.AU_COMPANY          NESTED LOOPS                                   INDEX(RANGE SCAN)
    FEDLINK.UX2_TEMP_AU_COMPANY
              INDEX(RANGE SCAN) FEDLINK.PX1_COMPANY
    However, when I execute the statement with sql_trace turned on and use tkprof to generate the actual access path, the statement executes as follows (which is WAY more expensive):
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 3.58 6.68 28136 29232 0 0
    total 3 3.58 6.69 28136 29232 0 0
    Misses in library cache during parse: 1
    Optimizer goal: FIRST_ROWS
    Parsing user id: 979 (FEDLINK) (recursive depth: 1)
    Rows Row Source Operation
    0 NESTED LOOPS
    0 TABLE ACCESS FULL AU_COMPANY
    0 INDEX RANGE SCAN UX2_TEMP_AU_COMPANY (object id 49783)
    Notice the FULL access of au_company.
    I understand that SQL Developer has nothing to do with why the statement executed the way it did, but why is the Explain in SQL Developer different than the actual execution plan?
    Added note....when I run the explain in SQL Plus it is the same as the actual execution. Here is the explain from SQL Plus:
    explain plan for SELECT a1.comp_id
    FROM temp_au_company a0, au_company a1
    WHERE '1' = a0.temp_emp_code
    AND a0.comp_id = a1.comp_id
    AND a0.sls_terr_code != a1.sls_terr_code
    AND a1.last_mdfy_date > '01-MAY-2006';
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 2 | 76 | 2597 |
    | 1 | NESTED LOOPS | | 2 | 76 | 2597 |
    | 2 | TABLE ACCESS FULL | AU_COMPANY | 2 | 42 | 2595 |
    | 3 | INDEX RANGE SCAN | UX2_TEMP_AU_COMPANY | 1 | 17 | 2
    Thanks,
    Brenda

    The explain is different (full scan of au_company in SQL Plus / index access in SQL Developer) even when I use variables in SQL Plus. Here is the output for SQL Plus using variables instead of literals:
    SQL> variable b1 varchar2
    SQL> variable b2 char
    SQL> explain plan for SELECT a1.comp_id
    2 FROM temp_au_company a0, au_company a1
    3 WHERE :b2 = a0.temp_emp_code
    4 AND a0.comp_id = a1.comp_id
    5 AND a0.sls_terr_code != a1.sls_terr_code
    6 AND a1.last_mdfy_date > :b1
    7 /
    Explained.
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 3184 | 118K| 2995 |
    | 1 | HASH JOIN | | 3184 | 118K| 2995 |
    | 2 | INDEX RANGE SCAN | UX2_TEMP_AU_COMPANY | 3187 | 54179 | 3 |
    | 3 | TABLE ACCESS FULL | AU_COMPANY | 24009 | 492K| 2983 |
    Any other ideas? They should be the same.
    Brenda

  • Cannot see table in sql developer or sql plus

    I have created a record in application designer. I have then built the table. I can close the record and then find it again in application designer. But if I go to sql plus or sql developer, I cannot see it. Am I missing a step?

    You probably can see all the tables of sysadm because someone else give you proper grant for that on existing sysadm's objects.
    For the new or modified object (drop+create) you should :
    1. connect as sysadm and run
    grant select on new_table_name to your_own_user;2. connect with your own user and run
    create synonym new_table_name for sysadm.new_table_name;Then you'll be able to query that table without using schema name alias.
    Some admin have also a ddl trigger to make it automatically.
    You could also work through a role and public synonym if more than one user needs to access sysadm's objects.
    Nicolas.

  • Select from in SQL Developer fails - SQL*Plus works

    Hello All,
    I've got the HS connection to MySLQ working correctly and most of the requirements I have with respect to the data is working.
    However, i"m only able to test my procedures and functions in SQL*PLus. IN SQL Developer 4.0.0.12 there is always a problem and query results are never displayed.
    Thanks in advance for any advice.
    Sincerely
    JS

    Actually Mike,
    The white spaces are appended to the end of the resulting string. I've included the NLS setting for bother Oracle adn MySQL as well as my odbc.ini file
    select '"'|| "User" ||'"' as Username from "user"@MYODBC5;
    Results (there is white spaces added right after the username, as the result shoudl have been "intm","root" as opposed to "intm                                "
    ===============================================================================================================
    USERNAME
    "intm
    USERNAME
    "root
    NLS _SETTINGS  ORACLE
    ==============================================================
    Oracle:
    ======
    NAME                      
    VALUE$
    NLS_LANGUAGE              
    AMERICAN
    NLS_TERRITORY             
    AMERICA
    NLS_CURRENCY              
    $
    NLS_ISO_CURRENCY          
    AMERICA
    NLS_NUMERIC_CHARACTERS    
    NLS_CHARACTERSET          
    AL32UTF8
    NLS_CALENDAR              
    GREGORIAN
    NLS_DATE_FORMAT           
    DD-MON-RR
    NLS_DATE_LANGUAGE         
    AMERICAN
    NLS_SORT                  
    BINARY
    NLS_TIME_FORMAT           
    HH.MI.SSXFF AM
    NAME                      
    VALUE$
    NLS_TIMESTAMP_FORMAT      
    DD-MON-RR HH.MI.SSXF
    F AM
    NLS_TIME_TZ_FORMAT        
    HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT   
    DD-MON-RR HH.MI.SSXF
    F AM TZR
    NLS_DUAL_CURRENCY         
    $
    NLS_COMP                  
    BINARY
    NLS_LENGTH_SEMANTICS      
    BYTE
    NLS_NCHAR_CONV_EXCP       
    FALSE
    NAME                      
    VALUE$
    NLS_NCHAR_CHARACTERSET    
    AL16UTF16
    NLS_RDBMS_VERSION         
    11.2.0.2.0
    NLS _SETTINGS  MYSQL
    ==============================================================
    Oracle:
    ======
    NAME :
    +--------------------------+----------------------------+
    | Variable_name            | Value                      |
    +--------------------------+----------------------------+
    | character_set_client     | utf8                       |
    | character_set_connection | utf8                       |
    | character_set_database   | latin1                     |
    | character_set_filesystem | binary                     |
    | character_set_results    | utf8                       |
    | character_set_server     | latin1                     |
    | character_set_system     | utf8                       |
    | character_sets_dir       | /usr/share/mysql/charsets/ |
    +--------------------------+----------------------------+
    ===========================================================ODBC INI
    [myodbc5]
    Driver = /usr/lib64/libmyodbc5a.so
    Description = Connector/ODBC 5.3.4 Driver DSN
    SERVER = 127.0.0.1
    PORT = 3306
    USER = intm
    PASSWORD = *********
    DATABASE = mysql
    OPTION = 0
    TRACE = OFF

  • SQL developer vs SQL*plus

    hi i am not able to run the command connect username/password on SQL developer but when i run the command on
    sqlplus through command prmpt then it work .....wht might be the issue..i am a newbe to use of SQL developer

    Technohub wrote:
    sql devloper is a third party tool. Hmm last time I checked, it was a tool from Oracle only. Let's check again,
    http://www.oracle.com/technetwork/developer-tools/sql-developer/index.html
    Its not a 3rd party but Oracle's own tool.
    >
    once u connect to the db then u can switch to other users as follows
    SQL> conn user/pwd@connect_string

  • Migration issue in SQL Developer (from SQL Server to Oracle)

    Dear All,
    I am using SQL Developer 3.0 to migrate data from SQL Server 2008 to Oracle 11gR2. I used Quick Migration Wizard for migrating and everything was Ok but when it was running migration process, I got this message: “Migration actions have failed. Check the migration reports for details. : null”
    But there was not any report to check. Does anyone know how I can do it without any problem?
    Thanks in advance.

    I am working on a project to migrate from SQL Server 2008 to Oracle 11gR2. It includes some tables, views, indexes, triggers and store procedures. At first I worked on SQL Developer 2.1.1.64 but it doesn’t support SQL Server 2008 (I had to use SQL Server 2005 in its offline options). I got a lot of error when I used the offline options. I know that I may be having some problem in table or view definition in my SQL Server but if I don’t have any log file I can’t solve them.
    Unfortunately, in SQL Developer 3.0 there isn’t any option to generate a SQL comments from objects (convert to Oracle) because I need to rewrite comments if they have problem. For example I have a filed named USER that it’s a reserved word in Oracle so I have to change this field name.
    I also can’t use “Translation Scratch Editor” because it has some error to convert. For example when I use it for the following code:
    CREATE TABLE [dbo].[Table1](
         [ID1] [int] IDENTITY(1,1) NOT NULL,
         [Name1] [varchar](50) NULL,
         CONSTRAINT [PK_Table1] PRIMARY KEY CLUSTERED
         [ID1] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    CREATE TABLE [dbo].[Table2](
         [ID2] [int] IDENTITY(1,1) NOT NULL,
    [Name1] [varchar](50) NULL,
         CONSTRAINT [PK_Table2] PRIMARY KEY CLUSTERED
         [ID2] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    I receive a wrong code like this:
    CREATE SEQUENCE Table1_ID1
    START WITH 1
    INCREMENT BY 1;
    CREATE TABLE Table1
    ID1 NUMBER(10,0) NOT NULL,
    Name1 VARCHAR2(50) ,
    CONSTRAINT PK_Table1 PRIMARY KEY( ID1 )
    CREATE OR REPLACE TRIGGER Table1_ID1_TRG
    BEFORE INSERT
    ON Table1
    FOR EACH ROW
    BEGIN
    SELECT Table1_ID1.NEXTVAL INTO :NEW.ID1
    FROM DUAL;
    END;
    CREATE SEQUENCE Table1_ID1
    START WITH 1
    INCREMENT BY 1;
    CREATE SEQUENCE Table2_ID2
    START WITH 1
    INCREMENT BY 1;
    CREATE TABLE Table2
    ID2 NUMBER(10,0) NOT NULL,
    Name1 VARCHAR2(50) ,
    CONSTRAINT PK_Table2 PRIMARY KEY( ID2 )
    CREATE OR REPLACE TRIGGER Table1_ID1_TRG
    BEFORE INSERT
    ON Table1
    FOR EACH ROW
    BEGIN
    SELECT Table1_ID1.NEXTVAL INTO :NEW.ID1
    FROM DUAL;
    ENDCREATE OR REPLACE TRIGGER Table2_ID2_TRG
    BEFORE INSERT
    ON Table2
    FOR EACH ROW
    BEGIN
    SELECT Table2_ID2.NEXTVAL INTO :NEW.ID2
    FROM DUAL;
    END;

  • SQL Developer 31EA1 SQL Worksheet not allowing entry

    When select to open a new SQL worksheet or having open a worksheet on connection, the system will bring up a new tab with the blue shading. It stops at that point. I can not enter anything and if I try and do other tasks, even exit Developer, I get a connection busy error message. If I try and click the try again button it just keeps reappearing. If I click the abort and try and do anything els I get the error again. I have to go to task manager and kill the task to get out of SQL developer. I am using Windows XP, JAVA 1.6.0_26 32 bit versions. Everything was working when I was using 3.0.

    Hi,
    See this post for the likely problem:
    Re: SQL Developer 3.1EA1 JAVA Error During Export
    Regards,
    Gary
    SQL Developer Team

  • Working on SQL Developer / pl/sql developer without installing Oracle

    HI,
    I am working on SQL Developer tool without installing oracle into my local machine.
    I just took server IP as hostname and continuing with the same/
    Now, since I donot have tns names, I am not able to use any other user other than my work related.
    like scott etc.
    could anyone let me know, is there any way that i can work on sql developer or pl/sql developer without installing oracle into local machine
    like using scott etc...
    for testing and learning purpose of self code.
    thanks in advance.

    VBSK wrote:
    I am working on SQL Developer tool without installing oracle into my local machine. You need an Oracle client driver - this is mandatory.
    No, you do not need a TNS alias (as the connection string can be build manually by the application and the driver).
    So SQL*Developer needs to have an OCI (Oracle Call Interface) client driver. This can be "installed" using Oracle Instant Client.
    Instant Client does not really install - to use it takes 3 basic steps:
    - download it (zip file)
    - unzip it to a directory (e.g. C:\InstantClient on Windows)
    - add to your Windows User's environment an ORACLE_HOME variable that points to this directory
    These steps should suffice in making the driver in in Instant Client available to Oracle applications. (works for me running an Oracle OCI client like <i>Mumbai</i> or Oracle's <i>SQL Data Modeler</i>).
    If you want a tnsnames.ora file, then create the file and create a new environment variable called TNS_ADMIN that refers to directory location of the file. It can use the same location as your Instant Client directory.
    PS. I assume you have an existing Oracle server to connect to.

  • EA1 - Exception when SQL Developer opens SQL files on startup

    If I close SQL Developer with a file open, that file is automatically reopened when restarting SQL Developer. This works fine, but for each .sql file which does open, I get the following exception listed in the Logging Page's Log tab:
    SEVERE     147     0     oracle.ide.IdeCore     Exception firing mainWindowOpened to oracle.dbtools.sqlworksheet.sqlview.SqlEditorController$2@xxxxxxx
    This doesn't happen for PL/SQL files (ie .pks, .pkb, etc) - just for .sql files.

    Fixed this in development code. Thx.

  • PL/SQL Developement

    hi ,
    I have fair knowledge with PL/SQL,as I have used it in developement of
    PL/SQL program libraries in forms and developing interfaces between applications.
    Caan seomone send me a functional spec /technical spec as to how to develope a whole application in PL/SQL
    I want to know the following with regard to this
    1) how will the application be used/triggered ?(like in GUI we just click the first executable)
    2)What all are going to be the components of the application ?
    3)How can it be maintained ?
    rgds
    s

    You seem to view PL/SQL as something different than Java or C# or Visual Basic... it is not.
    The language itself is as capable. It is a "proper" declarative and procedural language. It has o-o programming features. Etc.
    The main difference is simply that is it a server side language and not a client side language.
    1) how will the application be used/triggered ?(like in GUI we just click the first executable)PL/SQL can generate HTML - and via an Apache web server module called mod_plsql, it can receive web browser requests and return dynamically created HTML pages.
    It is standard client-server. In a nutshell client server consists of 3 components. The User Interface (UI), the Application (APP) and the Database (DB).
    In the 90's we mostly had fat clients. This means that the UI and APP was the client. It communicated with the server component, the DB.
    These days the thin client is in fashion. This means that the client is only the UI (e.g. web browser). It communicates with the APP server. The APP server in turn a client that communicates with the DB server.
    With PL/SQL, you have a "fat" server as oppose to a fat client. You combine the APP and DB into a single server component. The Oracle RDBMS. The thin client (web browser) communicates with the APP (PL/SQL application). The APP runs inside the DB component has blindingly fast and efficient and effective access to the DB component.
    The connectivity between UI and APP in this case, is provided by Apache and mod_plsql (also called Oracle HTTP Application Server).
    2)What all are going to be the components of the application ?Everything. The complete application is written in PL/SQL. If you use an existing PL/SQL APP component framework like APEX (Oracle's Application Express), this is very easy.
    If not, then you need to write PL/SQL packages that processes the input from a web browser (converts URL GET and POST into PL variables), write PL/SQL packages that renders HTML using a cursor as input, write packages to maintain session state for the web browser (stateless) client and so on. (APEX has PL/SQL packages that do all this)
    3)How can it be maintained ?The same way as you maintain any APP component that is a server component in client-server architecture. If you used java, what will would you do? Use Eclipse and Subversion perhaps? The very same tools can be used for developing PL/SQL as the APP component. Or TOAD, or PL/SQL Developer or SQL-Developer. Or SourceSafe or CVS.
    Forgot about the concept that PL/SQL is somehow different and needs to be treated differently. That is an illusion. The principles and fundamentals of client-server and software engineering remains the same.

  • SQL Report not showing data - available in SQL Workshop and SQL Developer

    I am having an issue with developing a SQL Report in APEX 3.2.1. I run the code in both SQL developer and SQL Workshop and I get data pulled back (both against my development environment). When I run the same code in a SQL Report region, it returns no data available. Does anyone have any idea what would be causing this? Other regions on the page accessing different tables in the same schema return data without issue. Any help would be appreciated.
    Thanks
    Freddie

    Could you explain the last comment a bit more. Here is a bit more info just in case I touch on the info with it. The db schema is BPAMGR, the Workspace is BPAMGR. We use the same schema for all of our reporting. All of our tables are in the same schema. We don't use any tables outside of this schema. Our APEX workspace has been associated to only this schema. The tables are able to be queried by SQL Workshop in the same APEX instance that the report application is under.
    Freddie

  • How to compare two schemas in Oracle sql developer

    Hello,
    I need to compare both the data and schemas details (columns etc) between two schemas on different databases (connections).
    What is the easiest and most efficient way to do this? Hopefully in Oracle Sql Developer or Sql Plus?
    Thanks.

    In SQL Developer go to Tools -> Schema Diff !
    in SQL* Plus you will need to write PL/SQL for this.
    Amardeep Sidhu

  • Oracle SQL Developer is out

    If you haven't been paying attention to early adopters of Project Raptor there it is - production release of Oracle SQL Developer, outstanding database development tool. It works very well with XE and if you're somehow reluctant to web interface or too ascetic sqlplus, you shall certainly like it. Very useful and at no charge.
    Oracle SQL Developer is a new, free graphical tool that enhances productivity and simplifies database development tasks. With SQL Developer, you can browse database objects, run SQL statements and SQL scripts, and edit and debug PL/SQL statements. You can also run any number of provided reports, as well as create and save your own.
    http://www.oracle.com/technology/products/database/sql_developer/index.html

    I use SQL Developer for SQL and PL/SQL and only use SQL*Plus for the few commands that don't work in SQL Developer.
    SQL Developer has a forum, too.

  • SQL Developer problem. Rows without columns on data tab

    Hello,
    I have a strange behavior in Oracle SQL Developer Version 2.1.0.63. When I'm trying to open the "Data tab" for some tables, SQL Developer shows data rows but without columns! It seems that I can select different rows but I can't see neither any data nor column names.
    Under the filter setting there are no available columns either.
    At the same time, when I'm trying to open sys tables they are displayed normally.
    From the other side, those tables which are not displayed correctly in 2.1.0.63, could be opened in Version 1.5.5 without any problems.
    Do you have any ideas?
    Thanks in advance.

    Hi,
    Refer to the SQL Developer forum: SQL Developer for SQL Developer related questions

  • SQL Developer - Adding a column comment via SQL

    When I add a comment in SQL*Plus via SQL, such as COMMENT ON COLUMN "MY_OWNER"."MY_TABLE"."MY_COLUMN" IS 'column comment' it works fine. When I try the same thing in SQL Developer I receive a message "No SQL statement entered".
    I realize this can be done in SQL Developer via action buttons in the user interface; but I need to be able to do it via SQL since my procedure generates this code for hundreds of columns at one time.
    Is there a SQL way to do this in SQL Developer? Alternatively, can SQL Developer call SQL*Plus to run commands?

    This is a current bug when executing as statement (F9).
    Good news is it does work when running as script (F5).
    Have fun,
    K.

Maybe you are looking for

  • Can not open Captivate files in Dreamweaver

    All files are in one folder - code attached <p><a href="NAME.htm" target="_blank" class="paragraph" title="TITLE">LINK TEXT GOES HERE</a></p> When the Captivate file was published, I selected the "Export HTML" check box. I put both .swf files, the .c

  • Getting stuck in the Review Quiz option

    Hello, When from the Quiz results slide, a user clicks the Review Quiz button, it lets the user click through the slides and review, but none of the buttons take the user back to the quiz results slide when they are done reveiwing the quiz. I've seen

  • Cannot find OracleInProcServer.dll in the 64 bit Oracle 11g r2

    We have been using OracleInProcServer.dll in our applications to access oracle spatial features. However, with the new 64 bit oracle 11g r2, I cannot find the OracleInProcServer.dll file. I have tried to use the old OracleInProcServer.dll (32 bit fro

  • Call function starting new task:

    I am trying to create a program in which few database update are mentioned. after database updates , I am calling a function module using starting new task in which I want to commit database updates inside in function module. Problem is I want to com

  • Problems with Timer, counts 60000 as one minute but need it to be 60

    Hello All. I have an application that i have working although i need to change it slightly, the way that it uses a number to be exact, It includes a countdown HSlider and timer, and is used as an interview kinda thing.  so the user only gets a small