repeatly the SQL Analysis

Hi, I think that my question is not good for the last message. If I raise this issue once again. If there is an SQL statement, repeatly analysis, what should I do? use some Advisory utilities? what I think, is that the pool has a structure called library cache that stores parsed SQL. If there is a SQL Analysis repeatly, he can because the library cache is may not be big enough. right? or could someone help me for more detailed information.
Thank you very much

A few things to think about when it comes to analysis.

First, it is impossible to change the frequency of analysis (analysis call rate) without changing the application. An analysis that happens when the application performs a db call PARSE(). Period.

So, if you have an application that submits SQLs such as:

select id from some_tab where id2=1;
select id from some_tab where id2=2;
select id from some_tab where id2=3;
select id from some_tab where id2=4;
select id from some_tab where id2=5;

Each SQL statement is unique, and therefore needs to be analysed. If you can modify your application to use bind variables, you can do something like:

select id from some_tab where id1 = :b1;

Then, even if it is parsed every time, Oracle will see it is cached in the cache of the library, and a large part of the work of the analysis is eliminated. Also, if you look at establishing a session (by the parameter session_cached_cursors) cursor cache, you can further reduce the impact of a soft analysis.

But all this doesn't actually change the number of analysis going on. The only way to do that is to change the code.

If you have a code that looks like:

for x = 1 to 50
do
  parse()
  bind()
  execute()
done

You could reduce the calls of the practice analysis:

parse()
for x = 1 to 50
do
bind()
execute()
done

If it is available for you, it's a much better solution than relying on the soft analysis mechanism for Oracle.

Finally, in the worst case, if you have an application that uses not connections, and you do not have access to modify the application, you will rely on the sharing of the cursor. Cursor sharing automatically takes out of your not shareable SQL literals and allows a set of SQL. This should really be considered as a last resort and only when you have not any access or any occasion of difficulty of enforcement.

I'm not in a lot of detail on the use of cursor sharing or in the session cursor cache, especially cause this message is already too long.

Hope that helps,

-Mark

Tags: Database

