How to reduce time when updating table with join of anther table

Hi all,
I am update table Policy1 using another table from other scheme
Policy1 is in schema "TEST".
TRN_POLICY_RISK_GIS is in Schema "TEST2".
Now i am executing my query which is taking lot of time to update and make cpu utilization upto 45%.
update policy1 set total_si = (select total_is from (select pol_sys_id,
avg(nvl(pol_cvr_si,0)) total_si from TEST2.TRN_POLICY_COVER_GIS tpcg
group by pol_sys_id ) b where p.pol_sys_id = b.pol_sys_id)
Help to optimize to given query.

update policy1    A
    set total_si =
       (select avg(nvl(pol_cvr_si,0))
           from TEST2.TRN_POLICY_COVER_GIS    B
          where B.pol_sys_id = A.pol_sys_id
;hopefully there is an index on TEST2.TRN_POLICY_COVER_GIS (POL_SYS_ID)

Similar Messages

  • Hello, I have a iPod touch 4g,last time when I paired with my friends iPhone it showed his iPhone's name along with devices connected earlier in the bluetooth list after I updated my software to ios 5.1 the names of friends devices appear as D1:FG:12:13..

    Hello,
    I have a iPod touch 4g,last time when I paired with my friends iPhone it showed his iPhone's name along with devices connected earlier in the bluetooth list after I updated my software to ios 5.1 the names of friends devices appear as D1:FG:12:13:AK something like that and all the other previously connected devices appear in this same form in the bluetooth list how do I fix this back and it is confusing to connect to a device with no name but some unknown Bluetooth address so how do I find the device name back????
    SO PLEAZZZZZ HELP!!!!!

    An iPod can only pair with an iPhone for internet sharing provided that the iPhone has the subscribed to the tethering plan. The BT profiles do not permit file tansfer between IDevices by BT. The only BT pairsin is by app and those ar for peer-to-peer gaming.

  • Update statement with joining other tables

    Hi ,
    I have two table one is containing xml file , basically i need to read from those xml file then update to another table based on some condition.
    UPDATE TRCB_XBRL_STG_2 STG
    SET PROFIT =
      case when xbrl.isconsolidatedacc='Y' and EXTRACTVALUE(XBRL.XBRLFILE,'//PROFIT ', 'xmlns:acra="..."') is not null
      THEN EXTRACTVALUE(XBRL.XBRLFILE,'//PROFIT ', 'xmlns:acra="..."')
      WHEN XBRL.ISCONSOLIDATEDACC='N' AND EXTRACTVALUE(XBRL.XBRLFILE,'//PROFIT ', 'xmlns:acra="..') IS NOT NULL
      THEN extractValue(XBRL.xbrlfile,'//PROFIT ', 'xmlns:acra=".."')
      ELSE STG.PROFIT
      END,
      SET REVENUE=
      case when xbrl.isconsolidatedacc='Y' and EXTRACTVALUE(XBRL.XBRLFILE,'//REVENUE', 'xmlns:acra="..."') is not null
      THEN EXTRACTVALUE(XBRL.XBRLFILE,'//REVENUE.', 'xmlns:acra="..."')
      WHEN XBRL.ISCONSOLIDATEDACC='N' AND EXTRACTVALUE(XBRL.XBRLFILE,'//REVENUE', 'xmlns:acra="..') IS NOT NULL
      THEN extractValue(XBRL.xbrlfile,'//REVENUE', 'xmlns:acra="REVENUE"')
      ELSE STG.REVENUE
      END,
      ... (around 100 columns)
    FROM  TRCB_XBRL xbrl ,TRCB_XBRL_STG_2 STG
    WHERE STG.XBRL_ID = XBRL.XBRL_ID Number of columns are around 100 , please anyone suggest how to use update statement with joining two tables.

    Hi,
    If all the values needed to update a given row of table_x are coming from the same row of table_y (or from the same row of a result set of a query involving any number of tables), then you can do something like this:
    UPDATE  table_x  x
    SET     (col1, col2, col3, ...)
    =     (
             SELECT  NVL (y.col1, x.col1)
             ,         NVL (y.col2, x.col2)
             ,         NVL (y.col3, x.col3)
             FROM    table_y  y
             WHERE   x.pkey   = y.expr
             AND         ...
    WHERE   ...
    ;If the WHERE clause depends on the same row of table_y, then it will probably be simpler and more efficient to use MERGE instead of UPDATE.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • How to restore my ipad?My ipad say on screen CONNECT TO ITUNE.How can i do when i connect with computer.It is need itune new version.Can you sent me.I will be waiting your answer.Please help me sir.

    How to restore my ipad?My ipad say on screen CONNECT TO ITUNE.How can i do when i connect with computer.It is need itune new version.Can you sent me.I will be waiting your answer.Please help me sir.

    Check for Updates.
    http://i1224.photobucket.com/albums/ee374/Diavonex/Album%208/78d42b19fa42e8d83b5 5a65e1333373f_zpsf58bbe10.jpg

  • How to find last accessed/updated tables and the query text?

    I am using :
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.4.0 - Production
    How to find last accessed/updated tables and the query text?
    Regards
    LEE1212

    Check DBA_TBALES view there you find one date column that indicate last update
    One option is as follows:
    (1) Turn the auditing on: AUDIT_TRAIL = true in init.ora
    (2) Restart the instance if its running.
    (3) Audit the table:
         AUDIT INSERT,SELECT,DELETE,UPDATE on TableName
         by ACCESS WHENEVER SUCCESSFUL
    (4) Get the desired information using :
         SELECT OBJ_NAME,ACTION_NAME ,to_char(timestamp,'dd/mm/yyyy , HH:MM:SS')
         from sys.dba_audit_object.
    Cheer,
    Virag Sharma
    http://virag.sharma.googlepages.com/
    http://viragsharma.blogspot.com/
    Message was edited by:
    virag_sh

  • How to Reduce cost of full table scan or remove full table scan while execu

    Dear Experts
    need your help.
    I execute a query and create a explain plan in that plan i found cost of a table is very high (2777) and it was full table scan.
    Please guide me How to Reduce cost of full table scan or remove full table scan while execute the query.
    Thanks

    Need your help to tune this query..
    SELECT DISTINCT ool.org_id, ool.header_id, ooh.order_number, ool.line_id,
    ool.line_number, ool.shipment_number,
    NVL (ool.option_number, -99) option_number, xcl.GROUP_ID,
    xcl.attribute3, xcl.attribute4
    FROM oe_order_headers ooh,
    xxcn_comp_header xch,
    xxcn_comp_lines xcl,
    fnd_lookup_values_vl fvl,
    oe_order_lines ool
    WHERE 1 = 1
    AND ooh.org_id = 1524
    AND xch.src_ref_no = TO_CHAR (ooh.order_number)
    AND xch.src_ref_id = ooh.header_id
    AND xch.org_id = 1524
    AND xcl.header_id = xch.header_id
    AND ool.line_id = xcl.oe_line_id
    AND ool.flow_status_code IN
    ('WWD_SHIPPED',
    'FULFILLED',
    'SHIPPED',
    'CLOSED',
    'RETURNED'
    AND ool.org_id = 1524
    AND ool.header_id = ooh.header_id
    AND xch.org_id = 1524
    AND fvl.lookup_type = 'EMR OIC SOURCE FOR OU'
    AND fvl.tag = '1524'
    AND fvl.description = xch.SOURCE
    AND EXISTS (
    SELECT 1
    FROM oe_order_lines oe
    WHERE oe.header_id = ool.header_id
    AND oe.org_id = 1524
    AND oe.line_number = ool.line_number
    AND oe.ordered_item = ool.ordered_item
    AND oe.shipment_number > ool.shipment_number
    AND NVL (oe.option_number, -99) =
    NVL (ool.option_number,
    -99)
    AND NOT EXISTS (
    SELECT 1
    FROM xxcn_comp_lines xcl2
    WHERE xcl.GROUP_ID = xcl2.GROUP_ID
    AND oe.line_id = oe_line_id))
    call count cpu elapsed disk query current rows
    Parse 1 0.07 0.12 12 25 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 2 103.03 852.42 176206 4997766 0 12
    total 4 103.10 852.55 176218 4997791 0 12
    In this LIO is very high...can u please help in resolving this performance issue

  • How can one time software updates to allow uploading at off peak times?

    How does one time software updates to allow uploading at non peak periods?

    Apple has plenty of servers for handling the downloading of software updates.  There is no optimum time since the updates are available worldwide.  Anytime is a good time. 

  • How to use Time Capsule via INTERNET WITH WINDOWS 7 SMB Cloud

    how to use Time Capsule via INTERNET WITH WINDOWS 7 SMB Cloud

    Get a vpn router.. I have no idea where you are in the world but you can find reasonable stuff for not too much money or even a general router that takes third party firmware like dd-wrt can run openvpn. 
    Set up the vpn router in place of the TC, as the main router in the network. Simply bridge the TC and place it behind the router. It will be accessible as part of the network via the vpn.
    This is the only safe way to do it via windows.
    http://www.dyncommunity.com/questions/18132/accessing-time-capsule-from-windows- 7-over-the-int.html
    If you google around I have seen posts about how to access TC by port forwarding SMB on the TC.. using a different port.. To me this is going to slow down the hackers by a day or two.. then they will discover the open port and access your network.. not just the TC.. they now have SMB access to everything. Don't do it. There is very little security on SMB.

  • How to reduce time for replicating large tables?

    Hi
    Any suggestions on how to reduce the amount of time it takes to replicate a large table when it is first created?
    I have a table with 150 million rows in it, and it takes forever to start the replication process even if I run it in parallel, and I can’t afford the downtime.

    What downtime are you referring to? The primary doesn't need to be down when you're setting up replication and you're presumably still in the process of doing the initial configuration on the replicated database, so it's not really down, it's just not up yet.
    Justin

  • How to reduce time for gather statistics for a table.

    I have a table size 520 gb
    Its one of the partition size is 38 gb
    and total indexes of related table is 412 gb.
    Server/instance details.
    ==========
    56 cpu -> Hyper threading enable
    280 gb ram
    35 gb sga
    27 gb buffer cache
    4.5 gb shared pool size
    25 gb pga
    undo size 90gb
    temp size 150 gb
    Details :
    exec dbms_stats.gather_table_stats('OWNER','TAB_NAME',PARTNAME=>'PART_NAME',CASCADE=>FALSE,ESTIMATE_PERCENT=>10,DEGREE=>30,NO_INVALIDATE=>TRUE);
    when i am firing this in an ideal time when there is no load that time also is is taking 28 mins to complete.
    Can anybody please reply me how can we reduce the stats gather time.
    Thanks in advance,
    Tapas Karmakar
    Oracle DBA.

    Enable tracing to see where the time is going.
    parallel 30 seems optimistic - unless you have a large number of discs to support the I/O ?
    you haven't limited histogram collection, and most of the time spent of histograms may be wasted time - what histograms do you really need, and how many does Oracle analyse for and then discard ?
    Using a block sample may help slightly
    You haven't limited the granularity of the stats collection to the partition - the default is partition plus table, so I think you're also doing a massive sample on the table after completing the partition. Is this what you want to do, or do you have an alternative strategy for generating table-level stats.
    Regards
    Jonathan Lewis

  • How to find out when a table was last updated?

    Is there a way to find out when a table was last updated/inserted/deleted? Thanks!

    There may be an easier way but if you are trying to get info on something that has already happened look at your redo logs and archived logs. It would be hard but in V$LOGMNR_CONTENTS you could find the max time for a given object. Note to use this you need to set up log miner. Since you did not give a version try the Oracle 9i DBA Guide pg 9-1.

  • How to reduce downtime for setup table

    Scenario u2013According to system data, Setup table will normally take 5 days to fill but client agreed only for max 2 days downtime. User can do change only last 3 month documents not before that. For filling 3 month data in set up table 1 day required so I have to mange options accordingly.
    Datasource u2013 2LIS_13_VDITM -> DSO u2013 ZBIllIG ->Info cube
    I have to Reduce Downtime for Setup table so planning following optionsu2013
    1.     First run the info package for Initialization without data transfer. Then start filling setup table without blocking the User. In case Users changes any document at the time of filling setup table then these changes will move to delta queue. Once setup table filled then execute full repair request and then Delta info package.
    2.     Early delta initialization u2013 no idea how to perform steps.
    Please share your views with detail steps.
    OLI*BW doesnu2019t have any date range in selection criteria so manually I will find out document for particular dates and use these document range.
    Checked lot of post in SDN but still expecting final answer to go ahead in Production.

    Hi ,
    Your requirement is Billing ODS and Cube - Reset up in R/3 SYSTEM & Initialization in BW SYSTEM .
    Before starting find the previous data load volume and size.
    1.Go to LBWG application value=13 (Always Schedule the job in the back-ground mode)
    2.Verify using tcode u2018SE16u2019 that there are NO records in u2018MC13VD0ITMSETUPu2019 table after above delete job is complete.
    3.Suspend the process chain job in BW.This is to avoid it getting kicked off while the reload process is still in progress.
    4.Need to check LBWQ in R/3 system for MCEX13, unprocessed Outbound queue (records). This should be empty as the last delta would have processed all.
    5.Delete the initflag in BW.
    6.Need to check RSA7 in R/3 SYSTEM to verify that there is NO record for 2LIS_13_VDITM    (to be done right before the Setup job).
    7.Create New Info Package for Info Source '2LIS_13_VDITM' for u2018Initialize without Data Transfer Optionu2019 .Execute the package.Re-establish the Delta processing flags in R/3 and BW for the Billing TD load .
    8.Save the record count for table u2018VBRPu2019 using SE16 right before the setup job.
    9.Schedule Billing Data Setup Job 'OLI9BW'  in R/3 SYSTEM .
    10.After the Billing Setup job is complete in R/3 system, get the record count of table u2018VBRPu2019 again using u2018SE16u2019
    Expeted time in R/3:5 to 7 hrs(setupjobs)
    Expeted time for init and fullload : 6 hrs
    ODS activation : 3hrs
    Cube and with agrregates fill all : 8hrs.
    Thanks,
    naidu.

  • How to Reduce Clusetering Factor on Table?

    I am seeing a very high clustering factor on an SDO geometry table in our 10g RAC DB on our Linux boxes. This slow performance is repeateable on othe r Linux as well as Solaris DBs for the same table. Inserts go in at a rate of 44 milliseconds per insert and we only have about 27000 rows in the table. After viewing a VERY slow insert of about 600 records into this same table, I saw the clustering factor in OEM. The clustering factor is nearly identical to the # rows in the table indicating that useability of the index is fairly low now. I have referenced Metalink Tech Note 223117.1 and, while it affirms what I've seen, I am still trying to determine how to reduce the Clustering Factor. The excerpt on how to do this is below:
    "The only method to affect the clustering factor is to sort and then store the rows in the table in the same order as in they appear in the index. Exporting rows and putting them back in the same order that they appeared originally will have no affect. Remember that ordering the rows to suit one index may have detrimental effects on the choice of other indexes."
    Sounds great, but how does one actually go about storing the rows in the table in the same order as they appear in the index?
    We have tried placing our commits after the last insert as well as after every insert and the results are fairly neglible. We also have a column of type SDE.ST_GEOMETRY in the table and are wondering if this might also be an issue. Thanks in advance for any help.
    Matt Sauter

    Joel is right that the clustering factor is going to have absolutely no effect on the speed of inserts. The clustering factor is merely one, purely statistical, factor the optimiser makes use of to determine how to perform a SELECT statement (i.e., do I bother to use this index or not for row retrieval). It's got nothing to do with the efficiency of inserts.
    If I were you, I'd be looking at factors such as excessive disk I/O taking place for other reasons, inadequate buffer cache and/or enqueue and locking issues instead.
    If you're committing after every insert, for example, then redo will have to be flushed (a commit is about the only foreground wait event -i.e., one that you get to experience in real time- that Oracle has, so a commit after every insert's really not a smart idea). If your redo logs are stored on, say, the worst-performing disk you could buy that's also doing duty as a fileserver's main hard disk, then LGWR will be twiddling its thumbs a lot! You say you've tested this, and that's fine... I'm just saying, it's one theoretical possibility in these sorts of situations. You still want to make sure you're not suffering any log writer-related waits, all the same.
    Similarly, if you're performing huge reads on a (perhaps completely separate) table that is causing the buffer cache to be wiped every second or so, then getting access to your table so your inserts can take place could be problematic. Check if you've got any database writer waits, for example: they are usally a good sign of general I/O bottlenecks.
    Finally, you're on a RAC... so if the blocks of the table you're writing to are in memory over on another instance, and they have to be shipped to your instance, you could have high enqueue waits whilst that shipment is taking place. Maybe your interconnect is not up to the job? Maybe it's faulty, even, with significant packet loss along the way? Even worse if someone's decided to switch off cache fusion transfer for the datafiles invoved (for then block shipment happens by writing them to disk in one instance and reading from disk in the other). RAC adds a whole new level of complexity to things, so good luck tracking that lot down!!
    Also, maybe you're using Freelists and Freelist groups rather than ASSM, so perhaps you're fighting for access to the freelist with whatever else is happening on your database at the time...
    You get the idea: this could be a result of activity taking place on the server for reasons completely unconnected with your insert. It could be a feature of Spatial (with which not many people will be familiar, so good luck if so!) It could be a result of the way your RAC is configured. It could be any number of things... but I'd be willing to bet quite a bit that it's got sod-all to do with the clustering factor!
    You'll need to monitor the insert using a tool like Insider or Toad so you can see if waits and so on happen, more or less in real time -or start using the built-in tools like Statspack or AWR to analyze your workload after it's completed- to work out what your best fix is likely to be.

  • Database error when updating table ADRC

    Hi,
    We are on ECC 5.0 & are facing a problem whille maintaining anything relevant to table ADRC.
    For eg., if we try to maintain storage location or create a vendor code (XK01), for some inputs it works ...but most times the update just terminates with a message "Database error when changing table ADRC".
    Pls. help.
    Thanks,
    Saba.

    Hi
    You can refer to following SAP Notes in case they help:
    385440   Repairing inconsistencies in Customizing addresses
    417809    Customizing objects display incorrect addresses
    186910    Customers / vendors with incorrect address
    Otherwise i want to know more about the error you are getting to help you in better way.
    Thanks and Regards
    Esha Rajpal

  • Synchronous Scenario. How to reduce time. Pls advice urgent.

    Hi All,
    I have Synchronous Scenario. It has no BPM , simple synchronous scenario (HTTP --- Webservice).
    It is taking 10 seconds. How can I reduce time of this scenario.
    Pls advice

    Hi,
    The Time Consumption is based on below factors
    1. the amount of data to be processed across the interface.
    2. The response time of Receiver system
    3. Type of Mapping used and implementations of any complex logics with Advanced UDFs etc
    4. Hardware configurations
    5. Resource Consumptions etc.
    please refer below fine tunning docs.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/489f5844-0c01-0010-79be-acc3b52250fd
    XI Performance Benchmarks ?
    Thanks
    Swarup

Maybe you are looking for

  • My Websites are not showing up on the Creative Cloud Control Panel

    Hi guys, For some reason, just recently, my websites that I have hosted with BC, that I have built for clients, are not showing up on the right control panel? Usually when I load up CC, it shows the Website text as ...loading, then my sites appear...

  • Custom report for TOP 10 CPU Utilization machines from any group in aggregation last seven days

    I want to create a custom report that contain list of TOP CPU Utilization of machines form any group.This report is create on last 7 days CPU utilization of all machine from a group. What  should be query for this report.

  • Output page footer if group details overflow single page

    My report is all group details, with no page footer or headers, but I want to have a page footer output something like "continued on next page" only if that group continues on the next page, if there is a new group, then I want it suppressed. I can't

  • Only showing art board

    hi iv got a really strange photoshop problem, when i open a project ( except a new project which seems to work) i can only see the art board, the layers are ther but i cant see them in my window, like i said if i place things in a new document that w

  • Synchronize a DO trough a 6534 board with an AI trough a 6115 card

    What is the better mean to synchronize a 6534 board (Digital output, master card) and a 6115 board (analog input, slave card) trough the RSTI cable. In the help, I see that two different VI may be useful: RTSI Control and Route Config. Is it possible