Question on AUTOTRACE, 0618 SP2 and SP2-0611

Hello

I wanted to look at for some examples of query execution plans. I did a little research with Google, discovered autotrace, plan_table plustrace role utlxplan. I followed the instructions I found, but the result is not quite as expected.

Here is an exit of a freshly session started:
0 01:50 [SS1TB Attic-Z] [5G] [750M] Z:\Documentation\Oracle\
Oracle Concepts\Scripts>sqlplus hr/abc123

SQL*Plus: Release 11.2.0.1.0 Production on Sun Aug 8 01:50:16 2010

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select count(*) from plan_table;

  COUNT(*)
----------
         2

SQL> set autotrace on
SP2-0618: Cannot find the Session Identifier.  Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report
SQL> select count(*) from plan_table;

  COUNT(*)
----------
         2


Execution Plan
----------------------------------------------------------
Plan hash value: 3662021055

-------------------------------------------------------------------------
| Id  | Operation          | Name       | Rows  | Cost (%CPU)| Time     |
-------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |            |     1 |     3   (0)| 00:00:01 |
|   1 |  SORT AGGREGATE    |            |     1 |            |          |
|   2 |   TABLE ACCESS FULL| PLAN_TABLE |     2 |     3   (0)| 00:00:01 |
-------------------------------------------------------------------------

Note
-----
   - dynamic sampling used for this statement (level=2)

SQL>
1. the first select statement is there to make sure I have a plan_table, than controls.
2. when I set autotrace on, I get SP2-0618 and SP2-0611 for reasons I can't understand.
3. the second selection is there to find out if the autotrace in step 2 have had an impact. He has done now for the explain plan command is displayed.

The question is: if it works (as shown in step 3) then why I get these errors in step 2? and what do I do to not get these errors more?

Thanks for your help (again!)

John.

Note: I created the role plustrace, granted it select v_$ sesstat, v_$ statname, v_$ session, and then I gave hr plustrace. was there something else?

John,

10.2 from, creating the plan_table is not necessary because the table is created in the Sys schema with the name of table plan $ and his public synonym is made available to all users with the name plan_table . For the rest, see if the below demo.

SQL> select * from V$version;

BANNER
-------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

SQL> drop user john purge;
drop user john purge
               *
ERROR at line 1:
ORA-00921: unexpected end of SQL command

SQL> drop user john cascade;

User dropped.

SQL> @D:\oracle\product\11.2.0\dbhome_1\sqlplus\admin\plustrce
SQL>
SQL> drop role plustrace;

Role dropped.

SQL> create role plustrace;

Role created.

SQL>
SQL> grant select on v_$sesstat to plustrace;

Grant succeeded.

SQL> grant select on v_$statname to plustrace;

Grant succeeded.

SQL> grant select on v_$mystat to plustrace;

Grant succeeded.

SQL> grant plustrace to dba with admin option;

Grant succeeded.

SQL>
SQL> set echo off
SQL> create user john identified by john;

User created.

SQL> grant connect, resource to john;

Grant succeeded.

SQL> grant create table to john;

Grant succeeded.

SQL> grant plustrace to john;

Grant succeeded.

SQL> conn john/john
Connected.
SQL> create table test(a number);

Table created.

SQL> set autot lon
Usage: SET AUTOT[RACE] {OFF | ON | TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]]
SQL> set autot on
SQL> select * from test;

no rows selected

Execution Plan
----------------------------------------------------------
Plan hash value: 1357081020

--------------------------------------------------------------------------
| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |     1 |    13 |     2   (0)| 00:00:01 |
|   1 |  TABLE ACCESS FULL| TEST |     1 |    13 |     2   (0)| 00:00:01 |
--------------------------------------------------------------------------

Note
-----
   - dynamic sampling used for this statement (level=2)

Statistics
----------------------------------------------------------
         24  recursive calls
          0  db block gets
          2  consistent gets
          0  physical reads
          0  redo size
        281  bytes sent via SQL*Net to client
        409  bytes received via SQL*Net from client
          1  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          0  rows processed

SQL>

HTH
Aman...

Tags: Database