Similar Questions

  • the sql analysis

    assuming that the following data

    name, type, amt
    YYYY, 1111, 50
    YYYY, 2222, 100,.
    bbbb, 1111, 30
    CCCC, 2222, 35


    How can I create a sql that returns the line only if type 1111 and 2222 exist if group by name?

    Try this.

    select name, type, amt
      from (
    select name, type, amt, count(distinct type) over(partition by name) cnt
      from 
     where type in (1111,2222)
             )
     where cnt >= 2
  • How to analysis of the XML in the sql statement?

    Hi friends, I have a table that contains a column of type CLOB, stores in xml format. For example, the data are like that

    <Employees xmlns="http://TargetNamespace.com/read_emp">
       <C1>106</C1>
       <C2>Harish</C2>
       <C3>1998-05-12</C3>
       <C4>HR</C4>
       <C5>1600</C5>
       <C6>10</C6>
    </Employees>
    
    

    So how can I write the sql statement for the analysis of the data at the top

    create or replace procedure parsing_xml

    (

    clob trans_payload

    trans_dir varchar2

    )

    as

    Start

    if(trans_dir='inbound/emp')

    then

    insert into emp_proj

    (

    employee_id

    last_name

    hire_date

    job_id

    salary

    department_id

    )

    Select t1.c1

    t1.c2

    t1.c3

    t1.c4

    t1.c5

    t1.c6

    from xmltable

    (

    XmlNamespaces ('http://TargetNamespace.com/read_emp' as 'emp').

    ' / ' emp:Employees by the way of xmltype (trans_payload)

    columns

    whole path of C1 'emp:C1. "

    path of varchar2 (10) C2 'emp:C2. "

    C3 varchar2 (10) path "emp:C3."

    C4 varchar2 (10) path "emp:C4."

    whole path of C5 "emp:C5."

    C6 varchar2 (10) path 'emp:C6 '.

    ) t1;

    end if;

    commit;

    end;

  • Using the SQL workshop APEX_INSTANCE_ADMIN

    I'm on 5 APEX. I need to leave my user access to system change electronic/SMTP mail settings in my workspace without giving them access to the admin area pages work. I see there are the built APEX_INSTANCE_ADMIN.set_parameter, but I needed to let them run it from the SQL builder APEX (not in SQLplus under sys) workshop. I gave APEX_ADMIN_ROLE to my analysis schema. Is this possible? I tried and could not make it work.


    Start

    run immediately "ALTER SESSION SET CURRENT_SCHEMA = APEX_050000';"

    APEX_INSTANCE_ADMIN. SET_PARAMETER('SMTP_HOST_ADDRESS','localhost');

    end;

    ORA-06550: line 3, column 1: PLS-00201: identifier 'APEX_INSTANCE_ADMIN' must be declared ORA-06550: line 3, column 1: PL/SQL: statement ignored


    Thank you

    I tested it on my case, that's what I did:

    (1) as SYS:

    grant APEX_ADMINISTRATOR_ROLE to demo;
    

    2) log in as demo schema and run an APEX_INSTANCE_ADMIN:

    BEGIN
        APEX_INSTANCE_ADMIN.ADD_WORKSPACE (
            p_workspace_id       => 12121212,
            p_workspace          => 'DEMO_WORKSPACE',
            p_primary_schema     => 'DEMO',
            p_additional_schemas => 'DEMO' );
    END;
    

    A successful!

    When I revoke the grant with: revoke APEX_ADMINISTRATOR_ROLE of demonstration;

    The statement was not successful:

    BEGIN
        APEX_INSTANCE_ADMIN.ADD_WORKSPACE (
            p_workspace_id       => 12121212,
            p_workspace          => 'DEMO_WORKSPACE',
            p_primary_schema     => 'DEMO',
            p_additional_schemas => 'DEMO' );
    END;
    ORA-06550: line 2, column 5:
    PLS-00201: identifier 'APEX_INSTANCE_ADMIN' must be declared
    ORA-06550: line 2, column 5:
    PL/SQL: Statement ignored
    

    Did you completely remove your line of code "immediate execution"?

    Concerning

    Daniel

  • Address of the instantiation of the cursor in the SQL trace files &gt; = 11.2.0.2

    Oracle Doc ID 11677061.8 mentions in 11.2.0.2 10046 trace / SQL_TRACE displays the address of the instantiation after the # rather than the number of cursor.

    Can someone explain what a "address instantiation" is and how to use it to identify the sliders in the trace of the files in an improvement on number of cursor.

    I have a theory that it may be useful when dealing with accumulated from several trace files using trcsess trace data.

    For the most part, I'm just curious to see if I can improve my performance skills by exploiting this change.  I can't find a single reference in the article or the blog describing the change.

    An example of the largest number of cursor that I see these days.

    PARSING IN CURSOR #48003855878616 len=65 dep=0 uid=370 oct=6 lid=370 tim=1366907498174148 hv=1477430740 ad='209f99a028' sqlid='40hwrntc0zmfn'

    ANALYSIS #48003855878616:c = 0, e = 4842, p = 0, cr = 0, cu = 0, set = 0, r = 0, dep = 0, og = 1, plh = 0, tim = 1366907498174146


    Pre 11.2.0.2 what it would look like


    PARSING IN CURSOR #3 len=65 dep=0 uid=370 oct=6 lid=370 tim=1366907498174148 hv=1477430740 ad='209f99a028' sqlid='40hwrntc0zmfn'

    ANALYSIS # 3: c = 0, e = 4842, p = 0, cr = 0, cu = 0, = 0, r = 0, dep = 0, og = 1, plh = 0, tim = 1366907498174146



    Here's what I read on the subject in 2010:

    The problem is that with the restructured cursor caching in 11g a statement executed again would come by number of different cursor for each run. As the number of cursor and the sqltext did not since the last use of the slider, the sqltext was printed for each execution of a cursor. It's a significant problem for applications like Oracle E-Business, where is typical SQL statement it is many thousands of characters. In some cases, this has increased the size of the file trace of an order of magnitude, and I'm sure it could be even worse.

    The solution was to pass the handle of the cached cursor (which is probably the address) and display instead of the cursor number. This should mean that the text is printed only on the first analysis of the SQL statement and the size of the trace file goes back to something reasonable.

    I believe you can "join" these new id values cursor from a trace file in a column of address in v$ sql, but I have not checked myself.

    I do not think that the change was intended to give the advantage of trcsess you are suspect, but it could turn out to be useful for this.

  • any case when and the sql clause

    Hello:
    What follows is my sql clause:
    SELECT T.*, b.name
    OF dbtest1 t
    LEFT OUTER JOIN dbtest b ON t.NO = b.empno
    WHERE t.ChineseName like '% "| : ChineseName | ' %' AND b.name like "%" | : name | » %'
    ORDER BY t.ChineseName

    The main problem is that I want to check the b.name if it is null, it can be passed as function NVL, so I try using case when, but it does not work.
    When there are the b.name in where clause, the columns of result will not include data without b.name (or implies the b.name is NULL); And that
    the result data are not entirely accurate.
    is it possible to use the case when it is implemented in the following code snippet:

    -case when b.name is not NULL then b.name like "%" | : name | » %'
    Else b.name = NULL (b.name = b.name does not seem to work on the analysis of data zero)
    end

    Thank you very much.

    962769 wrote:
    The main problem is the table is the form of the cross, and the like clause will filter the
    data without a name. Basically, it should show the empty columns, however, it won't.
    so, when I test the sql code, I fhound Like "%" | b.Name | ' %' will not get the data when the original dbtest1 table data
    has no id corresponding to the BD test. It seems pointless to go the LEFT OUTER JOIN.

    Thank you

    WHERE t.ChineseName like '%'||:ChineseName||'%'
    AND  (
            b.name like '%'||:name||'%'
           or b.empno is null
        )
    
  • Get the SQL execution plan that is currently running in 9i

    Hello

    Apologies for the magnitude of this issue, but I was wondering if someone could help me to the more accurate/efficient way to get a piece of running Oracle 9i SQL execution plan.

    in 10g and 11g of course dbms_xplan.display_cursor (sql_id) can be used.

    How can this be achieved in 9i, currently I am just get the SQL_TEXT and then executing a plan to explain ("EXPLAIN PLAN for.") - I think that this is not neccesserally the same plan to explain that will be used for the sql code that runs if

    Any help would be appreciated.

    Thank you

    The plan exists after analysis difficult.
    Statistics of actual execution will require a completed.
    That is why sql followed in real time is so great in 11g.
    In 9i, difficult.

  • Use of the SQL Server Agent

    Hello

    Lack of VMWare VirtualCenter Server 2.5.0.64207 on a Windows 2003 R2 SP2, SQL Server 2005 System. It is the only significant application on the system, and VirtualCenterDB is the only database.

    We see that the system is running very slowly, both regarding the response time in the Console of the Infrastructure of VMWare and the response time for all other programs that you happen to run. For example, the MMC administration tools take a long time to start or respond to clicks.

    PerfMon shows fairly low CPU usage, but the queue of average drive about 170.

    However, the problem disappears if we stop the SQL Server Agent service. The average disk queue goes down to about 2.

    I don't want to always leave the SQL Server Agent is turned off, because it is necessary to perform periodic maintenance. Is there a way to tell why the readers of SQL Server Agent use so much disk space?  Given that VirtualCenterDB is our unique database, I suspect that the problem is specific to VMWare.

    Thanks in advance for your suggestions.

    These jobs move data from system of VPX_HIST_STAT1 to VPX_HIST_STAT2 then VPX_HIST_STAT3 then VPX_HIST_STAT4 and finally remove the data from your database.   These tables to the expectations of the performance data for your hosts and virtual machines and jobs here correspond to the data of the basic performance levels than your game in the VI client when connected to your vCenter server.  It is important to keep these tasks to make sure that your weekly, monthly and annual data are properly maintained.

    You have a database maintenance task that rebuilt the index?  If this isn't the case, then it is perhaps probably caused performance issues.  Without up-to-date indexes, SQL Server will be compelled to resort to analysis of tables when looking for data that can significantly increase the disk i/o.

  • How to force a return, even if the sql cannot find a record

    Hello
    I ' l try explan, what I'm looking for:
    I have a SQL query (Oracle 10 g) as

    Select system, A, B T where system = 0

    In the table T is no record with system = 0, so I don't get anything back from the SQL. It's OK, but I need to get something like * 0, "," * as a return. I tried with NVL(SysT,0)... but it seems not to be the solution.

    Does anyone has an idea how to solve this problem?

    Best regards
    Carsten

    Hi, Carsten,

    Another way to do this is to use an outer join:

    SELECT  0 AS SysT, a, b
    FROM               dual
    LEFT OUTER JOIN  t    ON  t.SysT  = 0
    ;
    

    UNION, Saurabh suggested, is a way to do it. If the combination (System, a, b) is not unique in table t, then you need to make UNION ALL , which is more efficient anyway, to avoid losing lines.
    If the original query is longer than what you have posted, you will not want to repeat. Write it only once, in a WITH clause, like this:

    WITH       original_query     AS
    (
         SELECT  SysT, a, b
         FROM      t
         WHERE      SysT     = 0
    )
    SELECT     *
    FROM     origianl_query
        UNION ALL
    SELECT     0 AS SysT, a, b
    FROM     dual
    WHERE     NOT EXISTS  (
                          SELECT     1
                   FROM     original_query
                      )
    ;
    

    Regardless of how complicated the original query, the EXISTS subquery is just 'SELECT 1 FROM original_query '.

    Published by: Frank Kulash, December 19, 2011 06:21

  • How the SQL statement

    In an interview, no one asked me a question. How the sql statement
    ex: select * from emp;

    I answered him as if the select statement is in the library cache then it will retrieve data from the cache, otherwise it will retrieve data from database files. On this, he asked to go. I could not years itself. Anyone like elobarate me on the analysis?

    SMON,

    I would have preferred the official documents from Oracle, as suggested by

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e16508/sqllangu.htm#CHDFCAGA

    Concerning
    Peter

  • Repeat the TDs instead of TRs?

    I'm trying to convert my site from GoLive to Dreamweaver. I am there among them now to transform the dynamic aspects of PHP/SQL of some pages. The problem, I now try to repeat the data found in the cells of a table rather than whole lines of a table.

    Here is my page in GoLive, old I just used the GL built in beautiful ways for making dynamic pages, I don't remember even how I did it was so long. Link

    Here's the new page in Dreamweaver, I can't understand in Dreamweaver how to repeat the results in table cells, 4 cells per line. Link

    Thank you in advance.

    Quote:
    Posted by: newsgroup user
    You would either have to hand code it, or use a nested repeated region (a
    which is repeated four times and then starts a new line). Tom Muck has a
    for this extension, I think - http://www.tommuck.com

    Thank you, I never would have found something like this. I'll give the Horizontal Looper to try.

  • Performance problem on the SQL query that does not use the primary key index

    Hello!

    I have some performance issues on a single SQL query (Oracle 10 g).
    I could solve the problem by using the INDEX indicator, but I would like to know WHY this is happening.

    * Tables *.
    create table jobs)
    ID number (5) not null,
    name varchar2 (100),
    primary key constraint Job_PK (id)
    )
    /
    -Record count: 298

    create table Comp)
    integer ID not null,
    name varchar2 (100),
    primary key constraint Comp_PK (id)
    )
    /
    -Record count: 193

    -Relation m: n
    create table JobComp)
    integer ID not null,
    id_job integer not null,
    id_comp integer not null,
    primary key constraint JobComp_PK (id),
    unique key constraint JobComp_UK (id_job, id_comp),
    Constraint JobComp_FK_Job foreign key (id_job) refers to Job (id),
    Constraint JobComp_FK_Comp foreign key (id_comp) makes reference Comp (id)
    )
    /
    create index JobComp_IX_Comp on JobComp (Cod_Comp)
    /
    create index JobComp_IX_Job on JobComp (Cod_Job)
    /
    -Record count: 6431

    * Ask *.

    When I run this query, the execution plan shows the index using (JobComp_PK and JobComp_IX_Comp).
    No problem.

    Select JobComp.*
    of JobComp
    Join jobs
    on Job.id = JobComp.id_job
    where JobComp.id_comp = 134
    /
    -runs in 0.20 sec

    But when I add the field 'name' of the work table the plan uses full access table to the table of work

    Select JobComp.*, Job.name
    of JobComp
    Join jobs
    on Job.id = JobComp.id_job
    where JobComp.id_comp = 134
    /
    -runs in the 2.70 dry

    With the help of the index

    Select / * + INDEX (Job Job_PK) * /.
    JobComp.*, Job.name
    of JobComp
    Join jobs
    on Job.id = JobComp.id_job
    where JobComp.id_comp = 134
    /
    -runs in 0.20 sec

    * Doubt *.

    This behavior is correct?

    PS. : I tried to recalculate the statistics, but nothing changes:

    analyze the job calculation table statistics.
    /
    change the statistical calculation of index Job_PK reconstruction;
    /
    Start
    dbms_utility.analyze_schema (sys_context ('userenv', 'current_schema'), 'CALCULATE');
    end;
    /

    [of]
    Gustavo Ehrhardt

    Gus.EHR wrote:
    Hello.
    I'm sorry for the plan unformatted.
    The execution time of the querys "without field name' and 'with the field name with suspicion" are equal.
    He has no problem caching, because I get the plans of the sequence different from the querys and repeated the performance. The result is always the same.

    I don't think that there is no problem with oracle crossing LOOP IMBRIQUEE to the HASH JOIN when you include the field name and this should be the expected behavior. But it seems that your WORKING table has a degree of parallelism set against what is causing the query to run in parallel (as JOB table is now available with full table scan, instead of indexed access earlier). It could be that the parallel execution is contributor to extra Runtime.
    (a) do you know why the degree of parallelism on the WORK table has been defined? Do you need it?

    You can see if the following query provides a better response time?

    select /*+ NOPARALLEL(JOB) */ JobComp.*, Job.Name
      from JobComp
      join Job
        on Job.id = JobComp.id_job
     where JobComp.id_comp = 134
    
  • How to detect the SQL type to avoid SQL injection

    Hello

    I work in a company of gsm and we develop a program for analysis of trends. Users of this program can write SQL statements. I want to write sql statements specific as my program input statement (SELECT... from...). Instructions to SELECT most. I have dynamic SQL and PL/SQL blocks in my program. I get user-defined SQL statements and execute dynamic Sql code.

    Here's the problem: I need to understant what type of SQL, they give as my program input parameter to avoid wrong operations (DELETE, TRUNCATE, DROP...)

    First of all I thought to the RegExp to understant if a SELECT SQL or SQL DELETE...

    Is there a recommended on this problem? Oracle has any procedure to detect?

    Thank you

    Hi a_yavuz,

    We had to solve the same problem while we work a project that receives user sql statements, we check the sql as follows:

    lb_bool: = regexp_like (upper (pv_sql),'^ (-() * *(SELECT|))) (WITH)');

  • My playlists on apple music continues to repeat the first progress song and custom to the next song

    My playlists on apple music continues to repeat the first progress song and custom to the next song

    Hi, tabby1008!

    Thanks a lot for the use of Community Support from Apple! After reading your post, I understand that when you listen to music from Apple, one song keeps repeating instead of skip to the next track, when it finishes. I wouldn't listen to the same song over and over again when Apple's music catalog is so big, so I'm happy to help you!

    First of all, check that the "repeat" feature is not enabled. The following article gives some information about the feature 'repeat' and what to look for.

    Use of music music Apple in the app

    The "Shuffle and repeat your music" section provides this information:

    Shuffle or repeat your music

    Press on at the bottom of the playback screen to mix songs in a playlist or album. Alternatively, you can ask Siri to scramble your music.

    Type once to play entire playlist or album looped or twice to repeat a song.

    When activated, the icon for a repetition will be "BOLD". If this is the case, type just the icon to activate the recurrence at the wide. The next page of this article will show you where these buttons:

    If the repeat function is turned off, try closing the music app using the steps described in the article below.

    Force a nearby application on your iPhone, iPad or iPod touch

    Once the music app is closed, press the icon to open it again and then try to play your songs. If one is always repeat, restart the device. Instructions on the way can be found in the following article.

    Restart your iPhone, iPad or iPod touch

    Good listening!

  • Why Notes continue to repeat the files all the time

    Whenever I have start a new file in the Notes, he continues to repeat the file whenever I tap on a button

    Please, back up all data before proceeding.

    Check the accounts of the Internet or the preferences Panel Mail, Contacts and calendar to make sure that you do not synchronize Notes in more than one account.

    If you aren't the case, temporarily disable the synchronization of Notes. The notes will remain on the server and other devices, as appropriate.

    Leave Notes, if it is running.

    Triple-click anywhere in the line below on this page to select this option:

    ~/Library/Containers/com.apple.Notes

    Copy the line of text to the Clipboard by pressing Control-C key combination.

    In the Finder, select

    Go ▹ go to folder

    in the menu bar. Paste in the box that opens by pressing Command + V, then press return. A Finder window should open a selected folder. If this is the case, move the selected folder - not only its content - on the desktop.

    The folder you are moving is called 'com.apple.Notes', it is not the subfolder named 'Data' or anything else.

    ATTENTION: If you move all or part of the contents of the selected folder, but leave the folder itself, the application cannot start. Move the entire folder will be be rebuilt automatically.

    If you use OS X 10.11 ("El Capitan") or later, repeat with this line:

    ~/Library/Group Containers/group.com.apple.notes

    Re-enable synchronization of Notes.

    Notes to restart and test. If it works now, delete the files that you moved. Otherwise, leave again and put each backrest where she was, by crushing the that may have been created in its place.

  • Maybe you are looking for