Extrude 3D polygons with multiple rings in Oracle spatial

In this thread Extrude 3D polygons in Oracle spatial Baris provided a sample script to extrude a polygon with one ring into a 3D solid.
How do I extrude a polygon with multiple rings?
Given this polygon
! http://public.johnnyotoole.fastmail.fm/Polygon_with_hole.jpg !
, I tried to create a solid as follows:
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
PL/SQL Release 11.1.0.7.0 - Production
CORE    11.1.0.7.0      Production
TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
5 rows selected.
SQL> DECLARE
  2    l_base_geom      SDO_GEOMETRY;
  3    l_solid  SDO_GEOMETRY;
  4   BEGIN
  5
  6    l_base_geom :=
  7     SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1, 21, 2003, 1),
  8     SDO_ORDINATE_ARRAY(568758.064, 835364.907, 568735.12, 835362.873, 568735.897, 835354.404, 568737.264, 835334.554,
  9     568738.711, 835317.612, 568758.063, 835319.294, 568790.598, 835322.124, 568787.473, 835358.924, 568786.671, 835367.888,
10     568758.064, 835364.907, 568758.063, 835354.97, 568758.811, 835355.046, 568759.253, 835349.107, 568764.952, 835349.529,
11     568764.51, 835355.468, 568778.388, 835356.625, 568778.627, 835353.883, 568778.681, 835353.252, 568778.757, 835352.388,
12     568780.648, 835330.63, 568758.063, 835328.714, 568747.322, 835327.804, 568744.841, 835353.627, 568758.063, 835354.97));
13
14     DBMS_OUTPUT.PUT_LINE('Valid? ' || SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(l_base_geom, 0.005));
15
16     l_solid :=
17     SDO_UTIL.EXTRUDE(
18             l_base_geom,
19             SDO_NUMBER_ARRAY(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
20             SDO_NUMBER_ARRAY(5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5),
21             'FALSE',
22             0.005);
23
24  DBMS_OUTPUT.PUT_LINE('Volume: ' || sdo_geom.sdo_volume(l_solid,0.005));
25
26  END;
27  /
Valid? TRUE
DECLARE
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception: java.lang.ArrayIndexOutOfBoundsException
ORA-06512: at "MDSYS.SDO_UTIL", line 241
ORA-06512: at line 16Any ideas?

Would you please have only 10 elements in your sdo_number_arrays in your case?Is this what you mean?
SQL> DECLARE
  2    l_base_geom      SDO_GEOMETRY;
  3    l_solid  SDO_GEOMETRY;
  4   BEGIN
  5
  6    l_base_geom :=
  7     SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1, 21, 2003, 1),
  8     SDO_ORDINATE_ARRAY(568758.064, 835364.907, 568735.12, 835362.873, 568735.897, 835354.404, 568737.264, 835334.554,
  9     568738.711, 835317.612, 568758.063, 835319.294, 568790.598, 835322.124, 568787.473, 835358.924, 568786.671, 835367.888,
10     568758.064, 835364.907, 568758.063, 835354.97, 568758.811, 835355.046, 568759.253, 835349.107, 568764.952, 835349.529,
11     568764.51, 835355.468, 568778.388, 835356.625, 568778.627, 835353.883, 568778.681, 835353.252, 568778.757, 835352.388,
12     568780.648, 835330.63, 568758.063, 835328.714, 568747.322, 835327.804, 568744.841, 835353.627, 568758.063, 835354.97));
13
14     DBMS_OUTPUT.PUT_LINE('Valid? ' || SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(l_base_geom, 0.005));
15
16     l_solid :=
17     SDO_UTIL.EXTRUDE(
18             l_base_geom,
19             SDO_NUMBER_ARRAY(0,0,0,0,0,0,0,0,0,0),
20             SDO_NUMBER_ARRAY(5,5,5,5,5,5,5,5,5,5),
21             'FALSE',
22             0.005);
23
24  DBMS_OUTPUT.PUT_LINE('Volume: ' || sdo_geom.sdo_volume(l_solid,0.005));
25
26  END;
27  /
Valid? TRUE
DECLARE
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception: java.lang.Exception: 54550
ORA-06512: at "MDSYS.SDO_UTIL", line 241
ORA-06512: at line 16
If the heights and ground heights are all the same in your sdo_number_arrays (as in this case), then you can just specify one number in each array instead of specifying a height/ground height for each vertex.Ok, I see what you mean. This works when I use just the outer ring.
SQL> DECLARE
  2    l_base_geom      SDO_GEOMETRY;
  3    l_solid  SDO_GEOMETRY;
  4   BEGIN
  5
  6    l_base_geom :=
  7     SDO_UTIL.EXTRACT(
  8     SDO_GEOMETRY(2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1, 21, 2003, 1),
  9        SDO_ORDINATE_ARRAY(568758.064, 835364.907, 568735.12, 835362.873, 568735.897, 835354.404, 568737.264, 835334.554,
10        568738.711, 835317.612, 568758.063, 835319.294, 568790.598, 835322.124, 568787.473, 835358.924, 568786.671, 835367.888,
11        568758.064, 835364.907, 568758.063, 835354.97, 568758.811, 835355.046, 568759.253, 835349.107, 568764.952, 835349.529,
12        568764.51, 835355.468, 568778.388, 835356.625, 568778.627, 835353.883, 568778.681, 835353.252, 568778.757, 835352.388,
13        568780.648, 835330.63, 568758.063, 835328.714, 568747.322, 835327.804, 568744.841, 835353.627, 568758.063, 835354.97)),
14     1,1);
15
16     DBMS_OUTPUT.PUT_LINE('Valid? ' || SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(l_base_geom, 0.005));
17
18     l_solid :=
19     SDO_UTIL.EXTRUDE(
20             l_base_geom,
21             SDO_NUMBER_ARRAY(0),
22             SDO_NUMBER_ARRAY(5),
23             'FALSE',
24             0.005);
25
26  DBMS_OUTPUT.PUT_LINE('Volume: ' || sdo_geom.sdo_volume(l_solid,0.005));
27
28  END;
29  /
Valid? TRUE
Volume: 11839.18887702For the purposes of what I'm doing now, I think I'll just use the outer ring to create my solids, but it would be useful if SDO_UTIL.EXTRUDE works on polygons with multiple rings (maybe it does, I'm probably doing something wrong...).

Similar Messages

  • Rsrb with multiple ring groups on head ends with one phy ring?

    working on an issue for a customer and I cant find good documentation on this anywhere for multiple ring-groups
    have 2 routers, each with 2 ring groups connected on a mau terminating multiple serial connections (wan, hence the rsrb) and utilizing rsrb tcp with local ack. The configuration was done sometime ago. It was set up to utilize frame which now they are using ptp t1s. I see in the remote routers they are forwarding pakcets to both routers to ring 20. (there are 2 routers if one fails then it is meant to learn its path to the CIP through the other router)
    ---------router1
    source-bridge ring-group 30
    source-bridge ring-group 31
    blahblah peers tcp local-ack
    int t0
    source-bridge 20 1 30 <----notice bridge 1
    source-bridge spanning
    int t1
    source-bridge 20 1 31 <----notice bridge 1
    source-bridge spanning
    --------router2
    source-bridge ring-group 30
    source-bridge ring-group 31
    blahblah peers tcp local-ack
    int t0
    source-bridge 20 2 30 <----notice bridge 2
    source-bridge spanning
    int t1
    source-bridge 20 2 31 <----notice bridge 2
    source-bridge spanning
    I thought the physical rings had to be different in order to run parrallel links. Or are different bridge #'s feasible? The end issue they are having is that when links bounce, they are not releasing the tcp session and the show llc shows remote sides as busy and the head end as connected. (then obviously removal of local ack fixed the issue)
    Not ready to live without local ack... could the same ring # on both routers be the issue since they are on the same mau and destined for the same location?
    ==MAU to CIP==
    | | | | all physical connection on mau are ring 20
    router1 router2
    | | | | | ring groups 30 and 31 configured on both routers with 1 statement to each router in the network per router (so each remote side is only connected to either ring group 30 or 31 (not both since you can only do over token ring) and the show source-bridge is showing forwards to each head end router's physical ring 20. I thought I would see one with forwards the other 0 since first response, but then saw the bridge # differed.)

    case was opened over a month ago with no luck or serious help. Have had great luck in the past with tac, but this one was frustrating and nothing was done.
    case#D039413
    And the remote routers connect directly to the cip with LLC2. (end to end connection, not remote to router 1 and 2 to CIP)
    show llc shows the local mac of the gateway and the cip token.
    the network goes like this
    rr = remote router
    fr= frame relay
    ptp= ptp t1
    rtr1 and rtr2 = router 1 and 2
    rr--fr--rr--ptp--rtr1 and rtr2 ---rr---cip
    I have tried numerous things on this and its apparent that the only option is dlsw and I have pressed the issue enough to start on it with test segments.
    my theory was when the host queried the gateway, its first reply was local-ack on rtr2 (could be rtr1 but for theory we will say rtr2) which was giving back RR and the other end was actually in a disconnect state and sending rnr's to the rtr1 (in this exapmple the host was talking thru rtr2 to the remote side and the remote side was trying the opposite router) which local ack would reply to the supervisor frames
    what was causing the problems in my opinion is the host provider does not utilize local ack since they only have lanned token rings and the customer provides their own wan routers. So the explorer would be answered quicker by the other router and that would be the source route bridged path to the remote side, where the other sides local ack and rif cache was routing through the opposite router. Unfortunately the site where we collected the data on I can not test since I have transitioned it to dlsw to solve their issues and show them the benfits of dlsw

  • How to build a form with multiple tables in oracle application express

    Hi everyone,
    I have got problem in building a form with multiple tables.I have a main table with (20) columns and this main table is related to the other tables with the primary key-foreign key relation ship.My requirement is i have to build a form which has fields from many tables and all the fields are related to the main table using (ID) column.In that form if i enter ID field i have to get information from differnt tables.
    Please help me to solve this (building a form with mutiple tables)
    Thank you
    sans

    Sans,
    I am no Apex expert, but with a situation as "complex" as yours, have you thought about creating a VIEW that joins these 7/8 tables, placing an INSTEAD OF trigger on that view to do all the business logic in the database, and base your application on the view?
    This is the "thick-database" approach that has been gaining momentum of late. The idea is to put your business logic in the database wherever possible, and let the application (Form, Apex, J2EE, whatever) concentrate on UI issues,

  • Not able to work with multiple Databases using  oracle.jdbc.driver.OracleDr

    Hi all,
    I am using the following Oracle Driver in Weblogic 6.1 sp 4
    oracle.jdbc.driver.OracleDriver / jdbc:oracle:thin:
    Driver. I am not able to select rows from two different table, which resides in two different Databases.
    The Exception is :
    SQL Exception Connection has already been created in this tx context for pool named CDPool. Illegal attempt to create connection
    nother pool: MultiTransactionTest
    Start server side stack trace:
    java.sql.SQLException: Connection has already been created in this tx context for pool named CDPool. Illegal attempt to create c
    on from another pool: MultiTransactionTest
    at weblogic.jdbc.jts.Driver.getExistingConnection(Driver.java:288)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:123)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:214)
    at weblogic.jdbc.common.internal.RmiDataSource_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    End server side stack trace
    Can any one help me to fix this issue?
    -Thanks & Regards,
    Shamil.S

    Shamil S wrote:
    Hi all,
    I am using the following Oracle Driver in Weblogic 6.1 sp 4
    oracle.jdbc.driver.OracleDriver / jdbc:oracle:thin:
    Driver. I am not able to select rows from two different table, which resides in two different Databases.
    The Exception is :
    SQL Exception Connection has already been created in this tx context for pool named CDPool. Illegal attempt to create connection
    nother pool: MultiTransactionTestHi. You can't domultiple DBMSes in one transaction unless you use an XA driver and
    an XA transaction. Your workarounds are:
    1 - Use an XA driver, datasource, and tx
    2 - If you're just reading, you can use non-transactional datasources. Do make sure you
    always close your connections...
    Joe
    >
    Start server side stack trace:
    java.sql.SQLException: Connection has already been created in this tx context for pool named CDPool. Illegal attempt to create c
    on from another pool: MultiTransactionTest
    at weblogic.jdbc.jts.Driver.getExistingConnection(Driver.java:288)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:123)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:214)
    at weblogic.jdbc.common.internal.RmiDataSource_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    End server side stack trace
    Can any one help me to fix this issue?
    -Thanks & Regards,
    Shamil.S

  • With Multiple Management Services, How BIg Is Your Shared Filesystem?

    I am installing Grid Control 11.1 with multiple OMSs. Oracle uses a shared filesystem in this configuration for load balancing and fault tolerance. I want to know from anyone who has installed multiple OMSs: how much storage does Grid Contorl use in the shared file system in your implementation. Please also state how many targets are monitored. Thanks.

    The size of the shared location is dependent upon:
    1. How quickly agent files are processed - If your OMS are going to be down for awhile, size the location to support storing the files until processing can being and catch-up. The files are small but depending on the number of targets this can add up.
    2. Usage of provisioning - Ensure you size to support all the various files used in your provisioning
    We have several hundred targets, two OMS, and make limited usage of provisioning (software and agent installation images). We allocated an NFS share of 50GB but typical usage is <20GB, with 95% of that is due to the provisioning files.

  • Oracle Spatial, help =(

    Hi,
    (sorry for my bad english)
    i need to know how i can select the names contained in a area. For example, i have a a table "MONACO_DB.ZONES", and i want to select all city contained in the central Zone of MONACO_DB.ZONES. How can i do it?
    Thanks at all..

    Assuming:
    - you are aware with the basics of oracle spatial
    - have user_sdo_geom_metadata populated
    - spatial index built on your geometry
    - Districts have polygon geometry
    - D_BAHN have point geometry
    you need the spatial operator SDO_RELATE with a mask specifying the relationship.
    The mask Contains or Inside are the most obvious, but do not take the cases into account where there could be a D_BAHN right on the border of District. Therefor the anyinteract mask is the most appropriate.
    SELECT
    A.id
    FROM DISTRICTS A , D_BAHN B
    WHERE SDO_RELATE(B.Geometry, A.Geometry, 'mask=ANYINTERACT') = 'TRUE';
    Read for more details the online doc: (read http://download.oracle.com/docs/html/B14255_01/sdo_operat.htm#i78531).
    Hope this gets you in the good direction
    Luc

  • Extrude 3D polygons in Oracle spatial

    Dear Everyone,
    I have two data sets of the city footprints imported in the Oracle Spatial already. One is a 2D polygon layer with only x and y, and the other is a 3D polygon layer with z values (the x and y are identical to the first one).
    Now I am trying to extrude the 3D polygon to 3D composites based on the z value. I can successfully extrude the 2D polygons with specifying the ground heights (say sdo_ordinate_array(0)) and topheights (say, sdo_ordinate_array(20.0)).
    However, how to extrude the 3D polygon taking each vertex's z value as the ground heights to an specified top heights is a problem for me. Since, I am very new to use PL/SQL, besides, I am not sure if it is possible to do this.
    Here is the sample data extracted from the sample data:
    select sample.geom.sdo_ordinates from sample2d_polygon sample
    NUMBER(715202.739577727,733492.909091357,715206.759608945,733492.412077086,715208.666575034,733506.889047512,715204.72752625,733507.364066093,715202.739577727,733492.909091357)
    select sample.geom.sdo_ordinates from sample3d_polygon sample
    NUMBER(715202.739577727,733492.909091357,12.4890003204346,715206.759608945,733492.412077086,12.4890003204346,715208.666575034,733506.889047512,12.4540004730225,715204.72752625,733507.364066093,12.4320001602173,715202.739577727,733492.909091357,12.4890003204346)
    Can anybody help me about this
    select sdo_util.extrude(sample.geom, sdo_ordinate_array(), sdo_ordinate_array(20.0), 'true', 0.05) from sample2d_polygon sample, where the first sdo_ordinate_array is the array of corresponding vertex's z value?
    Any suggestions is anticipated and highly appreciated.
    Sincerely
    Jun

    Hi Jun,-
    I hope the following code solves your problem.
    Please also make sure your geometries are valid using sdo_geom.validate_geometry_with_context or
    sdo_geom.validate_layer_with_context for 3D geometries.
    Please let us know if you have questions.
    Best
    baris
    drop table myGeoms;
    drop table extruded_myGeoms;
    create table myGeoms(i number, geom sdo_geometry);
    insert into myGeoms(i, geom) values(1,
    MDSYS.SDO_GEOMETRY(3003, null,null,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),
    MDSYS.sdo_ordinate_array(
    715202.739577727,733492.909091357,12.4890003204346,
    715206.759608945,733492.412077086,12.4890003204346,
    715208.666575034,733506.889047512,12.4540004730225,
    715204.72752625, 733507.364066093,12.4320001602173,
    715202.739577727,733492.909091357,12.4890003204346
    insert into myGeoms(i, geom) values(2,
    MDSYS.SDO_GEOMETRY(3003, null,null,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),
    MDSYS.sdo_ordinate_array(
    715202.739577727,733492.909091357,14.4890003204346,
    715206.759608945,733492.412077086,14.4890003204346,
    715208.666575034,733506.889047512,14.4540004730225,
    715204.72752625, 733507.364066093,14.4320001602173,
    715202.739577727,733492.909091357,14.4890003204346
    insert into myGeoms(i, geom) values(3,
    mdsys.sdo_geometry(3003, null, null,
    mdsys.sdo_elem_info_array(1,1003,1),
    mdsys.sdo_ordinate_array(1,1,10,  0,1,10, 0,0,10, 1,0,10, 1,1,10))
    create table extruded_myGeoms(id number, geom sdo_geometry);
    -- This program assumes that each geometry in myGeoms table
    -- has only 1 ring per polygon ie, 1003 etype element.
    set serveroutput on;
    declare
    type cursor_type is REF CURSOR;
    query_crs cursor_type ;
    -- For each extruded geometry (result), this array has the ground heights
    ords_bottom_z_array sdo_number_array  := null;
    -- For each extruded geometry (result), this array has the top heights which is set to 20 for each element.
    -- Both arrays must have the same number of elements.
    ords_top_z_array sdo_number_array  := null;
    ords2d mdsys.sdo_ordinate_array  := null;
    result sdo_geometry;
    g1 sdo_geometry;
    g2d sdo_geometry;
    stmt  varchar2(100);
    id1 number;
    cnt integer;
    k integer;
    l integer;
    the_dim        number;
    gtype_2d       number;
    begin
    stmt := ' select i, geom from myGeoms ';
    OPEN query_crs FOR stmt;
    LOOP
      BEGIN
       FETCH query_crs into id1, g1;
       EXIT when query_crs%NOTFOUND ;
       ords2d := mdsys.sdo_ordinate_array();
       ords_bottom_z_array := SDO_NUMBER_ARRAY();
       ords_top_z_array := SDO_NUMBER_ARRAY();
       k:=ords_bottom_z_array.count;
       l:=ords2d.count;
       FOR cnt in 1..g1.sdo_ordinates.count LOOP
         if (mod(cnt, 3) = 0) then
           -- Get z values of polygon
           ords_bottom_z_array.extend(1);
           ords_top_z_array.extend(1);
           k:=k+1;
           ords_bottom_z_array(k) := g1.sdo_ordinates(cnt);
           ords_top_z_array(k) := 20.0; -- Constant
         else
           -- To have 2D geometry for input to sdo_util.extrude
           ords2d.extend(1);
           l := l+1;
           ords2d(l) := g1.sdo_ordinates(cnt);
         end if;
       end loop;
       the_dim := floor(g1.sdo_gtype / 1000);
       gtype_2d := (the_dim-1)*1000 + mod(g1.sdo_gtype, 10);
       g2d:= sdo_geometry(gtype_2d, null,  null,
               mdsys.sdo_elem_info_array(1,1003,1),
               ords2d);
       result:= sdo_util.extrude(g2d, ords_bottom_z_array, ords_top_z_array, 'FALSE', 0.05);
       -- insert the extruded geometry (result) into new table
       insert into extruded_myGeoms(id, geom) values(id1, result);
       dbms_output.put_line('id = '||id1);
      END;
    END LOOP;
    end;
    /

  • Oracle hangs on query with multiple joins

    To test the sotftware from the LMS-vendor that are out partners we use virtual machines where we install Windows 2003 servers and Oracle XE
    While we were testing the software I've found that a particular query with multiple unions causes the CPU of the virtual machine totally claimed by oracle
    The query causes oracle to hang.
    I've found that the subcomponents of the query all return 0 rows (and response all immediately) combined into a query with at least 2 unions the query hangs the system
    I'm not familiar with with Database Management at all
    I've read something about SGA and PGA that could be the issue and tried to increase the target for both but it doesn't seem to do anything
    Some characterics
    Target Current
    Maximum System Global Area (SGA) Size: 380 MB 380 MB
    Program Global Area (PGA) Aggregate Target: 360 MB 38 MB
    Current Configuration: (SGA + PGA): 740 MB 418 MB
    Tablespaces Percent Used Allocated (MB) Used (MB) Datafiles
    SYSAUX 98.21% 460.00 451.75 1
    SYSTEM 73.09% 510.00 372.75 1
    DATA 99.13% 440.00 436.19 1
    UNDO 6.48% 160.00 10.38 1
    USERS 1.63% 100.00 1.63 1
    sort_area_size 65536
    shared_pool_reserved_size 5452595 TRUE size in bytes of reserved area of shared pool
    shared_pool_size 0 TRUE size in bytes of shared pool
    What other parameters are important? How could I get a good picture to see what's really going on?
    Some pointers, help would be appreciated.
    Regards,
    Remco

    Below is the base-query that is causing the problems
    SELECT /* Public - Internal learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no order_number, e.id person_id, format_name(e.fname , e.lname , @@005) learner_name , c.id company_id, c.name2 , ent.id entid, ctype.id ctypeid, ctype.name , i.status , items.description item_desc, substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1 , r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,c.name2 org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,e.fname learner_first_name ,e.lname learner_last_name FROM tpt_registration r INNER JOIN tpt_oe_order_items i ON i.reg_id = r.id INNER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN cmt_person e ON r.student_id = e.id INNER JOIN tpt_company c ON e.company_id = c.id INNER JOIN tpt_offering_action oa on r.offering_action_id = oa.id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name INNER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name INNER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name INNER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name WHERE e.type = 100 AND r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' AND orderList.list_id = 'sysli000000000000129' AND orderList.locale_id = @@005 AND approvalList.list_id = 'sysli000000000000165' AND approvalList.locale_id = @@005 AND ((@@003 is null) or (@@003 is not null and r.student_id = @@003))
    UNION
    SELECT /* Public - External learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no , e.id person_id, format_name(e.fname , e.lname , @@005) , c.id company_id, c.name2 , ent.id entid, ctype.id ctypeid, ctype.name , i.status , items.description , substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1, r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,c.name2 org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,e.fname learner_first_name ,e.lname learner_last_name FROM tpt_registration r INNER JOIN tpt_oe_order_items i ON i.reg_id = r.id INNER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN cmt_person e ON r.student_id = e.id INNER JOIN tpt_offering_action oa on r.offering_action_id = oa.id LEFT OUTER JOIN tpt_company c ON e.company_id = c.id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name INNER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name INNER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name INNER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name WHERE e.type = 200 AND r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' AND orderList.list_id = 'sysli000000000000129' AND orderList.locale_id = @@005 AND approvalList.list_id = 'sysli000000000000165' AND approvalList.locale_id = @@005 AND ((@@003 is null) or (@@003 is not null and r.student_id = @@003))
    UNION
    SELECT /* Public - Unassigned learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no , null person_id, null , null company_id, null , ent.id entidd, ctype.id ctypeid, ctype.name , i.status , items.description , substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1, r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,'' org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,'' learner_first_name ,'' learner_last_name FROM tpt_registration r INNER JOIN tpt_oe_order_items i ON i.reg_id = r.id INNER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN tpt_offering_action oa on oa.id = r.offering_action_id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name INNER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name INNER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name INNER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name WHERE r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND r.student_id is null AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' AND orderList.list_id = 'sysli000000000000129' AND orderList.locale_id = @@005 AND approvalList.list_id = 'sysli000000000000165' AND approvalList.locale_id = @@005 AND @@003 is null
    UNION
    SELECT /* Private - Internal learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no , e.id person_id, format_name(e.fname , e.lname , @@005) , c.id company_id, c.name2 , ent.id entid, ctype.id ctypeid, ctype.name , i.status , items.description , substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1 , r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,c.name2 org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,e.fname learner_first_name ,e.lname learner_last_name FROM tpt_registration r INNER JOIN let_pvt_offering_request pvt_offreq ON pvt_offreq.class_id = r.class_id INNER JOIN tpt_offering_action oa on oa.id = r.offering_action_id LEFT OUTER JOIN tpt_oe_order_items i ON i.part_id = pvt_offreq.id LEFT OUTER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN cmt_person e ON r.student_id = e.id LEFT OUTER JOIN tpt_company c ON e.company_id = c.id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name LEFT OUTER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' LEFT OUTER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name AND orderList.list_id = 'sysli000000000000129' AND orderList.locale_id = @@005 LEFT OUTER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name AND approvalList.list_id = 'sysli000000000000165' AND approvalList.locale_id = @@005 WHERE e.type = 100 AND r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND ((@@003 is null) or (@@003 is not null and r.student_id = @@003))
    UNION
    SELECT /* Private - External learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no , e.id person_id, format_name(e.fname , e.lname , @@005) , c.id company_id, c.name2 , ent.id entid, ctype.id ctypeid, ctype.name , i.status , items.description , substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1 , r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,c.name2 org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,e.fname learner_first_name ,e.lname learner_last_name FROM tpt_registration r INNER JOIN let_pvt_offering_request pvt_offreq ON pvt_offreq.class_id = r.class_id INNER JOIN tpt_offering_action oa on r.offering_action_id = oa.id LEFT OUTER JOIN tpt_oe_order_items i ON i.part_id = pvt_offreq.id LEFT OUTER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN cmt_person e ON r.student_id = e.id LEFT OUTER JOIN tpt_company c ON e.company_id = c.id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name LEFT OUTER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' LEFT OUTER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name AND orderList.locale_id = @@005 AND orderList.list_id = 'sysli000000000000129' LEFT OUTER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name AND approvalList.locale_id = @@005 AND approvalList.list_id = 'sysli000000000000165' WHERE e.type = 200 AND r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND ((@@003 is null) or (@@003 is not null and r.student_id = @@003)) ORDER BY 34,35,28,29,31,30,33,32

  • Shared cluster with multiple oracle homes

    Hi All,
    I got to build a shared oracle RAC cluster with multiple oracle home installation ( 10g R1 , 10g R2 , and 11g R1 & 2).
    Of course the cluster ware will be version 11.2, but I wondered if there is any dependency on how I install oracle software? Do I have to start with 10g installation first? can I do 11g and then 10g?
    Is there anything I should be aware of ?

    I installed Oracle Application Server Enterprise which includes AS, Database, OID, Web Cache, SSO etc. and OSES on the same machine. Everything works except I think the windows version of OSES and AS need some patches so the crawler isn't working right. Everything does, however, install and run. I think Oracle develops everything in Linux (rumors of them now using Solaris) so on Linux everything should go smoother.

  • ORACLE EXPRESS: build a page with multiple forms linked to one table

    hi,
    im using oravle application express. APEX
    i would like to build a page with multiple forms linked to one table (orders) , the page has 4 from  each one with different order_id number (depending on filtering),  and if the order is prepared click yes for each order and this 'YES' should be UPDATED AND SAVED to each order number in the same table with the press of one button.
    i created all the form as (sql query)
    and create one update process
    (UPDATE ORDERS
    SET TRAY_PREPARED =:P10_TRAY_PREPARED_1
    WHERE ORDER_ID =:P10_ORDER_ID_1;
    UPDATE ORDERS
    SET TRAY_PREPARED =:P10_TRAY_PREPARED_2
    WHERE ORDER_ID =:P10_ORDER_ID_2;
    UPDATE ORDERS
    SET TRAY_PREPARED =:P10_TRAY_PREPARED_3
    WHERE ORDER_ID =:P10_ORDER_ID_3;
    UPDATE ORDERS
    SET TRAY_PREPARED =:P10_TRAY_PREPARED_4
    WHERE ORDER_ID =:P10_ORDER_ID_4;
    i dont know really if i can do that, but it appear hat it actually saving according to order_id number , but not all the time some time it saved the value as "null".
    please guide me what is the correct way to do this.
    I READ THIS ONE
    http://stackoverflow.com/questions/7877396/apex-creating-a-page-with-multiple-forms-linked-to-multiple-related-tables
    BUT IT WAS FOR MULTIPLE INSERT
    thanks.

    Sans,
    I am no Apex expert, but with a situation as "complex" as yours, have you thought about creating a VIEW that joins these 7/8 tables, placing an INSTEAD OF trigger on that view to do all the business logic in the database, and base your application on the view?
    This is the "thick-database" approach that has been gaining momentum of late. The idea is to put your business logic in the database wherever possible, and let the application (Form, Apex, J2EE, whatever) concentrate on UI issues,

  • Issue with multiple Oracle Long Fields

    Hello,
         We have some reports that try to display two Oracle Long data type fields. When we do so we receive the error "ORA-1002 - fetch out of sequence" when we connect the report through "Oracle Server" connection type.
         If I execute SQL Statement of the report in "Oracle SQL Developer" there is no error.
         I have the following components installed on my Windows 7 PC:
          - Crystal Report 2008 (12.3.0.601)
          - Oracle Client 11.1.7.0
        If you want to replicate the issue you can create the following tables:
    create table TEST1_T
      fld1 VARCHAR2(4),
      text   LONG
    create table TEST2_T
      fld1 VARCHAR2(4),
      fld2 VARCHAR2(4),
      text   LONG
    In the TEST1_T table insert data and populate the text field. In the TEST2_T, populate the fld1 to be able to link the 2 tables together you can let the text field blank.
    In the report insert TEST1_T.fld1, TEST2_T.text and TEST1_T.text if you hit preview you should get the error Ora-1002.
    If you need more information let me know.
    Thank you.
    Charles
    P.S: If we connect thru "CR Oracle ODBC Driver 5.3" and the first long field in the SQL statement is null boths fields are blanked in the report but if both fields are populated the report execute correctly.

    Hi,
       This is a known issue with CR that uses Oracle Long Fields.
       See below for direct copy of information from KBase 1205489, hope it helps.
    Symptom
    In Crystal Reports, problems may arise when using more than one Oracle LONG data type field.
    Some of the symptoms you might see:
    Mixed data between two LONG data columns when displayed within the same report.
    Incorrect data displayed in the column which is based on a LONG field.
    Resolution
    Change LONG fields to CLOB fields in the Oracle table.
    Oracle recommends migrating any LONG data to the CLOB type starting in Oracle 9i.
    To make this change, use the TO_LOB method.
    Ken

  • Oracle Spatial Performance with 10-20.000 users

    Does anyone have any experience when Oracle Spatial is used with say 20.000 concurrent users. I am not interested in MapViewer response time, but lets say there is:
    - an app using 800 different tables each having an sdo_geometry column
    - the app is configured with different tables visible on different view scales
    - let's say an average of 40-50 tables is visible at any given time
    - some tables will have only a few records, while other can hold millions.
    - there is no client side caching
    - clients can zoom in/out pan.
    Anwers I am interested in:
    - What sort of server would be required
    - How can Oracle serve all that data (each Refresh renders the map and retrieves the data over the wire as there is no client side caching).
    - What sort of network infrastructure would be required.
    - Can clients connect to different servers and hence use load balancing or does Oracle have an automatic mechanism for that?
    Thanks in advance,
    Patrick

    Patrick, et al.
    There are lots of things one can do to improve performance in mapping environments because of a lot of the visualisation is based on "background" or read-only data. Here are some "tips":
    1. Spatially sort read-only data.
    This tip makes sure that data that is close to each other in space are next to each other on disk! Dan gave a good suggestion when he referenced Chapter 14, "Reorganize the Table Data to Minimize I/O" pp 580- 582, Pro Oracle Spatial. But just as easily one can create a table as select ... where sdo_filter() where the filtering object is an optimized rectangle across the whole of the dataset. (This is quite quick on 10g and above but much slower on earlier releases.)
    When implementing this make sure that the created table is created such that its blocks are next to each other in the tablespace. (Consider tablespace defragmentation beforehand.) Also, if the data is READ ONLY set the PCTFREE to 0 in order to pack the data up into as small a number of blocks as possible.
    2. Generalise data
    Rendering spatial data can be expensive where the data is geometrically detailed (many vertices) esp where the data is being visualised at smaller scales than it was captured at. So, if your "zoom thresholds" allow 1:10,000 data to be used at 1:100,000 then you are going to have problems. Consider pre-generalising the data (see sdo_util.simplify) before deployment. You can add multiple columns to your base table to hold this data. Be careful with polygon data because generalising polygons that share boundaries will create gaps etc as the data is more generalised. Often it is better to export the data to a GIS which can maintain the boundary relationships when generalising (say via topological relationships).
    Oracle's MapViewer has excellent on-the-fly generalisation but here one needs to be careful. Application tier caching (cf Bryan's comments) can help here a lot.
    3. Don't draw data that is sub-pixel.
    As one zooms out objects become smaller and smaller until they reach a point where the whole object can be drawn within a single pixel. If you have control over your map visualisation application you might want to consider setting the SDO_FILTER parameter "min_resolution" flag dynamically so that its value is the same as the number of meters / pixel (eg min_resolution=10). If this is set Oracle Spatial will only include spatial objects in the returned search set if one side of a geometry's MBR is greater than or equal to this value. Thus any geometries smaller than a pixel will not be returned. Very useful for large scale data being drawn at small scales and for which no selection (eg identify) is required. With Oracle MapViewer this behaviour can be set via the generalized_pixels parameter.
    3. SDO_TOLERANCE, Clean Data
    If you are querying data other than via MBR (eg find all land parcels that touch each other) then make sure that your sdo_tolerance values are appropriate. I have seen sites where data captured to 1cm had an sdo_tolerance value set to a millionth of a meter!
    A corollary to this is make sure that all your data passes validation at the chosen sdo_tolerance value before deploying to visualisation. Run sdo_geom.validate_geometry()/validate_layer()...
    4. Rtree Spatial Indexing
    At 10g and above lots of great work went in to the RTree indexing. So, make sure you are using RTrees and not QuadTrees. Also, many GIS applications create sub-optimal RTrees by not using the additional parameters available at 10g and above.
    4.1 If your table/column sdo_geometry data contains only points, lines or polygons then let the RTree indexer know (via layer_gtype) as it can implement certain optimizations based on this knowledge.
    4.2 With 10g you can set the RTree's spatial index data block use via sdo_pct_free. Consider setting this parameter to 0 if the table/column sdo_geometry data is read only.
    4.3 If a table/column is in high demand (eg it is the most commonly used table in all visualisations) you can consider loading (a part of) the RTree index into memory. Now, with the RTree indexing, the sdo_non_leaf_tbl=true parameter will split the RTree index into its leaf (contains actual rowid reference) and non-leaf (the tree built on the leaves) components. Most RTrees are built without this so only the MDRT*** secondary tables are built. But if sdo_non_leaf_tbl is set to true you will see the creation of an additional MDNT*** secondary table (for the non_leaf part of the rtree index). Now, if appropriate, the non_leaf table can be loaded into memory via the following:
    ALTER TABLE MDNT*** STORAGE(BUFFER_AREA KEEP);
    This is NOT a general panacea for all performance problems. One should investigate other options before embarking on this (cf Tom Kyte's books such as Expert Oracle Database Architecture, 9i and 10g Programming Techniques and Solutions.)
    4.4 Don't forget to check your spatial index data quality regularly. Because many sites use GIS package GUI tools to create tables, load data and index them, there is a real tendency to not check what they have done or regularly monitor the objects. Check the SDO_RTREE_QUALITY column in USER_SDO_INDEX_METADATA and look for indexes with an SDO_RTREE_QUALITY setting that is > 2. If > 2 consider rebuilding or recreating the index.
    5. The rendering engine.
    Whatever rendering engine one uses make sure you try and understand fully what it can and cannot do. AutoDesk's MapGuide is an excellent product but I have seen it simply cache table/column data and never dynamically access it. Also, I have been at one site which was running Deegree and MapViewer and MapViewer was so fast in comparison to Deegree that I was called in to find out why. I discovered that Deegree was using SDO_RELATE(... ANYINTERACT ...) for all MBR queries while MapViewer was using SDO_FILTER. Just this difference was causing some queries to perform at < 10% of the speed of MapViewer!!!!
    6. Consider "denormalising" data
    There is an old adage in databases that is "normalise for edit, denormalise for performance". When we load spatial data we often get it from suppliers in a fairly flat or normalised form. In consort with spatial sorting, consider denormalising the data via aggregations based on a rendering attribute and some sort of spatial unit. For example, if you have 1 million points stored as single points in SDO_GEOMETRY.SDO_POINT which you want to render by a single attribute containing 20 values, consider aggregating the data using this attribute AND some sort of spatial BUCKET or BIN. So, consider using SDO_AGGR_UNION coupled with Spatial Analysis and Mining package functions to GROUP the data BY <<column_name>> and a set of spatial extents.
    6. Tablespace use
    Finally, talk to your DBA in order to find out how the oracle database's physical and logical storage is organised. Is a SAN being used or SAME arranged disk arrays? Knowing this you can organise your spatial data and indexes using more effective and efficient methods that will ensure greater scalability.
    7. Network fetch
    If your rendering engine (app server) and database are on separate machines you need to investigate what sort of fetch sizes are being used when returning data from queries to the middle-tier. Fetch sizes for attribute only data rows and rows containing spatial data can be, and normally are, radically different. Accepting the default settings for these sizes could be killing you (as could the sort_area_size of the Oracle session the application server has created on the database). For example I have been informed that MapInfo Pro uses a fixed value of 25 records per fetch when communicating with Oracle. I have done some testing to show that this value can be too small for certain types of spatial data. SQL Developer's GeoRaptor uses 100 which is generally better (but this one can modify this). Most programmers accept defaults for network properties when programming in ADO/ODBC/OLEDB/JDBC: just be careful as to what is being set here. (This is one of the great strengths of ArcSDE: its TCP/IP network transport is well written, tuneable and very efficient.)
    8. Physical Format
    Finally, while Oracle's excellent MapViewer requires data its spatial data to be in Oracle, other commercial rendering engines do not. So, consider using alternate, physical file formats that are more optimal for your rendering engine. For example, Google Earth Enterprise "compiles" all the source data into an optimal format which the server then serves to Google Earth Enterprise clients. Similarly, a shapefile on local disk to the application server (with spatial indexing) may be faster that storing the data back in Oracle on a database server that is being shared with other business databases (eg Oracle financials). If you don't like this approach and want to use Oracle only consider using a dedicated Oracle XE on the application server for the data that is read only and used in most of your generated maps eg contour or drainage data.
    Just some things to think about.
    regards
    Simon

  • Spatial Query with multiple geometries from 2 tables

    Hi,
    I'm using Oracle 8.1.7. I am trying to do a spatial query on two tables with multiple geometries. There are two spatial tables. One made up of points and one made up of polygons. There are 829551 rows in the table of points and 1817795 rows in the table with polygons...
    I want to find all polygons where one of this points is within it...
    This query is pretty intensive querying two large spatial tables against each other and so I need to find the most efficient way of running this query. I've been running variations of my query for the last two week and every time it's bombed out with various errors after 12-24 hrs processing like out of memory, out of tablespace, out of processing, invalid index etc etc etc. I need to get this query run asap... Any tips would be gratefully appreciated..
    For the session running the query I've allocated 16M sort area with
    ALTER SESSION SET SORT_AREA_SIZE=16777216;
    Below is the query I'm running... How can I improve this please? BTW PARCEL_OVERLAPS contains the points and TP$_PARCEL_AREAS the polygons.
    SELECT lu.LNU_PARCEL_ID
         FROM
              seventy.PARCEL_OVERLAPS po,
              imap_topol.TP$_PARCEL_AREAS pa,
              TP$_PARCEL_CENTROID_AREA pca,
              TDCR_LAND_UNIT lu
         WHERE
              SDO_FILTER(po.geometry, pa.area,
              'querytype=WINDOW') = ’TRUE’ and
              sdo_within_distance(po.geometry,pa.area,'distance=0')='TRUE' and
              pa.delete_date is null and
              Lu.LNU_LAND_UNIT_UNIQUE_NUM = pca.CENTROID_ID and
              pa.AREA_ID = pca.AREA_ID and
              pca.DELETE_DATE IS NULL and
              pa.DELETE_DATE IS NULL;

    Albert,
    Thanks for your reply and the tips you've given. The tp$_parcel_areas table will always be bigger so I've changed the order to sdo_within_distance(pa.area,po.geometry,'distance=0')='TRUE'. The requested counts for those queries are
    12:26:29 [email protected]:SQL> select count(*)
    13:46:22 2 from seventy.PARCEL_OVERLAPS;
    COUNT(*)
    612
    13:48:12 [email protected]:SQL> select count(*)
    13:48:17 2 from imap_topol.TP$_PARCEL_AREAS pa,
    13:48:21 3 TP$_PARCEL_CENTROID_AREA pca
    13:48:21 4 where pca.DELETE_DATE IS NULL
    13:48:21 5 and pa.DELETE_DATE IS NULL
    13:48:21 6 and pa.AREA_ID = pca.AREA_ID;
    COUNT(*)
    1310665
    There was no reason for both filter and within_distance. I did try use the anyinteract but for some reason that does not return the desired results(I've added one id row as a test to make sure it returns desired results). Plus Oracle have recomended using the within distance for better performance..
    so the explan plan for
    14:38:37 [email protected]:SQL> EXPLAIN PLAN FOR
    14:38:50 2 SELECT lu.LNU_PARCEL_ID
    14:38:50 3 FROM
    14:38:50 4 seventy.PARCEL_OVERLAPS po,
    14:38:50 5 imap_topol.TP$_PARCEL_AREAS pa,
    14:38:50 6 TP$_PARCEL_CENTROID_AREA pca,
    14:38:50 7 TDCR_LAND_UNIT lu
    14:38:50 8 WHERE
    14:38:50 9 sdo_within_distance(pa.area,po.geometry,'distance=0')='TRUE' and
    14:38:50 10 pa.delete_date is null and
    14:38:50 11 Lu.LNU_LAND_UNIT_UNIQUE_NUM = pca.CENTROID_ID and
    14:38:50 12 pa.AREA_ID = pca.AREA_ID and
    14:38:50 13 pca.DELETE_DATE IS NULL and
    14:38:50 14 pa.DELETE_DATE IS NULL;
    is
    Plan Table
    | Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT | | 4G|32920G| 547M| | |
    | NESTED LOOPS | | 4G|32920G| 547M| | |
    | MERGE JOIN | | 547M| 2029G| 230124 | | |
    | SORT JOIN | | 1M| 36M| 85014 | | |
    | MERGE JOIN | | 1M| 36M| 50019 | | |
    | SORT JOIN | | 1M| 17M| 21650 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 1M| 17M| 485 | | |
    | SORT JOIN | | 1M| 22M| 28369 | | |
    | TABLE ACCESS FULL |TDCR_LAND | 1M| 22M| 2127 | | |
    | SORT JOIN | | 42K| 160M| 145111 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 42K| 160M| 12697 | | |
    | TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
    14:43:14 [email protected]:SQL> explain plan for
    14:43:23 2 SELECT pa.AREA_ID
    14:43:23 3 FROM seventy.PARCEL_OVERLAPS po,
    14:43:23 4 imap_topol.TP$_PARCEL_AREAS pa
    14:43:23 5 WHERE SDO_RELATE(po.geometry, pa.area,'mask=ANTINTERACT querytype=WINDOW') = 'TRUE'
    14:43:23 6 and pa.DELETE_DATE IS NULL;
    Plan Table
    | Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT | | 6M| 50G| 10M| | |
    | NESTED LOOPS | | 6M| 50G| 10M| | |
    | TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 850K| 3G| 12697 | | |
    14:45:03 [email protected]:SQL> explain plan for
    14:45:04 2 SELECT pa.AREA_ID
    14:45:05 3 FROM seventy.PARCEL_OVERLAPS po,
    14:45:05 4 imap_topol.TP$_PARCEL_AREAS pa
    14:45:05 5 WHERE SDO_RELATE(pa.area, po.geometry,'mask=ANTINTERACT querytype=WINDOW') = 'TRUE'
    14:45:05 6 and pa.DELETE_DATE IS NULL;
    Plan Table
    | Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT | | 6M| 50G| 863554 | | |
    | NESTED LOOPS | | 6M| 50G| 863554 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 850K| 3G| 12697 | | |
    | TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
    --------------------------------------------------------------------------------

  • Polygon with a hole

    Hi all,
    I Have got a polygon with a hole, How can I have  Exterior rings vertices only?
    This is a shape example
    MDSYS.SDO_GEOMETRY(3003,null,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,16,2003,1),MDSYS.SDO_ORDINATE_ARRAY(575876.863338807,5000843.2303514,0,575875.717173073,5000826.03786538,0,575893.511998443,5000824.19470697,0,575894.261480691,5000843.33533055,0,575876.863338807,5000843.2303514,0,575881.116715103,5000837.33947256,0,575886.290860426,5000837.06483032,0,575886.092402506,5000829.67988328,0,575880.8284527,5000830.19056495,0,575881.116715103,5000837.33947256,0))                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
    If I use this statement I get back all vertices                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
    SELECT c.id,  t.X, t.Y, t.id
       FROM LAND c,
       TABLE(SDO_UTIL.GETVERTICES(c.GEOMETRY2)) t
       WHERE c.ID = 3888
    I work on Oracle Database 10g
    Thanks in advance.
    Angelo

    Hi Angelo,
    Note this has been answered before on the forum
    How do I remove inner rings from a complex geometry of SDO_GEOMETRY type
    In terms of your code, you need a second parameter for the ring extraction.  The first ",1" grabs the first element (for a single part geometry its just the geometry) and the second ",1" grabs the first ring of that first element.  Note there are a lot of caveats to your simple extraction that the code in the post above may help with. 
    Paul
    SELECT c.id,  t.X, t.Y, t.id
      FROM LAND c,
      TABLE(SDO_UTIL.GETVERTICES(sdo_util.extract(c.GEOMETRY2,1,1))) t
      WHERE c.ID = 3888

  • Validate geometry can't check polygon with puncture?

    Hi,
    I have polygon with puncture as follow:
    POLYGON ((100.378750779898 -0.310282546668259, 100.378772459506 -0.310271543916926, 100.378838852504 -0.310235840196097, 100.378845732154 -0.310224416657996, 100.378844002915 -0.31020930373441, 100.37871739762 -0.309977750136478, 100.378616547328 -0.310045414011517, 100.378548060368 -0.309924611880424, 100.378750779898 -0.310282546668259))
    According to OGC simple feature it is invalid geometry because it has a puncture. ArcGIS SDE can't render this geoemetry. However, sdo_geometry.validate_geoemetry says it is a valid geometry. Why sdo doesn't consider this as an invalid geoemrty?

    Hi,
    It'd be useful if you provided a bit more information with your post:
    - your name (user3907494 ?)
    - the version of Oracle
    - the tolerance that you validated at
    Note that the geometry doesn't actually seem to be self intersecting - there seems to be an 8mm gap at the point where you might think it self intersects.
    I validated the geometry on 10.2.0.5 and 11.2.0.2 and got different results.
    Invalid on 10.2.0.5:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE    10.2.0.5.0      Production
    TNS for 64-bit Windows: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    5 rows selected.
    SQL> select sdo_geom.validate_geometry_with_context(
      2    sdo_geometry(2003, 8307, null, sdo_elem_info_array(1,1003,1),
      3    sdo_ordinate_array(
      4    100.378750779898, -0.310282546668259,
      5    100.378772459506, -0.310271543916926,
      6    100.378838852504, -0.310235840196097,
      7    100.378845732154, -0.310224416657996,
      8    100.378844002915, -0.31020930373441,
      9    100.37871739762, -0.309977750136478,
    10    100.378616547328, -0.310045414011517,
    11    100.378548060368, -0.309924611880424,
    12    100.378750779898, -0.310282546668259
    13    )), 0.00005) as result
    14  from dual;
    RESULT
    13349 [Element <1>] [Ring <1>][Edge <8>][Edge <6>]Valid on 11.2.0.2
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    5 rows selected.
    SQL> select sdo_geom.validate_geometry_with_context(
      2    sdo_geometry(2003, 8307, null, sdo_elem_info_array(1,1003,1),
      3    sdo_ordinate_array(
      4    100.378750779898, -0.310282546668259,
      5    100.378772459506, -0.310271543916926,
      6    100.378838852504, -0.310235840196097,
      7    100.378845732154, -0.310224416657996,
      8    100.378844002915, -0.31020930373441,
      9    100.37871739762, -0.309977750136478,
    10    100.378616547328, -0.310045414011517,
    11    100.378548060368, -0.309924611880424,
    12    100.378750779898, -0.310282546668259
    13    )), 0.00005) as result
    14  from dual;
    RESULT
    TRUEI'm not too sure why this happens. Maybe someone else can comment?
    Regards,
    John

Maybe you are looking for

  • Purge cache on Bridge CC

    Hi, My CC Bridge is not running well as it asks for the caches to be purged. When I try to do so in the preferences settings, the program gets stuck. How can I fix this glitch? My account is [email protected] Thanks.

  • How to use the Columns Hidden | space in the bottom of af:panelCollection?

    Hi,experts, In jdev 11.1.2.3, I can see a row of Columns Hidden | Columns Frozen in the bottom of component af:panelCollection - pc1 which have an af:table - t1 component inside in designer view, and can see there is a blank row space only with "|" i

  • Iphone 4S block during update 6.1.3 and iTunes doesn't recognize my phone

    Hi. During update on iphone 4S, I had an error message from itunes. It said that update wasn't possible. And now Iphone block on the screen to connect to iTunes. But iTunes doesn't recognize iPhone. If I try to reinstall the last version, I have the

  • How to make a whole table row be read at once?

    Hi, I want to make a whole table row be read at once by screenreaders if the table is not editable? I tried to use "getAccessibleSelection" and return a own implementation which returns the number of columns at "getAccessibleSelectionCount". But if "

  • PM8M-V CMOS needs clearing on every reboot, :censored:?

    Hey guys, Just picked up a MSI board in my feeble attempt to build up a PC from scratch and retire my old Dell.  I actually started with an Elitegroup PT800CE-A, since it could also house my CPU, but I had the same problem, and thought the board to b