Dropping a Spatial Index???

Can anyone explain this? We have tried dropping this in the OEM and from a SQL command line.
SQL>drop index resources.locations_test
ERROR at line 1:
ORA-29856: error occurred in the execution of ODCIINDEXDROP routine
ORA-06550: line 1, column 8:
PLS-00201: identifier 'MDSYS.MDPRVT_IDX' must be declared
ORA-06550: line 1, column 8:
PL/SQL: Statement ignored
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_9I", line 7
ORA-06512: at line 1

Did you recently upgrade the database? What version of Oracle are you running?

Similar Messages

  • Rebuilding Spatial index versus dropping&creating Spatial index.

    System: Oracle Enterprise Edition 10g (10.1.0.4.0)
    When I rebuilding a Spatial Index is the result the same when I am dropping the index and create a new Spatial Index?

    Final result of course will be the same. After rebuild or drop/create you will have the same index.
    Some differences:
    1. Rebuild uses existing index as the source for new index So, during rebuild process index will consume twise as much space.
    2. Rebuild is faster than drop/create
    3. Rebuild with online option guarantee that index will be still available for DML during rebuild
    Andrejus

  • Spatial index - invalid geometry

    Hello,
    I have a table with buildings, on that a spatial index and everything was working fine.
    Then, I added some more data (buildings) and the spatial queries (e.g., sdo_within_distance) didn't work anymore. I then dropped the spatial index and recreated it. That seemed to work fine (sqlplus told me "Index created"). When I go into the enterprise manager and check the spatial index it says this:
    Failed to initialize Related Segments Space Info: ORA-00600: internal error code, arguments: [ktsircinfo_num1], [0], [0], [0], [], [], [], [] ORA-06512: at "SYS.DBMS_SPACE", line 429 ORA-06512: at line 1
    Anyone knows what this might have to do with?
    I also checked the geometries using VALIDATE_GEOMETRY_WITH_CONTEXT and found that there are some geometries with redundant points and self-intersecting boundaries.
    Could this explain the above problem?
    Markus

    Hi, thanks, I decided to try an example word for word but I am still having the same problems.
    I am thinking this might be an OEM error but I don't know. If it is I can live with it, but I need to know what the problem is before I can ignore an error in my production system.
    This is what I am doing:
    Following the directions provided in the following doc:
    Doc ID: Note:146094.1
    Subject: 9i New Feature: SDO_GEOMETRY Objects in Function-Based Indexes
    Type: BULLETIN
    Status: PUBLISHED
    Content Type: TEXT/PLAIN
    Creation Date: 17-MAY-2001
    Last Revision Date: 21-APR-2004
    PURPOSE ------- This article shows how to create and use a function-based index where the function returns an SDO_GEOMETRY object.
    After I create the first index (LONG_LAT_TABLE_IDX) and then use OEM to find indexes for scott schema and click on LONG_LAT_TABLE_IDX entry I get the same exact error.
    I am using 10g.
    Are there "patches" for 10g that I need? If so, how do I figure out what I need?
    Thank you for your time.
    Les.

  • Materialized view issue with spatial index and UNION all.

    Hi guys,
    I'm trying to build the following materialized view:
    create materialized VIEW MV_ElectricalStuffs
      refresh fast
      AS
      SELECT jb.ROWID,
        jb.FID,
        JB.NAME_NUMBER
      FROM EL_BUS_BAR jb
      UNION ALL
      SELECT INC.ROWID,
        INC.FID,
        NULL,
        INC.NAME_NUMBER
      FROM EL_INTERNAL_CELL INC;
    I have this error showing up:
    ORA-12015: cannot create a fast refresh materialized view from a complex query
    This is because the table EL_INTERNAL_CELL has a SDO_GEOMETRY column that has a spatial index, whose ddl is
    CREATE INDEX EL_INTERNAL_CELL_S ON EL_INTERNAL_CELL (GEOM) INDEXTYPE IS MDSYS.SPATIAL_INDEX
    PARAMETERS('SDO_INDX_DIMS=2 TABLESPACE=USERS LAYER_GTYPE=COLLECTION');
    When I remove the spatial index from EL_INTERNAL_CELL column GEOM, Oracle is very happy and creates the view.
    Is there a mean however to keep the spatial index in the materialized view?

    I've managed to drop the spatial index prior to create the materialized view and it is ok. After the materialized view creation, I've recreated the spatial index on the table and all ran smooth. Hope nothing will go bad in the future because of this trick on spatial index..

  • Spatial Index and XA transaction

    Hi all,
    I have problem with spatial index in XA transaction.
    java.sql.SQLException: ORA-29875: failed in the execution of the ODCIINDEXINSERT routine
    ORA-29400: data cartridge error
    ORA-14450: attempt to access a transactional temp table already in use
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 623
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 227
    My configuration Java 5, Tomcat 5.5, UserTransaction manager Bitronix.
    The problem disappears after dropping spatial index.
    sql statement:
    INSERT INTO ICING_SPATIAL.MAP_ISSUES ( FEATURE_ID, GEOMETRY, AUTHOR_ID, ISSUE_ID, ISSUE_STATUS, LANGUAGE, SOURCE, TEXT) VALUES ( ? ,SDO_MIGRATE.TO_CURRENT( ? , ( SELECT DIMINFO FROM ALL_SDO_GEOM_METADATA WHERE OWNER = ? AND TABLE_NAME = ? AND COLUMN_NAME = ? ) ), ? , ? , ? , ? , ? , ? )
    Full stacktrace is:
    java.sql.SQLException: ORA-29875: failed in the execution of the ODCIINDEXINSERT routine
    ORA-29400: data cartridge error
    ORA-14450: attempt to access a transactional temp table already in use
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 623
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 227
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:212)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:951)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1160)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
    at oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:4245)
    All user transactions are commited or rollbacked because the DBA_2PC_PENDING is empty: SQL> select * from SYS.DBA_2PC_PENDING;
    no rows selected
    SQL>
    This problem occures regulary after any 2PC transaction has been rolledback. The next request causes this exception. Sometimes it appears after commit too, but I am able to reproduce it within ten or twenty requests.
    Has anybody had simillar problem?
    Thanks for any suggestions how to check what is going wrong.
    Regards,
    Zdenek Vrablik

    The problem is in Oracle Spatial.
    Oracle database don't support Temporary tables and XA transactions together. Oracle Spatial uses temporary tables.
    Possible solution (I am using)
    One database connection(nonXA) to read data and one connection(XA) to insedt/update/delete data including spatial data.

  • Error in spatial index

    Hi, everyone
    I created a spatial index on a table, but i get the error message:
    ORA-13033: the data in sdo_elem_info_array of sdo_geometry is unavailable
    How can i write a SQL command to delete those unavailable records?

    Hi,
    here you find an example with a similar error. You simply can validate the spatial data, to find invalid records:
    DROP   TABLE sdo_test;
    CREATE TABLE sdo_test (
      nr      NUMBER,
      GEOM     MDSYS.SDO_GEOMETRY);
    COMMIT;
    --correct
    INSERT INTO sdo_test VALUES (1,
      SDO_GEOMETRY(3302, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1),
        SDO_ORDINATE_ARRAY(-87.899771, 42.000853, 0, -87.899109, 42.000847, 54.8504622)));
    --correct
    INSERT INTO sdo_test VALUES (2,
      SDO_GEOMETRY(3302, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1),
        SDO_ORDINATE_ARRAY(-87.917489, 41.992077, 0, -87.917063, 41.99174, 51.4503307)));
    --empty SDO_ELEM_INFO_ARRAY
    INSERT INTO sdo_test VALUES (3,
      SDO_GEOMETRY(3302, 8307, NULL,  SDO_ELEM_INFO_ARRAY(),
        SDO_ORDINATE_ARRAY(-87.925704, 41.965994, 0, -87.925705, 41.965445, 60.9789892)));
    DELETE FROM USER_SDO_GEOM_METADATA
      WHERE TABLE_NAME = 'SDO_TEST' AND COLUMN_NAME = 'GEOM' ;
    INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)
      VALUES ('SDO_TEST', 'GEOM',
        MDSYS.SDO_DIM_ARRAY
          (MDSYS.SDO_DIM_ELEMENT('X', -87.925705, -87.8991090, 0.001),
           MDSYS.SDO_DIM_ELEMENT('Y',  41.965445,  41.9654450, 0.001),
           MDSYS.SDO_DIM_ELEMENT('M',    0.00000,  60.9789892, 0.001)
         ),8307);
    --DROP   INDEX sdo_test_geom_spix;
    --ORA ERROR 13033
    CREATE INDEX sdo_test_geom_spix
              ON sdo_test(geom)
       INDEXTYPE IS MDSYS.SPATIAL_INDEX
    PARAMETERS('sdo_indx_dims=2');
    --find the invalid record
    SELECT nr, SDO_GEOM.VALIDATE_GEOMETRY(geom,0.001) val
      FROM sdo_test;
    nr     val
    1    TRUE
    2    TRUE
    3    13033
    oops - where is the PREVIEW button in the new design ?!
    In the meantime found the Syntax Highlighting (->Switch to the advanced editor, paste your code, mark it, click the >> (insert) button, select Syntax Highlighting, choose the style...>

  • How to optimize massive insert on a table with spatial index ?

    Hello,
    I need to implement a load process for saving up to 20 000 points per minutes in Oracle 10G R2.
    These points represents car locations tracked by GPS and I need to store at least all position from the past 12 hours.
    My problem is that the spatial index is very costly during insert (For the moment I do only insertion).
    My several tries for the insertion by :
    - Java and PreparedStatement.executeBatch
    - Java and generation a SQLLoader file
    - Java and insertion on view with a trigger "instead of"
    give me the same results... (not so good)
    For the moment, I work on : DROP INDEX, INSERT, CREATE INDEX phases.
    But is there a way to only DISABLE INDEX and REBUILD INDEX only for inserted rows ?
    I used the APPEND option for insertion :
    INSERT /*+ APPEND */ INTO MY_TABLE (ID, LOCATION) VALUES (?, MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYPE(?, ?, NULL), NULL, NULL))
    My spatial index is created with the following options :
    'sdo_indx_dims=2,layer_gtype=point'
    Is there a way to optimize these heavy load ???
    What about the PARALLEL option and how does it work ? (Not so clear for me regarding the documentation... I am not a DBA)
    Thanks in advanced

    It is possible to insert + commit 20000 points in 16 seconds.
    select * from v$version;
    BANNER                                                                         
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod               
    PL/SQL Release 10.2.0.1.0 - Production                                         
    CORE     10.2.0.1.0     Production                                                     
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production                        
    NLSRTL Version 10.2.0.1.0 - Production                                         
    drop table testpoints;
    create table testpoints
    ( point mdsys.sdo_geometry);
    delete user_sdo_geom_metadata
    where table_name = 'TESTPOINTS'
    and   column_name = 'POINT';
    insert into user_sdo_geom_metadata values
    ('TESTPOINTS'
    ,'POINT'
    ,sdo_dim_array(sdo_dim_element('X',0,1000,0.01),sdo_dim_element('Y',0,1000,0.01))
    ,null)
    create index testpoints_i on testpoints (point)
    indextype is mdsys.spatial_index parameters ('sdo_indx_dims=2,layer_gtype=point');
    insert /*+ append */ into testpoints
    select (sdo_geometry(2001,null,sdo_point_type(1+ rownum / 20, 1 + rownum / 50, null),null,null))
    from all_objects where rownum < 20001;
    Duration: 00:00:10.68 seconds
    commit;
    Duration: 00:00:04.96 seconds
    select count(*) from testpoints;
      COUNT(*)                                                                     
         20000                                                                      The insert of 20 000 rows takes 11 seconds, the commit takes 5 seconds.
    In this example there is no data traffic between the Oracle database and a client but you have 60 -16 = 44 seconds to upload your points into a temporary table. After uploading in a temporary table you can do:
    insert /*+ append */ into testpoints
    select (sdo_geometry(2001,null,sdo_point_type(x,y, null),null,null))
    from temp_table;
    commit;Your insert ..... values is slow, do some bulk processing.
    I think it can be done, my XP computer that runs my database isn't state of the art.

  • Spatial index - mapviewer demo

    Hi,
    I tried the mapclient.jsp demo of the maviewer demo and it only returns a blue image. I check the log file and found this:
    [oracle.sdovis.JDBCDataSource4PT, Thu May 18 10:21:36 CST 2006, ERROR] *** SQL Exception while querying theme: THEME_DEMO_COUNTIES
    [oracle.sdovis.JDBCDataSource4PT, Thu May 18 10:21:36 CST 2006, ERROR] java.sql.SQLException: ORA-13226: interface not supported without a spatial index
    seems like a spatial index is missing. My question is,
    - is the spatial index created when I imported the mvdemo.dmp file?
    - is this the same index that is stated in the oracle_home\mapviewer\lbs\admin\mapdefinition.sql?
    - or, is this index should be included in the database installation?
    - who should be creating this index?
    - if I create this index, how would I do this?
    I really need your assistance. I'll be presenting this demo to my boss two days from now, my team is pushing the idea of migrating our existing gis system to Oracle Spatial. We need this demo badly.
    Thanks for the support?

    First, which MapViewer version are you using and which database version?
    Second, the indexes are usually built on import. You can check if they exist and if not create them.
    To check if the indexes exist
    select * from user_sdo_index_info
    An sample index creation statement is:
    create index counties_sides on counties(geometry) indextype is mdsys.spatial_index;
    If the index exists and is invalid then drop it and recreate it. Drop it using
    drop index counties_sidx force ;

  • Problems building a spatial index - this must be a bug please help!

    Hi,
    We have a rather large spatial data warehouse. The schema is a star schema and is partitioned. During a load recently we had an error with one particular dataset, when building the index we got:
    ERROR at line 1:
    ORA-29855: error occured in the execution of ODCIINDEXCREATE routine
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 10
    We have seen this kind of thing before, but usually dropping the data and reloading works fine (or rebuild the index). I should not that this obviously occurs before the partition is exchanged in. We are running 10.2.0.2 on red hat ES3.
    With this error we tried to reload the data, but get the same. We tried the data on another copy of the system, and the same. We have tried the data on a 10.2.0.3 and an 11.1.0.6 database and all fail at the same location. We have validated the geometries - all fine, I have tried changing the DIMINFO so that it spans the whole globe, it failes again (by the way we are on SRID 8307 and all data is point type). The data is approx 1.2M rows and I have tried subdividing it up into smaller tables and these all build fine. I have partitions with much higher row counts and these are fine. I have tried everything possible including changing index parameters e.g. parallel tablespace etc. I have tried it on a tablespace without ASSM and one with and both fail. I have an export of the data if anyone would be available to try it?
    I would really appreciate any help at all on this one.
    Thanks
    Jonathan

    There was a post a few months ago that addressed issues with 10.2.0.3 and Spatial index creation: Re: Fixed ...
    -Justin

  • Performance problem at bulk insert with spatial index

    Hi,
    I have a table with SDO_GEOMETRY.
    Insert without spatial index is very fast, but with active spatial index it's very slow.
    So for the first big import of data, I can drop the index, import the data and again create the index. Thats 10 times faster!
    But for an already very big table that is no option.
    The 10g1-Users Guide (1) says at 4.1.3 that the spatial index should be set to 'deferred', the data should be inserted and than the index should be synchronized again. That sounds very good, but I can't find this at the 11g1-Users Guide.
    I tried it (11g1), but the performance is even worse than with active index!
    What could be my mistake? Any hints?
    Thank you,
    Bjoern Weitzig
    create table sggeoptcollection (pt SDO_GEOMETRY);
    CREATE INDEX myIdx ON sggeoptcollection (pt) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS('sdo_indx_dims=2, layer_gtype=point, sdo_rtr_pctfree=50');
    ALTER INDEX myIdx PARAMETERS ('index_status=deferred');
    Big import with batch'ed PreparedStatements
    ALTER INDEX myIdx PARAMETERS ('index_status=synchronize sdo_batch_size=500');
    1) http://download.oracle.com/docs/html/B10826_01/sdo_index_query.htm#g1010227

    Hi,
    I have a table with SDO_GEOMETRY.
    Insert without spatial index is very fast, but with active spatial index it's very slow.
    So for the first big import of data, I can drop the index, import the data and again create the index. Thats 10 times faster!
    But for an already very big table that is no option.
    The 10g1-Users Guide (1) says at 4.1.3 that the spatial index should be set to 'deferred', the data should be inserted and than the index should be synchronized again. That sounds very good, but I can't find this at the 11g1-Users Guide.
    I tried it (11g1), but the performance is even worse than with active index!
    What could be my mistake? Any hints?
    Thank you,
    Bjoern Weitzig
    create table sggeoptcollection (pt SDO_GEOMETRY);
    CREATE INDEX myIdx ON sggeoptcollection (pt) INDEXTYPE IS MDSYS.SPATIAL_INDEX PARAMETERS('sdo_indx_dims=2, layer_gtype=point, sdo_rtr_pctfree=50');
    ALTER INDEX myIdx PARAMETERS ('index_status=deferred');
    Big import with batch'ed PreparedStatements
    ALTER INDEX myIdx PARAMETERS ('index_status=synchronize sdo_batch_size=500');
    1) http://download.oracle.com/docs/html/B10826_01/sdo_index_query.htm#g1010227

  • Performance issue when inserting into spatial indexed table with JDBC

    We have a table named 'feature' which has a "sdo_geometry" column, and we created spatial index on that column,
    CREATE TABLE feature ( id number, desc varchar, oshape sdo_gemotry)
    CREATE INDEX feature_sp_idx ON feature(oshape) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    Then we executed the following SQL to insert about 800 records into that table(We tried this by using DB visualizer and
    our Java application, both of them were using JDBC driver to connect to the oracle 11gR2 database) .
    insert into feature(id,desc,oshape) values (1001,xxx,xxxxx);
    insert into feature (id,desc,oshape) values (1002,xxx,xxxxx);
    insert into feature (id,desc,oshape) values (1800,xxx,xxxxx);
    We encoutered the same problem as this topic
    Performance of insert with spatial index
    It takes nearly 1 secs for inserting one record,compare to 50 records inserted per sec without spatial index,
    which is 50x drop in peformance when doing insertion with spatial index.
    However, when we copy and paste those insertion scripts into Oracle Client(same test and same table with spatial index), we got a totally different performance result:
    more than 50 records inserted in 1 secs, just as fast as the insertion without building spatial index.
    Is it because Oracle Client is not using JDBC? Perhaps JDBC was got something wrong when updating those spatial indexed tables.
    Edited by: 860605 on 19/09/2011 18:57
    Edited by: 860605 on 19/09/2011 18:58
    Edited by: 860605 on 19/09/2011 19:00

    Normally JDBC use auto-commit. So each insert can causes a commit.
    I don't know about Oracle Client. In sqlplus, insert is just a insert,
    and you execute "commit" to explicitly commit your changes.
    So maybe this is the reason.

  • Oracle materialized view + spatial index

    Hello,
    i faced with problem when i create spatial index on materialized view.
    I create materialized view on 2 table which contains spatial geometrys.
    create materialized view mv_geom as
    select g.nid, g.geometry
    from geom1
    union all
    select select g.nid, g.geometry
    from geom2
    i created spatial index - all works fine, but when i try to drop table, i get exception "ORA-04020"...
    Materialized view become invalid but don't drop from database.
    SQL> drop materialized view mv_geom;
    Materialized view dropped
    But object does not drop
    select * from all_objects z where z.OBJECT_NAME = 'geom1'
    and z.OBJECT_TYPE ='MATERIALIZED VIEW'
    Any ideas?
    Thank's for help!

    I don't quite follow you. Do you mean that after you dropped mv "mv_geom".
    you expect that the base table "geom1" should be dropped?

  • Spatial Query not using Spatial Index

    Hi All,
    I have a query which uses the SDO_WITHIN_DISTANCE operator, but is taking far too long to complete.
    SELECT
                   RT.*,RD.RPD_NODE_ID, RD.RPD_XCOORD,RD.RPD_YCOORD
              FROM
                   railplan_data RD
                   LEFT JOIN Walk_data_sets WDS ON RD.RPD_RPS_ID = WDS.WDS_RPS_ID
                   LEFT JOIN RWNet_Temp RT ON WDS.WDS_ID = RT.RW_WDS_ID
              WHERE
                   WDS.wds_id = 441
              AND
                   MDSYS.SDO_WITHIN_DISTANCE(RT.RW_GEOM,RD.RPD_GEOLOC,'DISTANCE=' || TO_CHAR(RT.RW_BUFFER) || ' UNIT=METER') = 'TRUE';
    Upon generation of the explain plan I have realised that the spatial index is not being used in the query, but I can't for the life of me get the thing working
    3     | Id | Operation | Name | Rows | Bytes |TempSpc| Cost |
    4     ------------------------------------------------------------------------------------------
    5     | 0 | SELECT STATEMENT | | 25841 | 99M| | 201 |
    6     |* 1 | FILTER | | | | | |
    7     | 2 | MERGE JOIN OUTER | | | | | |
    8     |* 3 | HASH JOIN | | 12652 | 420K| 2968K| 185 |
    9     | 4 | TABLE ACCESS FULL | RAILPLAN_DATA | 75910 | 2075K| | 60 |
    10     | 5 | TABLE ACCESS BY INDEX ROWID| WALK_DATA_SETS | 1 | 6 | | 1 |
    11     |* 6 | INDEX UNIQUE SCAN | WDS_PK | 1 | | | |
    12     |* 7 | SORT JOIN | | 16 | 63760 | | 16 |
    13     |* 8 | TABLE ACCESS FULL | RWNET_TEMP | 16 | 63760 | | 4 |
    If anyone could help me out in figuring out why the spatial index is not being used, I would be most appreciative.
    TIA
    Dan

    Hi all again,
    Well I finally got an upgrade to Oracle 10 (yay!), so I am now trying to implement the SDO_JOIN method as per my earlier posts. In fact it is actually working, but I have a question. When I run an explain plan it does not show the use of any domain indexes which I would expect to see, but performs fine (1.07s) with just a few records (10 in 1 table, 15000 in the other), please see code and explain plan below:
    SELECT
      Distinct
        RT.RW_ID, RD.RPD_NODE_ID,
        RD.RPD_XCOORD,RD.RPD_YCOORD
    FROM
        RPD_TEMP_762 RD,
        WALK_DATA_SETS WDS,
        RWNET_TEMP RT,
        TABLE
        (SDO_JOIN
            (  'RWNET_TEMP',
                'RW_GEOM',
                'RPD_TEMP_762',
                'RPD_GEOLOC',
                'distance= ' || TO_CHAR(RT.RW_BUFFER) || ' unit=meter')) SPATIAL_JOIN_RESULT
    WHERE WDS.WDS_ID = RT.RW_WDS_ID
    AND WDS.WDS_ID = 762
    AND SPATIAL_JOIN_RESULT.ROWID1 = RT.ROWID
    AND SPATIAL_JOIN_RESULT.ROWID2 = RD.ROWID
    PLAN_TABLE_OUTPUT                                                                                                                                                                                                                                                                                           
    | Id  | Operation                            | Name         | Rows  | Bytes | Cost (%CPU)|                                                                                                                                                                                                                  
    |   0 | SELECT STATEMENT                     |              |    74 |  5994 | 21753   (1)|                                                                                                                                                                                                                  
    |   1 |  SORT UNIQUE                         |              |    74 |  5994 | 21691   (1)|                                                                                                                                                                                                                  
    |*  2 |   HASH JOIN                          |              |  1046K|    80M|  1859   (1)|                                                                                                                                                                                                                  
    |   3 |    NESTED LOOPS                      |              |  6076 |   213K|  1824   (1)|                                                                                                                                                                                                                  
    |   4 |     NESTED LOOPS                     |              |    74 |  2516 |   194   (1)|                                                                                                                                                                                                                  
    |*  5 |      INDEX UNIQUE SCAN               | WDS_PK       |     1 |     4 |     0   (0)|                                                                                                                                                                                                                  
    |*  6 |      TABLE ACCESS FULL               | RWNET_TEMP   |    74 |  2220 |   194   (1)|                                                                                                                                                                                                                  
    |*  7 |     COLLECTION ITERATOR PICKLER FETCH| SDO_JOIN     |       |       |            |                                                                                                                                                                                                                  
    |   8 |    TABLE ACCESS FULL                 | RPD_TEMP_762 | 17221 |   756K|    28   (0)|                                                                                                                                                                                                                  
    ------------------------------------------------------------------------------------------  When i try to add hints to force the use of spatial indexes the performance of this query drops through the floor (it takes minutes / hours), index hint shown below:
    /*+ ORDERED INDEX(RW rw_geom) INDEX(RD rpd_geoloc) */My question is is the first query using domain indexes, and if not, how do I get it to?
    TIA
    Dan

  • Performance of insert with spatial index

    I'm writing a test that inserts (using OCI) 10,000 2D point geometries (gtype=2001) into a table with a single SDO_GEOMETRY column. I wrote the code doing the insert before setting up the index on the spatial column, thus I was aware of the insert speed (almost instantaneous) without a spatial index (with layer_gtype=POINT), and noticed immediately the performance drop with the index (> 10 seconds).
    Here's the raw timing data of 3 runs in each 3 configuration (the clock ticks every 14 or 15 or 16 ms, thus the zero when it completes before the next tick):
                                       truncate execute commit
    no spatial index                     0.016   0.171   0.016
    no spatial index                     0.031   0.172   0.000
    no spatial index                     0.031   0.204   0.000
    index (1000 default for batch size)  0.141  10.937   1.547
    index (1000 default for batch size)  0.094  11.125   1.531
    index (1000 default for batch size)  0.094  10.937   1.610
    index SDO_DML_BATCH_SIZE=10000       0.203  11.234   0.359
    index SDO_DML_BATCH_SIZE=10000       0.094  10.828   0.344
    index SDO_DML_BATCH_SIZE=10000       0.078  10.844   0.359As you can see, I played with SDO_DML_BATCH_SIZE to change the default of 1,000 to 10,000, which does improve the commit speed a bit from 1.5s to 0.35s (pretty good when you only look at these numbers...), but the shocking part of the almost 11s the inserts are now taking, compared to 0.2s without an index: that's a 50x drop in peformance!!!
    I've looked at my table in SQL Developer, and it has no triggers associated, although there has to be something to mark the index as dirty so that it updates itself on commit.
    So where is coming the huge overhead during the insert???
    (by insert I mean the time OCIStmtExecute takes to run the array-bind of 10,000 points. It's exactly the same code with or without an index).
    Can anyone explain the 50x insert performance drop?
    Any suggestion on how to improve the performance of this scenario?
    To provide another data point, creating the index itself on a populated table (with the same 10,000 points) takes less than 1 second, which is consistent with the commit speeds I'm seeing, and thus puzzles me all the more regarding this 10s insert overhead...
    SQL> set timing on
    SQL> select count(*) from within_point_distance_tab;
      COUNT(*)
         10000
    Elapsed: 00:00:00.01
    SQL> CREATE INDEX with6CDF1526$point$idx
      2            ON within_point_distance_tab(point)
      3    INDEXTYPE IS MDSYS.SPATIAL_INDEX
      4    PARAMETERS ('layer_gtype=POINT');
    Index created.
    Elapsed: 00:00:00.96
    SQL> drop index WITH6CDF1526$POINT$IDX force;
    Index dropped.
    Elapsed: 00:00:00.57
    SQL> CREATE INDEX with6CDF1526$point$idx
      2            ON within_point_distance_tab(point)
      3    INDEXTYPE IS MDSYS.SPATIAL_INDEX
      4    PARAMETERS ('layer_gtype=POINT SDO_DML_BATCH_SIZE=10000');
    Index created.
    Elapsed: 00:00:00.98
    SQL>

    Thanks for your input. We are likely to use partioning down the line, but what you are describing (partition exchange) is currently beyond my abilities in plain SQL, and how this could be accomplished from an OCI client application without affecting other users and keep the transaction boundaries sounds far from trivial. (i.e. can it made transparent to the client application, and does it require privileges the client does have???). I'll have to investigate this further though, and this technique sounds like one accessible to a DBA only, not from a plain client app with non-privileged credentials.
    The thing that I fail to understand though, despite your explanation, is why the slow down is not entirely on the commit. After all, documentation for the SDO_DML_BATCH_SIZE parameter of the Spatial index implies that the index is updated on commit only, where new rows are fed 1,000 or 10,000 at a time to the indexing engine, and I do see time being spent during commit, but it's the geometry insert that slow down the most, and that to me looks quite strange.
    It's so much slower that it's as if each geometry was indexed one at a time, when I'm doing a single insert with an array bind (i.e. equivalent to a bulk operation in PL/SQL), and if so much time is spend during the insert, then why is any time spent during the commit. In my opinion it's one or the other, but not both. What am I missing? --DD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Is it possible to create a spatial index on a view?

    Hi
    Is it possible to create a spatial index on a view?
    We would like to link our spatial tables to each other (using only one of the SDO_GEOMETRY fields) in a view & make it very easy so that anybody can work with the data.
    Thanks Caroline.

    Simon,
    In order for autoregistration to work, you first need to make sure that all entries in mdsys.sdo_geom_metadata_table are registered with SDE. All tables not just one schema. None of our spatial tables or views exist in the SDE schema.
    Also make sure all Oracle Spatial tables in sde.table_registry are held in mdsys.sdo_geom_metadata_table.
    When a user makes a database connection in ArcCatalog, all Oracle Spatial tables will be registered with SDE automatically. Also, entries will be inserted into mdsys.sdo_geom_metadata_table and indexes will be created. If you do not have primary key fields, you will have to Register with Geodatabase and it will create the OBJECTID field.
    This did not work for us originally. but after cleaning up metadata and installing SP1, it is working now and it is very convenient.
    VIEWS:
    You have to create the view thru SDE. You cannot register foreign views. There are bugs in support of views containing SDO_GEOMETRY objects. I have been told some problems will be fixed in SP2 and there may be a patch out to address some others.
    Here are the incidents I have filed in reference to views:
    1.
    I created a view consisting of a geometry column from a "foreign" Oracle
    Spatial table (SDO_GEOMETRY) and corresponding attribution in another table.
    I used the following command to create the view through SDE:
    C:\arcgis\arcexe81\BIN>sdetable -o create_view -T gis_v_traffic -t
    "trims_traffi c_geom,traffic" -c
    "trims_traffic_geom.geometry,trims_traffic_geom.fid,traffic.i
    d_number,traffic.aadt" -w "trims_traffic_geom.mslink = traffic.mslink" -u
    gis -p spatial -i esri_sde -s JJ0DN10
    ArcSDE 8.1 Build 832 Thu Mar 22 14:08:07 PST 2001 Attribute Administration
    Utility ----------------------------------------------------- Successfully
    created view gis_v_traffic.
    I can preview the geometries in ArcCatalog without error.
    However, when I try to select a feature in ArcMap I get the following error:
    The instruction at "0x125222dd" referenced memory at "0x00000000". The
    memory could not be "read".
    I click ok.
    Then I get this error:
    The insruction at "0x5f8012d3" referenced memory at "0x00000004". the memory
    could not be "read".
    I click ok and ArcMap terminates.
    I can select features from the spatial table the view is pointing to, but
    not from the view itself.
    2.
    I need to create views utilizing database links to tie attribution in other
    databases to geometries created for that data in a spatial database.
    I issued the following command from command prompt and got this error:
    C:\arcgis\arcexe81\BIN>sdetable -o create_view -T link_v_traffic -t
    "trims_traff ic_geom,[email protected]" -c
    "trims_traffic_geom.geometry,trims_traffic_ge
    om.fid,[email protected],[email protected]" -w
    "trims_t raffic_geom.mslink = [email protected]" -u gis -p
    spatial -i esri_sd e -s JJ0DN10
    ArcSDE 8.1 Build 832 Thu Mar 22 14:08:07 PST 2001 Attribute Administration
    Utility ----------------------------------------------------- Error:
    Underlying DBMS error (-51). Error: Unable to create view link_v_traffic
    ORA-00957: duplicate column name (link_v_traffic)
    3.
    Spatial Views created on Oracle Spatial LRS layers containing SDO_GEOMETRY
    objects are not recognized as feature classes unless they are created with
    the sdetable -o create_view command.
    Here is typical SQL for the view creation:
    create or replace view trims_v_traffic as select a.geometry,
    b.nbr_tenn_cnty, b.nbr_rte, b.spcl_cse, b.cnty_seq, b.tr_beg_log_mle,
    b.tr_end_log_mle, b.yr_trfc, b.aadt, b.pct_peak_hr, b.dhv_pct, b.drct_distr,
    b.vhcl_pass_pickups, b.vhcl_su_trk, b.vhcl_mu_trk, b.actl_cnt, b.updt_by,
    b.updt_on, b.mslink, b.mapid, b.id_number, b.sta_nbr from
    gis.trims_traffic_geom a, gis.traffic b where a.mslink = b.mslink;
    The table containing the SDO_GEOMETRY object is registered with SDE in the
    following manner:
    C:\arcgis\arcexe81\BIN>sdelayer -o register -l trims_traffic_geom,geometry
    -e slM -k SDO_GEOME
    TRY -s JJ0DN10 -i esri_sde -u gis -p spatial -c fid -C SDE
    A feature class is successfully created for this layer and the data can be
    added successfully to a map.
    However, there is no way of adding data to a map from a spatial database
    view containing an SDO_GEOMETRY object which was created externally from
    SDE.
    We are using Oracle Spatial 8.1.7 on NT 4.0. We are also using ArcGIS 8.1
    and ArcSDE 8.1.1.
    4.
    SDE does not support spatial database views which reference snapshot
    objects.
    I was unable to create a view using sdetable -o create_view which referenced
    a snapshot object.
    The snapshot was created using the following sql syntax:
    CREATE SNAPSHOT SNP_TEST
    BUILD IMMEDIATE
    REFRESH FAST
    ON DEMAND
    AS
    SELECT * FROM [email protected]
    We are using ArcSDE 8.1.1 with Oracle 8.1.7 on NT 4.0.
    Here are the permissions I granted, they need to be the same for every schema:
    for sde (these are all the permissions that might be needed for any type of
    activity - new install or upgrade)..lets just step through and go ahead and
    grant them all...
    grant create session to sde;
    grant create table to sde;
    grant create procedure to sde;
    grant create sequence to sde;
    grant create trigger to sde;
    grant unlimited tablespace to sde;
    grant select any table to sde;
    grant create any sequence to sde;
    grant create any procedure to sde;
    grant execute any procedure to sde;
    grant drop any procedure to sde;
    grant select any sequence to sde;
    grant create any view to sde;
    grant drop any view to sde;
    grant create any trigger to sde;
    grant drop any sequence to sde;
    each Oracle user will also need the following privileges...
    grant create session to gis;
    grant create table to gis;
    grant create procedure to gis;
    grant create sequence to gis;
    grant create trigger to gis;
    grant unlimited tablespace to gis;
    Viewer
    The viewer is allowed to connect to an ArcSDE database. Other users grant
    select privileges on their tables and feature classes to the viewer or to
    the public role. The DBA can create a role that can be granted select
    privileges on data objects owned by other users. The role can be granted to
    the viewer.
    create session
    select on other user's data objects
    Editor
    The editor is allowed to connect to an ArcSDE database. Other users grant
    select and insert, update, or delete on data objects they own to editor. The
    DBA may create a role that can be granted select, insert, update, and delete
    privileges on data objects owned by other users. The role can be granted to
    the editor.
    create session
    select, insert, update, or delete on other user's data objects
    Creator
    The creator is allowed to connect to an ArcSDE database and create data
    objects. The creator may grant privileges on their
    objects to other users or roles. Other users can grant select and insert,
    update, or delete on data objects they own to creator. The DBA may create a
    role that can be granted select, insert, update, and delete privileges on
    data objects
    owned by other users. The role can be granted to the creator:
    create session
    create table
    create procedure
    create sequence
    create trigger
    unlimited tablespace
    select, insert, update, or delete on other user's objects
    It might be worthwhile to rebuild your SDE metadata. I can walk you thru that if you need help.
    Hope this helps.
    Dave
    null

Maybe you are looking for

  • HOW CAN I GET THE TIME IN EXCEL SHEET USING WRITE TO MEASUREMENT INSTRUCTION

    HI, I am using GET TIME IN SECONDS ,and after that i placed SECONDS TO DATE /TIME instruction ,and i had taken a write to measurement file instruction to get the time in excel sheet. Now i am not able to connect write to measurement source to seconds

  • ITunes 7 - "Cannot Update" Message

    I updated to iTunes 7 and everything seems to be okay. However, the message: "The iPod cannot be updated. The required file is in use." repeatedly pops up with the playing of almost every song. It's nothing major but an annoyance. Any quick remedies?

  • How to add two protection mode in oracle data guard

    Hi all, We have a discussion on oracle physical data guard yesterday..... As we all know that data guard has 3 protection mode 1. Maximum Performance 2. Maximum Availability (Default) 3. Maximum Protection Now we were discussing about is it possible

  • Year to date question!

    Hi Experts - I need a report like below: Employee         Aug Sales       YTD Sales Jon                      5000                 60000 Tom                     2000                 70000 I was reading through the forum and I see that I have to use cu

  • Looking for high quality 3rd party TTS voices for OSX

    Looking for suggestions for commercial, high quality, 3rd party TTS voices. In the Windows world I was a happy Ivona user, but Ivona does not support Apple products. The best OSX TTS voices I've found so far are from Infovox ... better than the built