Spatial queries using Discoverer 3i

We are looking for a web reporting tool for an Oracle 8i Spatial database. Spatial queries are very important to us. Would it make sense and would it be possible to use Oracle Discoverer 3i? This product does not seem to talk the language of a 'spatial user'.

Thanks Dan,
Presumably, it would currently be possible to use Discoverer on database views with fixed spatial where-clauses. Is that right? If so, would it currently also be possible to have a parameterised spatial where-clause, allowing a user for instance to define the spatial view for his particular region. Does Discoverer somehow allow for this?
null

Similar Messages

  • Using JDBC to perform spatial queries using SDO operators

    Hi,
    I want to create a routine to perform the SDO_ANYINTERACT function based on a rectangle as in the following query:
    select LINK_ID from SDO_LINK where
    SDO_ANYINTERACT ( SDO_LINK.LINK, SDO_GEOMETRY(2003,8307,NULL,
    SDO_ELEM_INFO_ARRAY(1,1003,3),
    SDO_ORDINATE_ARRAY(-122.38845,37.78889,-122.38651,37.78923))) = 'TRUE'"
    This query works fine when passed to the executeQuery method of a JDBC Statement. But when I tried to create a PreparedStatement and set the 4 parameters (lon1, lat1, lon2, lat2) that are passed to the SDO_ORDINATE_ARRAY function:
              String sql = "select LINK_ID from SDO_LINK where " +
                   "SDO_ANYINTERACT ( SDO_LINK.LINK, SDO_GEOMETRY(2003,8307,NULL,SDO_ELEM_INFO_ARRAY(1,1003,3),SDO_ORDINATE_ARRAY(" +
                   "?,?,?,?" +
                   "))) = 'TRUE'";
    I am getting an Oracle exception:
    java.sql.SQLException: ORA-03115: unsupported network datatype or representation
    I have tried setting the parameters using setString as well as setFloat methods but still get this error.
    Does anyone know what I am dong wrong? Anyone have an example of calling SDO_ANYINTERACT or other SDO operators via JDBC?
    Thanks
    BW

    Getting the connection is straightforward:
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    } catch (ClassNotFoundException e) {
    throw new SQLException (e.toString());
    Connection conn = DriverManager.getConnection(connURL, userName, userPass);
    I have validated that my query executes and returns results fine when I pass the entire query as a string to executeQuery:
    String sql = "select LINK_ID from SDO_LINK where SDO_ANYINTERACT ( SDO_LINK.LINK, SDO_GEOMETRY(2003,8307,NULL,SDO_ELEM_INFO_ARRAY(1,1003,3),SDO_ORDINATE_ARRAY(-122.38845,37.78889,-122.38651,37.78923))) = 'TRUE'";
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery(sql);
    // Iterate through result set here
    The issue is I am not sure how to pass the 2 (lon,lat) cooridnates fior the SDO_ORDINATE_ARRAY operation in a prepared statement . Perhaps I have to just construct a string?
    For example, doing the following:
    String sql = "select LINK_ID from SDO_LINK where " +
         "SDO_ANYINTERACT ( SDO_LINK.LINK, SDO_GEOMETRY(2003,8307,NULL,SDO_ELEM_INFO_ARRAY(1,1003,3),SDO_ORDINATE_ARRAY(" +
         "?,?,?,?" +
         "))) = 'TRUE'";
    if (conn == null)
         openConnection();
    PreparedStatement pstmt = conn.prepareStatement(sql);
    pstmt.setFloat(1, Float.parseFloat(lon1));
    pstmt.setFloat(2, Float.parseFloat(lat1));
    pstmt.setFloat(3, Float.parseFloat(lon2));
    pstmt.setFloat(4, Float.parseFloat(lat2));
    Then calling:
    ResultSet rs = pstmt.executeQuery(sql);
    Which results in the exception.
    Actually, I found the problem. I want to NOT pass the sql string to the executeQuery statement when using the PreparedStatement.
    The following works:
    ResultSet rs = pstmt.executeQuery();
    Edited by: wisegb on May 21, 2009 5:39 AM

  • Spatial Queries are CPU bound and show very heavy use of query buffers

    Hi,
    Spatial Queries:
    When using tkprof to analyse spatial queries it is clear that
    there are implicit queries being done by Oracle spatial which
    use vast amounts of buffers, and seem unable to cache basic
    information from query to query - thus resulting in our machine
    being CPU bound when stress testing Oracle Spatial, for example
    the example below shows how information which is fixed for a
    table and not likely to change very often is being retrieved
    inefficiently (note the 26729 query buffers being used to do 6
    executions of what should be immediately available!!!):
    TKPROF: Release 8.1.7.0.0 - Production on Tue Oct 16 09:43:38
    2001
    (c) Copyright 2000 Oracle Corporation. All rights reserved.
    SELECT ATTR_NO, ATTR_NAME, ATTR_TYPE_NAME, ATTR_TYPE_OWNER
    FROM
    ALL_TYPE_ATTRS WHERE OWNER = :1 AND TYPE_NAME = :2 ORDER BY
    ATTR_NO
    call count cpu elapsed disk query rows
    Parse 6 0.00 0.01 0 0 0
    Execute 6 0.00 0.01 0 0 0
    Fetch 6 0.23 0.41 0 26729 5
    total 18 0.23 0.43 0 26729 5
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 37 (NAGYE)
    Rows Row Source Operation
    0 SORT ORDER BY
    0 FILTER
    1 NESTED LOOPS
    1 NESTED LOOPS
    290 NESTED LOOPS
    290 NESTED LOOPS
    290 NESTED LOOPS
    290 NESTED LOOPS
    290 TABLE ACCESS FULL ATTRIBUTE$
    578 TABLE ACCESS CLUSTER TYPE$
    578 TABLE ACCESS CLUSTER TYPE$
    578 INDEX UNIQUE SCAN (object id 255)
    578 TABLE ACCESS BY INDEX ROWID OBJ$
    578 INDEX RANGE SCAN (object id 35)
    578 TABLE ACCESS CLUSTER USER$
    578 INDEX UNIQUE SCAN (object id 11)
    289 TABLE ACCESS BY INDEX ROWID OBJ$
    578 INDEX RANGE SCAN (object id 35)
    0 TABLE ACCESS CLUSTER USER$
    0 INDEX UNIQUE SCAN (object id 11)
    0 FIXED TABLE FULL X$KZSPR
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN (object id 101)
    error during parse of EXPLAIN PLAN statement
    ORA-01039: insufficient privileges on underlying objects of the
    view
    and again:
    SELECT diminfo, nvl(srid,0)
    FROM
    ALL_SDO_GEOM_METADATA WHERE OWNER = 'NAGYE' AND TABLE_NAME =
    NLS_UPPER('TILE_MED_LINES_MBR') AND '"'||COLUMN_NAME||'"'
    = '"GEOM"'
    call count cpu elapsed disk query
    current rows
    Parse 20 0.00 0.04 0
    0 0 0
    Execute 20 0.00 0.00 0
    0 0 0
    Fetch 20 0.50 0.50 0 5960
    100 20
    total 60 0.50 0.54 0 5960
    100 20
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 37 (NAGYE) (recursive depth: 1)
    Rows Row Source Operation
    1 FILTER
    2 TABLE ACCESS BY INDEX ROWID SDO_GEOM_METADATA_TABLE
    2 INDEX RANGE SCAN (object id 24672)
    1 UNION-ALL
    1 FILTER
    1 NESTED LOOPS
    1 NESTED LOOPS
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS
    1 TABLE ACCESS FULL OBJ$
    1 TABLE ACCESS CLUSTER TAB$
    1 INDEX UNIQUE SCAN (object id 3)
    0 TABLE ACCESS BY INDEX ROWID OBJ$
    1 INDEX UNIQUE SCAN (object id 33)
    0 INDEX UNIQUE SCAN (object id 33)
    0 TABLE ACCESS CLUSTER USER$
    1 INDEX UNIQUE SCAN (object id 11)
    1 TABLE ACCESS CLUSTER SEG$
    1 INDEX UNIQUE SCAN (object id 9)
    1 TABLE ACCESS CLUSTER TS$
    1 INDEX UNIQUE SCAN (object id 7)
    1 TABLE ACCESS CLUSTER USER$
    1 INDEX UNIQUE SCAN (object id 11)
    0 FILTER
    0 NESTED LOOPS
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS
    0 TABLE ACCESS FULL USER$
    0 TABLE ACCESS BY INDEX ROWID OBJ$
    0 INDEX RANGE SCAN (object id 34)
    0 INDEX UNIQUE SCAN (object id 97)
    0 INDEX UNIQUE SCAN (object id 96)
    0 FIXED TABLE FULL X$KZSPR
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN (object id 101)
    0 FIXED TABLE FULL X$KZSPR
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN (object id 101)
    error during parse of EXPLAIN PLAN statement
    ORA-01039: insufficient privileges on underlying objects of the
    view
    Note: The actual query being performed is:
    select a.id, a.geom
    from
    tile_med_lines_mbr a where sdo_relate(a.geom,mdsys.sdo_geometry
    (2003,NULL,
    NULL,mdsys.sdo_elem_info_array
    (1,1003,3),mdsys.sdo_ordinate_array(151.21121,
    -33.86325,151.21132,-33.863136)), 'mask=anyinteract
    querytype=WINDOW') =
    'TRUE'
    call count cpu elapsed disk query
    current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.08 0.08 0 4 0 0
    Fetch 5 1.62 21.70 0 56 0 827
    total 7 1.70 21.78 0 60 0 827
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 37 (NAGYE)
    Rows Row Source Operation
    827 TABLE ACCESS BY INDEX ROWID TILE_MED_LINES_MBR
    828 DOMAIN INDEX
    Rows Execution Plan
    0 SELECT STATEMENT GOAL: CHOOSE
    827 TABLE ACCESS GOAL: ANALYZED (BY INDEX ROWID) OF
    'TILE_MED_LINES_MBR'
    828 DOMAIN INDEX OF 'TILE_MLINES_SPIND'
    CPU: none, I/O: none
    call count cpu elapsed disk query
    current rows
    Parse 1 0.00 0.00 0 92
    Execute 1 0.00 0.00 0 22
    Fetch 1 0.00 0.00 38 236
    total 3 0.00 0.00 38 350
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 37 (NAGYE)
    Rows Row Source Operation
    12 TABLE ACCESS BY INDEX ROWID ROADELEMENT_MBR
    178 DOMAIN INDEX
    Rows Execution Plan
    0 SELECT STATEMENT GOAL: CHOOSE
    12 TABLE ACCESS GOAL: ANALYZED (BY INDEX ROWID) OF
    'ROADELEMENT_MBR'
    178 DOMAIN INDEX OF 'RE_MBR_SPIND'
    CPU: none, I/O: none
    Can Oracle improve the performance of Oracle spatial by
    improving the implementation so as to perform alternative
    implicit queries so as not to use these vast amounts of memory?
    Cheers
    Alex Eadie

    Hi Ravi,
    Thankyou for your reply.
    Here are some more details for you:
    Yes the queries are cached in that it gets its data from RAM and
    not from disk however the number of buffers used internally by
    Oracle RDBMS/Spatial is rather large and results in significant
    CPU usage (namely > 5000 per query or >40MByte). Which I'm sure
    you'd agree? Those numerous internal queries taking >10ms CPU
    time each, which is culmulative.
    A single real of ours query of will take between 180ms and 580ms
    depending on the number of results returned.
    An example query is:
    select a.id, a.geom
    from tile_med_lines_mbr a where sdo_relate
    (a.geom,mdsys.sdo_geometry
    (2003,NULL, NULL,mdsys.sdo_elem_info_array
    (1,1003,3),mdsys.sdo_ordinate_array(151.21121,
    -33.86325,151.21132,-33.863136)), 'mask=anyinteract
    querytype=WINDOW') = 'TRUE'
    Our 500Mhz PC Server database can only execute 3 processes
    running these queries simultaneously to go to 100% CPU loaded.
    The disk is hardly utilized.
    The data is the main roads in Sydney, Australia.
    The tables, data and indexes were created as shown below:
    1.     Create the Oracle tables:
    create table tile_med_nodes_mbr (
         id     number not null,
         geom     mdsys.sdo_geometry not null,
         xl     number not null,
         yl     number not null,
         xh     number not null,
         yh     number not null);
    create table tile_med_lines_mbr (
         id     number not null,
         fromid     number not null,
         toid     number not null,
         geom     mdsys.sdo_geometry not null,
         xl     number not null,
         yl     number not null,
         xh     number not null,
         yh     number not null);
    2.     Use the sqlldr Oracle loader utility to load the data
    into Oracle.
    % sqlldr userid=csiro_scats/demo control=nodes.ctl
    % sqlldr userid=csiro_scats/demo control=lines.ctl
    3.     Determine the covering spatial extent for the tile
    mosaic and use this to create the geometry metadata.
    % sqlplus
    SQLPLUS>     set numw 12
    SQLPLUS>     select min(xl), min(yl), max(xh), max(yh)
         from (select xl, yl, xh, yh
              from tile_med_nodes_mbr union
              select xl, yl, xh, yh
              from tile_med_lines_mbr);
    insert into USER_SDO_GEOM_METADATA
         (TABLE_NAME, COLUMN_NAME, DIMINFO)
         VALUES ('TILE_MED_NODES_MBR', 'GEOM',
         MDSYS.SDO_DIM_ARRAY
         (MDSYS.SDO_DIM_ELEMENT('X', 151.21093421,
                   151.21205421, 0.000000050),
         MDSYS.SDO_DIM_ELEMENT('Y', -33.86347146,
                   -33.86234146, 0.000000050)));
    insert into USER_SDO_GEOM_METADATA
         (TABLE_NAME, COLUMN_NAME, DIMINFO)
         VALUES ('TILE_MED_LINES_MBR', 'GEOM',
         MDSYS.SDO_DIM_ARRAY
         (MDSYS.SDO_DIM_ELEMENT('X', 151.21093421,
                   151.21205421, 0.000000050),
         MDSYS.SDO_DIM_ELEMENT('Y', -33.86347146,
                   -33.86234146, 0.000000050)));
    4.     Validate the data loaded:
    create table result
    (UNIQ_ID number, result varchar2(10));
    execute sdo_geom.validate_layer
    ('TILE_MED_NODES_MBR','GEOM','ID','RESULT');
    select result, count(result)
    from RESULT
    group by result;
    truncate table result;
    execute sdo_geom.validate_layer
    ('TILE_MED_LINES_MBR','GEOM','ID','RESULT');
    select result, count(result)
    from RESULT
    group by result;
    drop table result;
    5.     Fix any problems reported in the result table.
    6.     Create a spatial index, use the spatial index advisor to
    determine the sdo_level.
    create index tile_mlines_spind on
    tile_med_lines_mbr (geom) indextype is
    mdsys.spatial_index parameters
    ( 'sdo_level=7,initial=1M,next=1M,pctincrease=0');
    7.     Analyse table:
    analyze table TILE_MED_LINES_MBR compute statistics;
    8.     Find the spatial index table name:
    select sdo_index_table, sdo_column_name
    from user_sdo_index_metadata
    where sdo_index_name in
    (select index_name
    from user_indexes
    where ityp_name = 'SPATIAL_INDEX'
    and table_name = 'TILE_MED_LINES_MBR');
    9.     Analyse spatial index table:
    analyze table TILE_MLINES_SPIND_FL7$
    compute statistics;
    I hope this helps.
    Cheers
    Alex Eadie

  • Spatial Queries Not Always Producing Accurate Results

    Hi,
    Spatial queries are not always producing accurate results. Here are the issues. We would appreciate any clarification you could provide to resolve these issues.
    1. When querying for points inside a polygon that is not an MBR (minimum bounded rectangle), some of the coordinates returned are not inside the polygon. It is as though the primary filter is working, but not the secondary filter when using sdo_relate. How can we validate that the spatial query using sdo_relate is using the secondary filter?
    2. SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT returns true when validating geometries even though we find results that are invalid.
    3. Illegal geodetic coordinates can be inserted into a table: latitude > 90.0, latitude < -90.0, longitude > 180.0 or longitude < -180.0.
    4. Querying for coordinates outside the MBR for the world where illegal coordinates existed did NOT return any rows, yet there were coordinates of long, lat: 181,91.
    The following are examples and information relating to the above-referenced points.
    select * from USER_SDO_GEOM_METADATA
    TABLE_NAME      COLUMN_NAME      DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)      SRID
    LASTKNOWNPOSITIONS      THE_GEOM SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .05), SDO_DIM_ELEMENT('Y', -90, 90, .05))      8307
    POSITIONS     THE_GEOM SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .05), SDO_DIM_ELEMENT('Y', -90, 90, .05))      8307
    Example 1: Query for coordinates inside NON-rectangular polygon includes points outside of polygon.
    SELECT l.vesselid, l.latitude, l.longitude, TO_CHAR(l.observationtime,
    'YYYY-MM-DD HH24:MI:SS') as obstime FROM lastknownpositions l where
    SDO_RELATE(l.the_geom,SDO_GEOMETRY(2003, 8307, NULL,
    SDO_ELEM_INFO_ARRAY(1, 1003, 1),
    SDO_ORDINATE_ARRAY(-98.20268,18.05079,-57.30101,18.00705,-57.08229,
    54.66061,-98.59638,32.87842,-98.20268,18.05079)),'mask=inside')='TRUE'
    This query returns the following coordinates that are outside of the polygon:
    vesselid : 1152 obstime : 2005-08-24 06:00:00 long : -82.1 lat : 45.3
    vesselid : 3140 obstime : 2005-08-28 12:00:00 long : -80.6 lat : 44.6
    vesselid : 1253 obstime : 2005-08-22 09:00:00 long : -80.0 lat : 45.3
    Example 2a: Using SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT
    Select areaid, the_geom,
    SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(the_geom, 0.005) from area where
    areaid=24
    ResultSet:
    AREAID THE_GEOM(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO,
    SDO_ORDINATES) SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(THE_GEOM,0.005)
    24 SDO_GEOMETRY(2003, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(-98.20268, 18.05079, -57.30101, 18.00705, -57.08229, 54.66061, -98.59638, 32.87842, -98.20268, 18.05079)) TRUE
    Example 2b: Using SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT
    Select positionid, vesselid, the_geom,
    SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(the_geom, 0.005) from positions where vesselid=1152
    ResultSet:
    POSITIONID VESSELID THE_GEOM(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z),
    SDO_ELEM_INFO, SDO_ORDINATES) DO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(THE_GEOM,0.005)
    743811 1152 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-82.1, 45.3, NULL), NULL, NULL) TRUE
    743812 1152 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-82.1, 45.3, NULL), NULL, NULL) TRUE
    743813 1152 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-80.2, 42.5, NULL), NULL, NULL) TRUE
    743814 1152 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-80.2, 42.5, NULL), NULL, NULL) TRUE
    Example 3: Invalid Coordinate values found in POSITIONS table.
    SELECT p.positionid, p.latitude, p.longitude, p.the_geom FROM positions p
    WHERE p.latitude < -180.0
    2 lines from ResultSet:
    POSITIONID LATITUDE LONGITUDE THE_GEOM(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    714915 -210.85408 -79.74449 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-79.74449, -210.85408, NULL), NULL, NULL)
    714938 -211.13632 -79.951256 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-79.951256, -211.13632, NULL), NULL, NULL)
    SELECT p.positionid, p.latitude, p.longitude, p.the_geom FROM positions p
    WHERE p.longitude > 180.0
    3 lines from ResultSet:
    POSITIONID LATITUDE LONGITUDE THE_GEOM(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    588434 91 181 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(181, 91, NULL), NULL, NULL)
    589493 91 181 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(181, 91, NULL), NULL, NULL)
    589494 91 181 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(181, 91, NULL), NULL, NULL)
    Example 4: Failure to locate illegal coordinates by querying for disjoint coordinates outside of MBR for the world:
    SELECT p.vesselid, p.latitude, p.longitude, p.the_geom,
    TO_CHAR(p.observationtime, 'YYYY-MM-DD HH24:MI:SS') as obstime,
    SDO_GEOM.RELATE(p.the_geom, 'determine',
    SDO_GEOMETRY(2003, 8307, NULL,SDO_ELEM_INFO_ARRAY(1, 1003, 1),
    SDO_ORDINATE_ARRAY(-180.0,-90.0,180.0,-90.0,180.0,90.0,
    -180.0,90.0,-180.0,-90.0)), .005) relationship FROM positions p where
    SDO_GEOM.RELATE(p.the_geom, 'disjoint', SDO_GEOMETRY(2003, 8307,
    NULL,SDO_ELEM_INFO_ARRAY(1, 1003, 1),
    SDO_ORDINATE_ARRAY(-180.0,-90.0,180.0,-90.0,180.0,90.0,-80.0,90.0,
    -180.0,-90.0)),.005)='TRUE'
    no rows selected
    Carol Saah

    Hi Carol,
    1) I think the results are correct. Note in a geodetic coordinate system adjacent points in a linestring or polygon are connected via geodesics. You are probably applying planar thinking to an ellipsoidal problem! I don't have time to do the full analysis right now, but a first guess is that is what is happening.
    2) The query window seems to be valid. I don't think this is a problem.
    3) Oracle will let you insert most anything into a table. In the index, it probably wraps. If you validate, I think the validation routines will tell you is is illegal if you use the signature with diminfo, where the coordinate system bounds are included in the validation.
    4) Your query window is not valid. Your data is not valid. As the previous reply stated, you need to have valid data. If you think in terms of a geodetic coordinate system, you will realize that -180.0,-90.0 and 180.0,-90.0 are really the same point. Also, Oracle has a rule that polygon geometries cannot be greater than half the surface of the Earth.
    Hope this helps.

  • Spatial query using C#

    hi,
    we're getting some odd behaviour using the Oracle Data Provider for .Net. spatial queries return no data unless the indexes on the queried table are rebuilt, the query returns data when executed using sql*plus.
    we're coding in C#, the database version is 9.2.
    is this a bug, has it been reported, and is there any documentation on it?
    are they any on-line resources i could refer to?
    any help will be appreciated (this is extremely urgent)
    thanks
    santosh sewlal

    Seems something specific to Spatial and not to ODP.NET. Please work with Oracle Support to resolve this issue.

  • How to make spatial computations use more/all CPU power?

    Hi,
    In an service I'm calculating spatial data (using Microsoft.SqlServer.Types) in memory. These calculations often take 4-5 minutes but they are never, ever, using more than 50% CPU. I have tried this on a single core too (Azure) and still, CPU won't go above
    50%. I'd really like 100% CPU usage in these services. 
    What to look for in the code? I've got a lot of loops and where possible I'm using AsParallell() to take advantage of instances with multiple cores. 
    Why doesn't the service just claim full speed on the CPU and get the job done twice as fast?
    Werner

    Can you clarify what it is exactly that you're trying to do?
    you say that you're using the .net libraries to perform spatial computations in memory but then you mention that you also have spatial data (i'm assuming from the index comment) in the database..
    Where is the bottleneck? on the db site for when you're pulling out the spatial data or on the .net app server that's running the service?
    Is the query using the spatial indexes? is trace flag 4199 on?
    I found that rolling my own tesselation function greatly improved parallelism in regards to spatial queries, although this is only applicable to point in polygon type queries eg return the name/attribute of the complex polygon in which the lat/long sits
    more info here:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/78132bca-2a95-45c1-b93c-64c83827dc4f/sql-2k8r2-any-performance-hints-for-bulk-loading-data-from-spatialgis-db-into-a-data-warehouse?forum=sqlspatial
    Jakub @ Adelaide, Australia

  • Continual library cache misses in trace file for spatial queries

    Hi all,
    Could somebody explain to me how the SQL parse engine works for spatial queries.
    My understanding is that Oracle creates a hash value for SQL that is parsed with no errors. This hash value is then stored in the library cache ready to be matched against other incoming SQL statements. This provides one of the main reasons for using parametising SQL in languages such as PL/SQL, .Net etc and improves performance on query intensive applications.
    However i have noticed that for spatial, any queries except for refreshes of identical ones already sent, the SQL engines re parses the query. This can take upto 0.2 seconds which is causing a performance bottle neck.
    When looking at the full trace file of a single spatial query using SDO_FILTER with a query window the amount of additional internal queries that are performed is quiet a lot. Are these additional queries included in the total parse time?
    I am wondering why for spatial queries the only way to get a hit in the library cache was to refresh an exact same SQL that had been previously sent?
    Thanks
    Daniel

    Those additional internal queries are not included in the parse time,
    if they are used in the execution time.
    Edited by: yhu on Mar 4, 2011 10:52 AM

  • Example Oracle Spatial Queries for NAVTEQ Data

    Hi,
    I recently installed NAVTEQ RDF data into an Oracle database. I am new to Oracle Spatial and am looking for some example queries using the NAVTEQ data in the Oracle database.
    For example, suppose I have a point (latitude,longitude). What are the queries for each of these:
    1) find roads or faces within 5 miles of that point;
    2) find roads or faces that cover that point
    Thanks!
    Bowden

    Hi,
    There are a lot of of ways to license the data (county, state, country), there are different flavors (mapping, geocoding, and routing), and there are different licensing options for the Oracle platform (user based and cpu/core based). I cannot think of a use case that would approach the cost below.
    Feel free to drop me an email (daniel dot abugov at navteq dot com) and we can discuss.
    Dan Abugov
    NAVTEQ Enterprise Business Development and Consulting

  • Spatial Query in Discoverer

    Hi,
    I want to know if is possible to exec spatial queries in Oracle Discover, for example :
    SELECT A
    FROM BOLO
    WHERE SDO_WITHIN_DISTANCE(GEOLOC,
    (SELECT GEOLOC FROM BOLOCAP WHERE CAP = 40400),
    'distance = 0') = 'TRUE'
    And how is it possible?
    Thanks

    The query as you have written it is not Disco-friendly.
    Can you rewrite it without the subselect?
    If you can avoid the subselect, you must tell Disco about the SDO_WITHIN_DISTANCE function (in Admin) and then you can use the function in reports, etc.
    Disco doesn't do subselects - not directly anyway.
    d.

  • How to find out the list of users who used Discoverer

    Dear All,
    We have Oracle E-Business Suite 11.5.10.2 with Disco. 4i.
    We need to know how we can find out the Employee ID, Responsibility, Org... who used discoverer during a specific period in the past ? For example the last year.
    Any help plz.
    Regards,
    Mohammad Muhtadi

    I'm not sure You can get the responsibilities or the org that was used in that specific run but as for getting when it was run and by whom...
    Try that SQL:
    select distinct
    qs.qs_doc_name workbook,
    --qs.qs_doc_details worksheet,
    case when instr(qs.qs_doc_owner,'#')=1 then substr(qs.qs_doc_owner,2,10) else qs.qs_doc_owner end workbook_owner,
    qs.qs_created_date run_date,
    case when instr(qs.qs_created_by,'#')=1 then substr(qs.qs_created_by,2,10) else qs.qs_created_by end apps_user_id,
    fu.user_name apps_user_name,
    ppf.FULL_NAME user_full_name,
    ppf.EMPLOYEE_NUMBER user_employee_number
    from
    eul_us.eul4_qpp_stats qs,
    fnd_user fu,
    per_people_f ppf
    where to_number(substr(qs.qs_created_by,2,10))=fu.user_id(+)
    and fu.employee_id=ppf.PERSON_ID
    and sysdate between ppf.EFFECTIVE_START_DATE and ppf.EFFECTIVE_END_DATE
    change the "eul_us" to the discoverer schema.
    Basically the primary data you are looking for lies in the qpp_stats table...

  • Currency Translation Type in queries using currency conversion

    I have a question on the Currency Translation Type (EUR_VAR) that is used in all of the queries using currency conversion on the fly. (currency is maintained automatically nor in table.)
    User wants to use 2 different exchange rates in a single query. The months in 2010 (Actuals) are to
    be converted using Xchangerate-type EURO and the months in 2011 (Planned) to use Xchangerate-type USD.
    But store different rates with different starting dates. This is however not possible because the Currency Translation
    Type is set-up (1) to work with Query Key date - rather than a characteristic in the data and (2) apparently these
    currency translation types only work with time characteristics like 0fiscyear
    My idea is therefor to:
    1. Create a new variable (similar to EXC_RATE) to prompt for a 2nd Exchange Rate type when query starts
    2. Create a new Currency Translation Type (next to EUR_VAR), referencing the new variable or sticking to fixed Xrate type, fixed to EUR
    Is this possible to create Idea (2)
    Many Thanks in Advance.

    The best way would be to create two curr conversion types , one converting to EUR and other to USD .Put them in properties of coressponding KFs in query.For timref in RSCUR , variable time ref can be used individually for two conv types.

  • Oracle discoverer ver 9.0.2.39.02 - Error While using  discoverer plus

    Hi,
    I have installed oracle 9i discoverer ver 9.0.2.39.02 and while tyring to use Discoverer Plus (http://ip:port/discoverer/plus)
    I get error when creaating a workbook using workbook wizard, if i go thru the steps 1 to 10 It just does'nt do anything when i click Finish. At the same time
    If i click Finish on the Table layout screen immediately after selecting the items it generates the worksheet
    what could be the reason for me unable to generate the worksheet.
    Create / edit Business Privilege is granted to the user.
    can anybody help me.
    Thanks

    Hi
    But Desktop is not the product that you reported the error on, you said that Plus was giving you the problem.
    Desktop generally has far fewer issues that Plus because it is a client-based tool and I would expect it to work fine in Desktop.
    Have you ever had 9.0.2 Plus working as you describe or have you recently installed it? Either way, I strongly recommend upgrading your Discoverer Plus to the version in my previous reply.
    By the way, I think you will find that most people rapidly got off 9.0.2 as soon as 9.0.4 came out which was 10g Release 1. If you look on my blog: http://learndiscoverer.blogspot.com/ you will see a couple of surveys that were conducted earlier this year. The top one indicates that only 4% of Discoverer sites are using 9.0.2. Of those I would suggest most will be on the 54 release which really was quite stable.
    You will fnd it really hard to get help if you stay on the 39 release because there are so few folks around who have it installed.
    Best wishes
    Michael

  • How to find out the top 20 queries used in a week

    Hi Guru's,
    I would like to know how to gather the information regarding the Top 20 queries used in the system per week, by a multicube.
    Note: I am using BI 7.0 and also Statistics are turned on.
    The aim is to pre-calculate these queries at night to help with the user experience.
    Thanks and regards,

    Hi
    U can check in RSZCOMPDIR if u did not find the info then go to se11 and give RSZ* and press F4 u will get all the tables which relates to reports
    Assign points if it helps
    Khaja

  • Poor performance of BLOB queries using ODBC

    I'm getting very poor performance when querying a BLOB column using ODBC. I'm using an Oracle 10g database and the Oracle 10g ODBC driver on Windows XP.
    I create two tables:
    create table t1 ( x int primary key, y raw(2000) );
    create table t2 ( x int primary key, y blob );
    Then I load both tables with the same data. Then I run the following queries using ODBC:
    SELECT x, y FROM t1;
    SELECT x, y FROM t2;
    I find that the BLOB query takes about 10 times longer than the RAW query to execute.
    However, if I execute the same queries in SQL*Plus, the BLOB query is roughly as fast as the RAW query. So the problem seems to be ODBC-related.
    Has anyone else come across this problem ?
    Thanks.

    Hi Biren,
    By GUID, are you referring to the Oracle Portal product?

  • Executing spatial queries on someone else's tables

    I am trying to execute a spatial
    query using a table owned by
    someone else.
    The SQL is...
    select a.plancoupe, a.coupecrop, a.ha
    from dba1.coupes a, dba1.coupes b
    where b.plancoupe = 'CM004H' and
    mdsys.sdo_within_distance(a.geom,b.geom,
    'distance=1000 querytype=WINDOW')
    = 'TRUE'
    The query works fine when I am connected
    as dba1, but when I connect as someone
    else I get...
    ERROR at line 1:
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-13211: failed to tessellate the window object
    ORA-13209: internal error while reading SDO_INDEX_METADATA table
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 73
    ORA-06512: at line 1
    I have granted SELECT permissions on the
    table in question to PUBLIC and also to
    dba1.sdo_geom_metadata and the spatial
    index table generated by the spatial
    indexing creation routines...
    Any ideas?
    regards
    SImon

    Hi Simon,
    From your e-mail below, I assume you are
    running Oracle 8.1.5.
    Here is what you need to do for 8.1.5.
    Hope this helps.
    Please let me know if you have any questions. Thanks.
    Dan
    ======
    In Oracle 8.1.6, your query will work
    if you do the following:
    1) Grant select on dba1.coupes
    2) Grant select on the spatial index
    table created on dba1.coupes
    In Oracle 8.1.5 ONLY, do steps 3 and 4:
    3) In addition to step 1 and 2 above,
    grant select on sdo_geom_metadata
    4) As the Oracle MDSYS user, you must run
    the following:
    connect mdsys/mdsys
    drop view sdo_index_metadata;
    create view sdo_index_metadata as
    select SDO_INDEX_OWNER, SDO_INDEX_NAME, SDO_INDEX_TABLE, SDO_INDEX_PRIMARY,
    SDO_TSNAME, SDO_COLUMN_NAME,
    SDO_LEVEL, SDO_NUMTILES,
    SDO_MAXLEVEL, SDO_COMMIT_INTERVAL,
    SDO_FIXED_META,
    SDO_TABLESPACE,
    SDO_INITIAL_EXTENT,
    SDO_NEXT_EXTENT,
    SDO_PCTINCREASE,
    SDO_MIN_EXTENTS,
    SDO_MAX_EXTENTS
    from SDO_INDEX_METADATA_TABLE
    where
    (exists
    (select table_name from all_tables
    where table_name=sdo_index_table and owner=sdo_index_owner)
    or
    exists
    (select view_name from all_views
    where view_name=sdo_index_table and owner=sdo_index_owner)
    or
    exists
    (select table_name from all_object_tables
    where table_name=sdo_index_table and owner=sdo_index_owner)
    grant select on sdo_index_metadata to public;
    null

Maybe you are looking for

  • How do I connect to Oracle with JDBC using "dedicated processor".

    Because of performance problems we want to try to connect to oracle using dedicated processor. We can do this from SQL Plus, does anybody know what we need to set up in order to utilize this from JDBC?

  • Port 25 bugaboo

    I am banging my head over this email issue. A big problem is that there are three players involved and no one wants to take the blame (of course): Apple (my mail app), Earthlink (my email address client) and Comcast (my ISP). Five or six days ago my

  • Is it possible to use charecterestic used in formula variable

    Got a boolean logic in a formula of the  structure in BEx, i could create a formula variable for date , it works .However, i have to bring payment method into the logic ,( e.g.. if the payment method is 'C'-weekly then late payment logic is different

  • HFM/Workspace Navigation Hang Ups

    Hello Experts, I have been facing an issue in my environment where users will intermittnelty become hung up within workspace while accessing the HFM application. A lot of times it seems like when you double click on a grid, run a consolidation, navig

  • How to sign a certificate signing request

    Hi all, In the PKI process, a client generates a PKCS#10 [certificate signing request|http://en.wikipedia.org/wiki/Certificate_signing_request] (CSR see [sun.security.pkcs.PKCS10|http://www.docjar.com/docs/api/sun/security/pkcs/PKCS10.html] ), sends