Query execution over DB link

Hello people,
I did some research but with no usefull results.
I have a a query executing from 9i involing 3 tables, all in a remote 10g database.
My question is:
How do I figure out where the query is being executed local or remote?
Thank you in advance for your help.

You look at the query plan. The query plan will tell you what steps are being done locally and what steps are being done remotely.
Justin

Similar Messages

  • Execute procedure over db link

    I am trying to execute a stored procedure over database link and I get the following error
    DBMS_APPLY_ADM.SET_UPDATE_CONFLICT_HANDLER@DBCS(
    ERROR at line 12:
    ORA-06550: line 12, column 2:
    PLS-00306: wrong number or types of arguments in call to 'SET_UPDATE_CONFLICT_HA
    NDLER'
    ORA-06550: line 12, column 2:
    PL/SQL: Statement ignored
    However when I execute the same peice of code by logging on to the server the code executes successfully. "DBCS" is the database link name.
    CODE which I am executing over DB LINK
    DECLARE
    COL_NAME DBMS_UTILITY.NAME_ARRAY;
    CURSOR C1 IS
    SELECT COLUMN_NAME FROM ALL_TAB_COLUMNS WHERE OWNER='SCOTT' AND TABLE_NAME='DEPT';
    BEGIN
    OPEN C1;
    FETCH C1 BULK COLLECT INTO COL_NAME;
    CLOSE c1;
    DBMS_APPLY_ADM.SET_UPDATE_CONFLICT_HANDLER@DBCS(
    OBJECT_NAME => 'SCOTT.DEPT',
    METHOD_NAME => 'OVERWRITE',
    RESOLUTION_COLUMN => COL_NAME(1),
    COLUMN_LIST => COL_NAME);
    END;
    CODE without DB LINK (executed this on db where db link is pointing too.
    DECLARE
    COL_NAME DBMS_UTILITY.NAME_ARRAY;
    CURSOR C1 IS
    SELECT COLUMN_NAME FROM ALL_TAB_COLUMNS WHERE OWNER='SCOTT' AND TABLE_NAME='DEPT';
    BEGIN
    OPEN C1;
    FETCH C1 BULK COLLECT INTO COL_NAME;
    CLOSE c1;
    DBMS_APPLY_ADM.SET_UPDATE_CONFLICT_HANDLER(
    OBJECT_NAME => 'SCOTT.DEPT',
    METHOD_NAME => 'OVERWRITE',
    RESOLUTION_COLUMN => COL_NAME(1),
    COLUMN_LIST => COL_NAME);
    END;
    Please guide.

    orausern wrote:
    Hi,
    We are on Oracle 11.2.0.2 on Solaris 10. I have two databases on this version of Oracle. From one db I have execute a stored procedure via db link to another database. The store procedure has dynamic sqls (execute immediate) and it uses commit statement as part of the code. Is it alllowed to execute this procedure over db link? I am not aware on the implications on stored proc execution over db link and will be thankful for help.
    Thanks,if no error is thrown, why are you looking for problems where none exist?

  • Query slow across DB Link

    Hi,
    I have a query that fetches data across a db link. It was running smmothly earlier when the databases were in the same datacenter. But ever since the destination database moved to a separate datacenter, it has been very slow. Apart from the network, is there any way to speed up the query by tuning it?
    Please advice.
    Thanks

    When joining tables across a DB link, the optimizer may have to decide whether to pull all of the rows from the remote table over the link and join them locally, or send all of the rows from the local table across and join them remotely. The DRIVING_SITE hint can be used to influence this decision. Check the execution plan to see what is going on.

  • Facing problem in distributed queries over Oracle linked server

    Hi,
    I have a SQL Server 2005 x64 Standard Edition SP3 instance. On the instance, we had distributed (4 part) queries over an Oracle linked server running fine just a few hours back but now they have starting taking too long. They seem to work fine when OPENQUERY
    is used. Now I have a huge number of queries using the same mechanism and is not feasible for me to convert all queries to OPENQUERY, please help in getting this resolved.
    Thanks in advance.

    Hi Ashutosh,
    According to your description, you face performance issues with distributed queries and
    it is not feasible for you to convert all queries to
    OPENQUERY. To improve the performance, you could follow the solutions below:
    1. Make sure that you have a high-speed network between the local server and the linked server.
    2. Use driving_site hint. The driving site hint forces query execution to be done at a different site than the initiating instance. 
    This is done when the remote table is much larger than the local table and you want the work (join, sorting) done remotely to save the back-and-forth network traffic. In the following example, we use the driving_site hint to force the "work"
    to be done on the site where the huge table resides:
    select /*+DRIVING_SITE(h)*/
    ename
    from
    tiny_table t,
    huge_table@remote h
    where
    t.deptno = h.deptno;
    3. Use views. For instance, you could create a view on the remote site referencing the tables and call the remote view via the local view as the following example.
    create view local_cust as select * from cust@remote;
    4. Use procedural code. In some rare occasions it can be more efficient to replace a distributed query by procedural code, such as a PL/SQL procedure or a precompiler program.
    For more information about the process, please refer to the article:
    http://www.dba-oracle.com/t_sql_dblink_performance.htm
    Regards,
    Michelle Li

  • Interactive report performance problem over database link - Oracle Gateway

    Hello all;
    This is regarding a thread Interactive report performance problem over database link that was posted by Samo.
    The issue that I am facing is when I use Oracle function like (apex_item.check_box) the query slow down by 45 seconds.
    query like this: (due to sensitivity issue, I can not disclose real table name)
    SELECT apex_item.checkbox(1,b.col3)
    , a.col1
    , a.col2
    FROM table_one a
    , table_two b
    WHERE a.col3 = 12345
    AND a.col4 = 100
    AND b.col5 = a.col5
    table_one and table_two are remote tables (non-oracle) which are connected using Oracle Gateway.
    Now if I run above queries without apex_item.checkbox function the query return or response is less than a second but if I have apex_item.checkbox then the query run more than 30 seconds. I have resolved the issues by creating a collection but it’s not a good practice.
    I would like to get ideas from people how to resolve or speed-up the query?
    Any idea how to use sub-factoring for the above scenario? Or others method (creating view or materialized view are not an option).
    Thank you.
    Shaun S.

    Hi Shaun
    Okay, I have a million questions (could you tell me if both tables are from the same remote source, it looks like they're possibly not?), but let's just try some things first.
    By now you should understand the idea of what I termed 'sub-factoring' in a previous post. This is to do with using the WITH blah AS (SELECT... syntax. Now in most circumstances this 'materialises' the results of the inner select statement. This means that we 'get' the results then do something with them afterwards. It's a handy trick when dealing with remote sites as sometimes you want the remote database to do the work. The reason that I ask you to use the MATERIALIZE hint for testing is just to force this, in 99.99% of cases this can be removed later. Using the WITH statement is also handled differently to inline view like SELECT * FROM (SELECT... but the same result can be mimicked with a NO_MERGE hint.
    Looking at your case I would be interested to see what the explain plan and results would be for something like the following two statements (sorry - you're going have to check them, it's late!)
    WITH a AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_one),
    b AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_two),
    sourceqry AS
    (SELECT  b.col3 x
           , a.col1 y
           , a.col2 z
    FROM table_one a
        , table_two b
    WHERE a.col3 = 12345
    AND   a.col4 = 100
    AND   b.col5 = a.col5)
    SELECT apex_item.checkbox(1,x), y , z
    FROM sourceqry
    WITH a AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_one),
    b AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_two)
    SELECT  apex_item.checkbox(1,x), y , z
    FROM table_one a
        , table_two b
    WHERE a.col3 = 12345
    AND   a.col4 = 100
    AND   b.col5 = a.col5If the remote tables are at the same site, then you should have the same results. If they aren't you should get the same results but different to the original query.
    We aren't being told the real cardinality of the inners select here so the explain plan is distorted (this is normal for queries on remote and especially non-oracle sites). This hinders tuning normally but I don't think this is your problem at all. How many distinct values do you normally get of the column aliased 'x' and how many rows are normally returned in total? Also how are you testing response times, in APEX, SQL Developer, Toad SQLplus etc?
    Sorry for all the questions but it helps to answer the question, if I can.
    Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • Report over database link error

    Good morning all.
    I have a database link LINKA from USERA on LOCALSERVER to USERB on REMOTESERVER.
    (create database link LINKA connect to USERB identified by mypassword using validtns)
    In USERC on REMOTESERVER I have a TABLEX, with grant all on TABLEX to USERB on REMOTESERVER.
    In USERB on REMOTESERVER I have a view TABLEXV, select * from USERC.TABLEX
    From USERA on LOCALSERVER I can select * from TABLEXV@LINKA. In fact I can insert/update/delete tablexv from USERA.
    I also have a view TABLEXV on USERA, select * from TABLEXV@LINKA. I can also select/insert/update/delete from USERA.TABLEXV.
    So far so good - all working as expected.
    Then, my APEX app on LOCALSERVER, interactive report, parsing schema USERA, querying TABLEXV, I get the following:
    when "Exclude Link Column", I get the error "The requested URL /pls/apex/f was not found on server.
    when "Link to Single Row View", report displays correctly.
    when "Link to Custom Target", I get the error "The requested URL /pls/apex/f was not found on server.
    When I run the select * from TABLEXV as a regular report (i.e. not interactive), I also get the error.
    So the only time I get the report displayed correctly is using IR and "Link to Single Row View".
    However, clicking on the link (for Single Row View) I get "The requested URL /pls/apex/wwv_flow.show was not found on this server.".
    To summarize:
    - accessing table via view over database link
    - works outside of apex without issue
    - inside only works when Link to Single Row View set
    - But clicking on link fails
    I could live with just having the Link to Singe Row View option if I could disable displaying of the icon so that the user cant click on it.
    APEX 3.2.00.27
    EE Database - 10.2.0.3 (yes I know out of support)
    Remote EE Database - 10.2.0.5
    Real object names replaced to protect the innocent!
    Anyone got any clues?
    I have used remote tables many times in my APEX applications and never had this issue.
    Thanks,
    Rob @ very confused .com

    Good morning all.
    I have a database link LINKA from USERA on LOCALSERVER to USERB on REMOTESERVER.
    (create database link LINKA connect to USERB identified by mypassword using validtns)
    In USERC on REMOTESERVER I have a TABLEX, with grant all on TABLEX to USERB on REMOTESERVER.
    In USERB on REMOTESERVER I have a view TABLEXV, select * from USERC.TABLEX
    From USERA on LOCALSERVER I can select * from TABLEXV@LINKA. In fact I can insert/update/delete tablexv from USERA.
    I also have a view TABLEXV on USERA, select * from TABLEXV@LINKA. I can also select/insert/update/delete from USERA.TABLEXV.
    So far so good - all working as expected.
    Then, my APEX app on LOCALSERVER, interactive report, parsing schema USERA, querying TABLEXV, I get the following:
    when "Exclude Link Column", I get the error "The requested URL /pls/apex/f was not found on server.
    when "Link to Single Row View", report displays correctly.
    when "Link to Custom Target", I get the error "The requested URL /pls/apex/f was not found on server.
    When I run the select * from TABLEXV as a regular report (i.e. not interactive), I also get the error.
    So the only time I get the report displayed correctly is using IR and "Link to Single Row View".
    However, clicking on the link (for Single Row View) I get "The requested URL /pls/apex/wwv_flow.show was not found on this server.".
    To summarize:
    - accessing table via view over database link
    - works outside of apex without issue
    - inside only works when Link to Single Row View set
    - But clicking on link fails
    I could live with just having the Link to Singe Row View option if I could disable displaying of the icon so that the user cant click on it.
    APEX 3.2.00.27
    EE Database - 10.2.0.3 (yes I know out of support)
    Remote EE Database - 10.2.0.5
    Real object names replaced to protect the innocent!
    Anyone got any clues?
    I have used remote tables many times in my APEX applications and never had this issue.
    Thanks,
    Rob @ very confused .com

  • SSRS Error : Query execution failed for dataset 'dataSet'. (rsErrorExecutingCommand) Semantic query execution failed. Invalid object name 'RPT.*********'. (rsSemanticQueryEngineError)

    I am new to SSRS and I am trying to migrate reports from 2008 to 2012. As I have so many reports to migrate, I simply got the back up of ReportServer,
    ReportServerTempDB, and Encryption Key and restored them to test environment. I made necessary configuration from RS configuration tool. I am able to see the reports now when I browse //hostname/reports. But when I open any particular report I am getting some
    error.
    · An error has occurred during report processing.
    (rsProcessingAborted)
    Query execution       failed for dataset 'dataSet'.
          (rsErrorExecutingCommand
    Semantic query        execution failed. Invalid object name
           'RPT. ******'. (rsSemanticQueryEngineError)
    ****** - I am assuming this is a custom data class.
    Does anyone have insight on this? or any better way that I can migrate the reports to new server with less efforts.
    I don’t have the reports solution file to deploy the reports, so I have followed backup and restore process.

    Hi Kishore237,
    According to your description, you migrated some reports from Reporting Services (SSRS) 2008 to 2012. Now you get error when accessing the reports on SSRS 2012. Right?
    In this scenario, did you modify the report data source in database after migration? You can try to open the report in Report Builder or Report designer and check the report dataset. If you can preview the report in Report builder or Report designer,
    please try to redeploy the report to Report Server. If it is still not working, please try to restore the database from backup. And for migrating reports, please follow the "Content-Only Migration" in the link below:
    http://msdn.microsoft.com/en-us/library/ms143724(v=sql.110).aspx
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Steps involved in Query execution

    Can anyone please suggest the exact steps that take place in a query execution. I know on the broad level. But I want to know to basic level. For example we would like to know all the steps that an OLAP processor does to get the data, process it and then send it for display.
    Also, say the total time taken for the query execution is xx msec, we would like to know the complete break up of this time for all the activities that are completed from the time of query execution till the display of result.
    Thanks

    Hi Suchitra,
    Please go through these links:
    /people/vikash.agrawal/blog/2006/04/26/in-what-147sequence148-olap-processor-look-for-query-relevant-data
    /people/prakash.darji/blog/2006/01/26/query-optimization
    Assign points if helpful
    Thanks,
    Amith

  • Query Execution Filter Val. Selection take no effect on query based on AG

    Hi,
    by setting the 'Query Execution Filter Val. Selection' property in query, we can control the value list when we execute the query. with setting 'Only posted value values for navigation', only the data posted to cube can be listed when you do the selection in the Query Execution selection screen and with setting 'values in master data table', all the date will be listed when you do the selection in the Query Execution selection screen.
    1. but for queries based on cube or multi-cube, when i select 'values in master data table' in query defination, still only the posted value is displayed when i do the selection in the Query Execution selection screen. is there anyone know why?
    2. for queries based on aggregation level, whatever setting i choose, all the values is displayed when i do the selection in the Query Execution selection screen. how i can do select the posted value for this kind of query?
    Many Thanks
    Jonathan

    I apologize I meant the other link:
    I will put the useful text from that link here.
    Regarding the query built on aggregation level please note the following
    the aggregation level is always a Virtual Provider built other
    InfoProvider and hence it does not have the dimension table and hence
    the F4 mode D is not supported.
    Therefore when aggregation level is used in a query, F4 does not supportD-mode: 'Only Values in InfoProvider' and all master data values are
    displayed in the value list.
    Reference from the note
    984229 F4 modes for input help as of SAP NetWeaver 2004s BI
    4. Since other InfoProviders do not have a dimension table, the system
    displays only posted values if you select "Only Posted Values for
    Navigation". Otherwise, it displays the values from the master data
    table.
    Hope this should clarify your doubts. Please let me know if you have
    questions else please confirm the message at your earliest convenie
    Edited by: Abhijit N on Apr 2, 2009 6:06 PM

  • Finding number of working days during query execution

    Hi ,
    We have a requirement to calculate number of working days during query execution. In the cube we got "received date", this will be used as a variable in the query. Based on the received date value entered, query needs to display number of products received from past 1, 2,3,4 days (working days should include weekends or public holidays).
    1day     2 days     3 days     4 days   5 days 
    10         12            20            15          20
    to me it appears as I need to create virtual key figures.
    Regards,
    Ramz

    Hi ramesh,
    First try to create formula variables for start data and end date to calculate the no of working days.
    Create a Variable ZSTDT --of type replacement path.
    Type of Variable = Formula
    Variable Name = ZSTDT
    Characteristic = <info object>
    For Intervals Use = Select From Value
    Offset Start = 0000 Offset Length = 0000
    Replacement var with : key
    use the same steps to create one more formula variable to get end date.
    Now create a formula to get the No of days.
    once after getting no of days you can create buckets as per your need.
    for more info check the below links
    http://www.sd-solutions.com/SAP-HCM-BW-Replacement-Path-Variables.html
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30f15839-0cf1-2b10-c6a7-ebe68cc87cdc?quicklink=index&overridelayout=true

  • Query Execution plan

    Hi,
    I have a question about reading query execution plans. I don't understand what is meant by "Hash join" in a plan step. I understand "Nested_Loops" and "Merge_Join", but after looking at different documentations, I am still not clear about "Hash_Join". Please don't give links to Oracle documentation, because I have seen a lot of it, but it is still not clear. I also don't fully understand what is meant by a "Hash Table", what are all these "Hashesssssss"???
    Please explain in your own words, if possible, and with the help of some example.
    Thanks in Advance.,

    user566817 wrote:
    Can any one else answer my question? I would be highly thankful.Hash joins are one of the 3 techniques used by Oracle to join to sets of data.
    As a brief, and very very crude overview
    Generally after applying the filter to one data source, the join key is hashed into a memory table (as described by link sb provided). The second data set areas filtered and it's join key is also hashed, but the hash is used to find matches in the memory table created by the first data source. Assuming no hash chaining, found matches are joins; if hassh chaining exists, the chain needs to be traversed to verify joins.
    This, of course, has a lot of holes which would be filled in by the documentation and by external links that you do not seem to want to use.
    (Remember: School papers need to cite references. Teachers these days DO check.)

  • Oracle View that stores the Query execution time

    Hi Gurus
    i m using Oracle 10G in Unix. I wudiold like to know which Data dictionary view stores the execution of a query. If it is not stored then hw to find the query execution time other than (Set timing on) command. What is the use of elapsed time and what is the difference between execution time and elapsed time? How to calculate the execution time of a query.
    THanks
    Ram

    If you have a specific query you're going to run in SQL*Plus, just do
    a 'set timing on' before you execute the query.
    If you've got application SQL coming in from all over the place, you can
    identify specific SQL in V$SQL/ and look at ELAPSED_TIME/EXECUTIONS
    to get an average elapsed time.
    If you've got an application running SQL, and you need to know the
    specific timing of a specific execution (as opposed to an average),
    you can use DBMS_SUPPORT to set trace in the session that your
    application is running in, and then use TkProf to process the resulting
    trace file.

  • Slow query execution time

    Hi,
    I have a query which fetches around 100 records from a table which has approximately 30 million records. Unfortunately, I have to use the same table and can't go ahead with a new table.
    The query executes within a second from RapidSQL. The problem I'm facing is it takes more than 10 minutes when I run it through the Java application. It doesn't throw any exceptions, it executes properly.
    The query:
    SELECT aaa, bbb, SUM(ccc), SUM(ddd), etc
    FROM MyTable
    WHERE SomeDate= date_entered_by_user  AND SomeString IN ("aaa","bbb")
    GROUP BY aaa,bbbI have an existing clustered index on SomeDate and SomeString fields.
    To check I replaced the where clause with
    WHERE SomeDate= date_entered_by_user  AND SomeString = "aaa"No improvements.
    What could be the problem?
    Thank you,
    Lobo

    It's hard for me to see how a stored proc will address this problem. I don't think it changes anything. Can you explain? The problem is slow query execution time. One way to speed up the execution time inside the RDBMS is to streamline the internal operations inside the interpreter.
    When the engine receives a command to execute a SQL statement, it does a few things before actually executing the statement. These things take time. First, it checks to make sure there are no syntax errors in the SQL statement. Second, it checks to make sure all of the tables, columns and relationships "are in order." Third, it formulates an execution plan. This last step takes the most time out of the three. But, they all take time. The speed of these processes may vary from product to product.
    When you create a stored procedure in a RDBMS, the processes above occur when you create the procedure. Most importantly, once an execution plan is created it is stored and reused whenever the stored procedure is ran. So, whenever an application calls the stored procedure, the execution plan has already been created. The engine does not have to anaylze the SELECT|INSERT|UPDATE|DELETE statements and create the plan (over and over again).
    The stored execution plan will enable the engine to execute the query faster.
    />

  • BI SDK/XMLA (MDX) - Does the query execution go through SAP BI Accelerator?

    Environment : Portal - EP7.0 SPS 14, BI 7.0 SPS17
    I have written customer report views which uses the BI SDK to execute BI querries through the portal.
    Following link provides the detail about configuring the portal to access the BI system and execute queries through XMLA which used MDX statements on the BI system...
    http://help.sap.com/saphelp_nw04s/helpdata/en/ba/e380e03c3a4dbf8cf082f0c910f9cf/frameset.htm
    Does the the BI XMLA interface go though the SAP BI Accelerator to speed up query execution? I have provided the link below about SAP BI Accelerator...
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3604c604-0901-0010-f0aa-b37378495537
    If the answer is yes, how do I prove it?
    Any help is really appreciated.
    Thanks
    Bhabesh Patel

    You prove it because SAP said so:
    /docs/DOC-7992#section7
    just kidding
    You can also run an ST05 trace (with RFC on) and look for the RFC call TREX_RFC_AGGREGATE_SP5

  • Methods to reduce query execution time

    hi experts
                  can anybody sugest the steps /methods to reduce the time taken for query execution
    Thanks and regards
    Pradeep

    Hi Pradeep.........
    I think u hav already posted a similar thread.........
    query and load performance steps
    Anyways also check these notes......
    SAP Note : 557870............ 'FAQ BW Query Performance'
    567746 'Composite note BW 3.x performance Query and Web'.
    How to design a good query........
    /people/prakash.darji/blog/2006/01/27/query-creation-checklist
    /people/prakash.darji/blog/2006/01/26/query-optimization
    Also Check this.......
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cccad390-0201-0010-5093-fd9ec8157802
    Business Intelligence Performance Tuning [original link is broken]
    Query Performance Improvement Tools
    Query Performance Improvement Tools
    Regards,
    Debjani........

Maybe you are looking for

  • Installing itunes on my pc using windows 7 makes the disc drives disappear

    does anyone have a fix for this? I'm using a pc with windows 7, used to be able to uninstall itunes and the drives would reappear, now that doesn't work so I have no disc drives. Have tried everything (my computer friend has, for me) including a new

  • Compressor won't save a whole file.

    I'm editing a small music video for a friend, and he sent me an mp3 to edit to until he can get me a higher-quality track for the audio. The problem I'm having is that I've attempted to up-convert the mp3 to a 48kHz AIFF file, and it completely loppe

  • App Crash with Lightroom 4.2

    Why am I getting app crashes while using LR 4.2?  I just installed the 4.2 update on Sept 3rd and already have had three crashes inside first day's use.   Crash details:  "1st crash" Problem signature: Problem Event Name:     APPCRASH Application Nam

  • Issue of multiple Application servers

    I have a report which submits 5 reports(with Return ) inside it. Now if I have multiple application server then I do not know which server the job will get submitted and currently in my landscape the synchronisation time between the servers is 2 mins

  • Mac OS X Leopard Backup Software?

    I'm currently using Intego Personal Backup X4 and although it's fairly reliable, it's pretty darn slow. What easy-to-use professional backup software do most Mac users prefer.