Similar Questions

  • I recently dropped my laptop and it is weird, one day he int open up to 4 start times and sometimes it shows me a folder and a question mark in the interface and sometimes asked to reset my password, what are the steps to take?

    I recently dropped my laptop and it is weird, one day he int open up to 4 start times and sometimes it shows me a folder and a question mark in the interface and sometimes asked to reset my password, what are the steps to take?

    Anything can be corrupted on your MacBook Pro, but from what you say, it seems that the cable drive/SSD/flash memory/SATA hard was seriously damaged. Him "question mark" means that your Mac is unable to find any bootable device, meaning that it does not yet detect your OS X drive.

    You should make a backup of your files (if you can still do it) and take the Mac at the Apple Store or dealer to get a diagnosis. There may be several damaged parts.

  • I forgot my security question answer on my account and I get lost email address of relief

    I forgot my security question answer on my account and I get lost rescue address, how do I get my new security question?

    Contact Apple for assistance with the security of the Apple ID - Apple Support accounts

  • How can I STOP e-mails in response to a question, I asked months ago and no longer need an answer for?

    * Original title: stop emails

    How can I STOP e-mails in response to a question, I asked months ago and no longer need an answer for?

    Post proposed by the facilitator for the appropriate forum placed

    Hello

    You will see your name at the top of any message that you posted, like this, DianeFiorentino

    This is a link to your profile page. Click on this link.

    On your profile page, click on the link of the activity at the top of the page. This will display a list of all the threads you have subscribed .

    On the right side of each thread, you'll see a link Stop Emails . Click on this link for every conversation that you don't want to receive notifications for.

    Additionally, if you look closely at the emails that you receive, you will see the link to the bottom of the email.

    You want to unsubscribe from this thread?
    Click here to go to the thread, and then click Stop emails.

    Concerning

  • My 10 photoshop element stop working, I'm not able to open it more.  ?  I posted this question a few days ago and I did not get all yer anwer, please help

    My 10 photoshop element stop working, I'm not able to open it more.  ?  I posted this question a few days ago and I did not get all yer anwer, please help

    I have photoshop editor item 10 and organizer first and I have a Macbook pro 10,9,9

    When I try to open an image with the Publisher of the item or if I try to open the PS Editor directly I see this

    file:///users/main/desktop/screen%20Shot%202014-11-26%20at%201.17.35%20PM.PNG

    When I click on edit it does not open and I have this window

    file:///users/main/desktop/screen%20Shot%202014-11-26%20at%201.21.07%20PM.PNG

    and if I click on REOPEN, I still got the same message

    Lucie

  • question on the layer effects and filters - Jews Becker

    Hello

    I have a question about the layer effects and filters

    first is there a way to layer effects in flash (as in photoshop 'coup' "outter glow" etc...)

    so it is a kind of plug-ins to special effects - perhaps with particles or pretty effects that I can buy

    Thank you very much!

    (as you may have guessed I'm very new at this and appreciate all the advice I can get!)

    -Jews Becker

    You won't find anything exactly like filters in Photoshop for use in Flash. There are filters in Flash. They are available at the bottom of the Properties window for an object MovieClip or button on the stage. Alternatively, you can apply and animate a filter in Actionscript. There is a good third-party developer, http://www.greensock.com, where you can find a few effects tools very useful. Most are free.

  • Questions about the slipstreaming SP2

    I read the article on how to do it.  A question and I have to use UltraIso?  I have a paid copy of Macrium reflect which allowed me to install Windows PE.  The equivalent of the WAIK kit.

    I have a copy of CD of Vista Home Premium on CD, I just downloaded the SP2 stand-alone version.  The tutorial refers to the installation of Vista RTM, I don't know what it is.  My D partition has a copy hidden Windows already on it.  Is it possible to access only and avoid all this?

    You can an ISO record directly from the CD (SP1) on the external hard drive?   I can create the ISO and put it on my external hard drive, install it and then delete the Install.wim file?  Step 12 in the tutorial is really confusing, especially as Flaviuos has a reference that deals directly with the Vista Home Premium. I do not understand why the cleanup tools must be run either.

    This "slipstreaming" is a little intimidating with the tutorial of Flavius.   There is a lot of confusion between unfamiliar steps.  I agree with some comments that followed this tutorial.  It must be in the language that we non-tech types can understand. If someone could make this a bit clearer, I would be very grateful.

    Let your only D: partition.

    http://www.Vistax64.com/tutorials/230249-sliptream-Vista-SP2.html

    Follow the tutorial above.

    I'm sorry, but that's the way it is written.

    Take your time to understand.

    See you soon.

    Mick Murphy - Microsoft partner

  • List of questions to verify the performance and maintenance?

    Is there an online list of questions to verify the performance of Vista SP 1?

    A reasoning to install SP2 or SP3 immediately?

    I had to do a direct upgrade from XP sp2 to Vista and seems to work very well.

    Thank you

    Kenny

    Sunday, August 8, 2010 13:13:36 + 0000, PCKenny wrote:

    Is there an online list of questions to verify the performance of Vista SP 1?

    See Lorien - good suggestions.

    A reasoning to install SP2 or SP3 immediately?

    Yes. Service Packs resolve problems and improve safety. You should
    be always up to date with them.

    Ken Blake

  • Question on the PL/SQL and substitution of variables

    Good evening

    I just started studying the PL/SQL (currently at page 13 of the book), I typed the following example from the book:
    declare
      v_student_id          number          := &sv_student_id;
      v_first_name          varchar2(35);
      v_last_name           varchar2(35);
    
    begin
      select first_name,
             last_name,
        into v_first_name,
             v_last_name
        from student
       where student_id = v_student_id;
    
    
      dbms_output.put_line('Student name : ' || v_first_name || ' ' v_last_name);
    
      exception
        when no_data_found then
          dbms_output.put_line('There is no such student');
    end;
    /
    that gets me the following error:
    SP2-0552: Bind variable "SV_STUDENT_ID" not declared.
    I thought that SQL * more would invite me for a value to be substituted for SV_STUDENT_ID but it does not, that caused the error. Why has no SQL * more invite me for the value of SV_STUDENT_ID and what is the correct way to do it than the code above?

    Thank you for your help,

    John.

    As a result, DDL for STUDENT table:
    CREATE TABLE STUDENT
     (STUDENT_ID NUMBER(8,0)
     ,SALUTATION VARCHAR2(5)
     ,FIRST_NAME VARCHAR2(25)
     ,LAST_NAME VARCHAR2(25)
     ,STREET_ADDRESS VARCHAR2(50)
     ,ZIP VARCHAR2(5)
     ,PHONE VARCHAR2(15)
     ,EMPLOYER VARCHAR2(50)
     ,REGISTRATION_DATE DATE
     ,CREATED_BY VARCHAR2(30)
     ,CREATED_DATE DATE
     ,MODIFIED_BY VARCHAR2(30)
     ,MODIFIED_DATE DATE
     )
    /

    You had a few syntax errors (lines 7 and 12), but after their attachment, your code worked for me:

    SQL> ed
    Wrote file afiedt.buf
    
      1  declare
      2    v_student_id          number          := &sv_student_id;
      3    v_first_name          varchar2(35);
      4    v_last_name           varchar2(35);
      5  begin
      6    select first_name,
      7           last_name
      8      into v_first_name,
      9           v_last_name
     10      from student
     11     where student_id = v_student_id;
     12    dbms_output.put_line('Student name : ' || v_first_name || ' ' || v_last_n
    ame);
     13    exception
     14      when no_data_found then
     15        dbms_output.put_line('There is no such student');
     16* end;
    SQL> /
    Enter value for sv_student_id: 1
    old   2:   v_student_id          number          := &sv_student_id;
    new   2:   v_student_id          number          := 1;
    
    PL/SQL procedure successfully completed.
    

    Did you happen to define set off?

    SQL> show define
    define "&" (hex 26)
    
    SQL> set define off
    SQL> /
    SP2-0552: Bind variable "SV_STUDENT_ID" not declared.
    SQL> set define on
    SQL> /
    Enter value for sv_student_id: 1
    old   2:   v_student_id          number          := &sv_student_id;
    new   2:   v_student_id          number          := 1;
    
    PL/SQL procedure successfully completed.
    

    Published by: Andy Klock on August 11, 2010 18:13 (sorry, line 7 means there was an error not 9...)

  • Question Express/Extreme Cox Communications and airport

    I know this has been already posted on a forum earlier (Airport Extreme and Cox Internet IPv6 problem) and the solution was to change the IPv6 local link only. However I still have not heard a word on when apple will release a firmware update to mitigate this problem. I'm stuck using a brand router cisco and its absolutely terrible. I have such a terrible connection all the time and they purpose integer to spend all the money on the Apple router was due to its peak performance and standards. Now it just sits in my closet on the floor... Sorry for the rant, back to my original question. No one knows when apple's plans when you release a firmware update to solve this problem?

    As you know when you walked into the communities Support from Apple, we all just other users of Apple products. No one here can answer when or even if Apple will provide any firmware (or any other type of updates) for their products.

  • I asked question 1 on 17 August and confirmed my a/c link in email to post the question. where can I find answers?

    I asked my 1st ever question about Firefox for Mobile re: bookmarks on 17 August and confirmed my account link in the email to post my question - where can I find the answer now? "Where can I find the answer" has been asked before and the answer chosen is:

     * At the top of the support site, mouse over your user name and choose View Profile from the menu
     * From the main questions page, find My Contributions in the filters list
    

    This does not work for me. It is not a page of questions only a question. I used advanced search to find my Contribution and could find nothing. It is too painful to browse all relevant response messages, I just want to stop smoking.

    How can I delete my original question anyway? No rude answer or I'll report it as abuse, thanks in advance.

    These are two different directions.

    The first can be used on the pages of the forum if you have connected and your user name displayed (instead of connection) with a drop-down list that appears if you click your name.

    The second direction works for pages to index forum having my Contributions link in the drop-down list sort and filter (second column: Show > my Contributions).

    I see only this question and answer that you have posted in another thread. There is no second question asked on 17 August.

  • Designjet Z2600: Questions about head of ink and printer maintenance

    We have recently acquired a printer, Designjet Z2600 24 "large format.  A few questions so we can know what to expect:

    • Dry ink: A colleague suggested that dried ink can be a problem if the printer is not used frequently.  We plan on it using every two weeks, but there may be times when a month or two will pass between uses.  Is this a problem?
    • Print heads: will be the printer alert us when they need to be replaced or should we look for quality defects?
    • Management of ink: before printing, the printer will be well estimate ink necessary for work and alert us if we need to insert the new cartridges before employment passes by?

    Thank you!

    Hello

    The recommendation is to keep it at any time.

    If you use the printer turns off completely the power button.

    When not in use, it will go in standby mode, wake up maintenance and sleep.

  • HELLO, I'M FACED WITH A PROBLEM WITH MY SECURITY QUESTIONS, I FORGOT THE ANSWERS AND NOW I CAN'T RESET, CAN YOU HELP ME?

    Hello

    I AM FACING A PROBLEM WITH MY SECURITY QUESTIONS.

    I FORGOT THE ANSWERS AND NOW I CAN'T RESET, CAN YOU HELP ME?

    Hello

    You will need to contact the Apple Support. (Nobody here can reset your security for you questions: it is a community based on the user, not the Apple Support).

    Contact information for the Apple Support:

    Contact Apple for assistance with the security of the Apple ID - Apple Support accounts

  • Question about batteries for laptops and a station (HP Elitebook 840)

    Hello

    I have a question for plagging the laptop to the docking station and battery, basically my main concern is not to connect to the laptop to run a/c, while it is fully charged and I'm always load only up to 100% and then when it reaches the minmum load then I connect it comes back to a/c, so my question here

    So do you think that that plug the laptop into the docking station will not decrease the duration of battery life because it will always be in charge mode?

    Thank you.

    After this announcement, I made a simple google image search with different keywords before 'docking and battery' and I found the following thread that answers my question

    Docking station ruin the battery?

    http://h30434.www3.HP.com/T5/notebook-hardware/is-docking-station-ruining-the-battery/TD-p/3249345

    Thank you rcspencer

    Thank you.

  • Yesterday, I asked a question on local binary operations, and I can't find it now!

    I asked a question on 8/25 the performance of binaries of html/xml using Hypertext and can not find the question on a forum or the page. I know that I'm not in the right place.

    Help

    Your question is number 866858.

Maybe you are looking for