10 Replies Latest reply: Apr 11, 2012 10:48 AM by alwu-Oracle RSS

    SEM_APIS.REMOVE_DUPLICATES

    24743
      Hi

      I executed SEM_APIS.REMOVE_DUPLICATES (model_name => 'xxx') which came up with an index error and deleted the model!!!

      Regards _ Christian
        • 1. Re: SEM_APIS.REMOVE_DUPLICATES
          alwu-Oracle
          Hi Christian,

          Hmmmm. That's not supposed to happen.

          What exactly is the error message you got? Could you cut & paste here the steps you took before reaching the error message.
          It is likely the data is still in the database.

          Thanks,

          Zhe Wu
          • 2. Re: SEM_APIS.REMOVE_DUPLICATES
            24743
            Hi Zhe

            You're right:-\

            I just did "exec SEM_APIS.REMOVE_DUPLICATES (model_name => 'xxx')" and got an error message that I did not save.

            It was on test data only so no disaster - and I have just tried to reproduce but cannot. I'll do some more testing.

            ps: is there a way to recover if it happens again and the data in the application table are OK?

            Thanks - Christian
            • 3. Re: SEM_APIS.REMOVE_DUPLICATES
              alwu-Oracle
              Hi Christian,

              The recovery depends on where the failure happened. For example,
              if the RDFM_ view is there but application table is empty, then we need
              to rebuild the application table and its index(es).

              In any event, the MDSYS.RDF_LINK$ partition (for your model) should always
              contain the triple data. The temporary table (behind the scenes) used to
              hold unique triples is named 'RDFX_' || to_char(model_id, 'FMXXXXXXXXXXXXXXXX')

              If you encounter this problem again, please note down the error message and
              file a service request.

              Thanks,

              Zhe
              • 4. Re: SEM_APIS.REMOVE_DUPLICATES
                24743
                Hi Zhe

                Thanks - Christian
                • 5. Re: SEM_APIS.REMOVE_DUPLICATES
                  damien.claveau
                  Hi,

                  I have had the same error under version 11.2.0.1.

                  It occurs each time you call sem_apis.remove_duplicates on a totally new and empty semantic model.
                  This exception makes the underlying objects of the model unusable. Then one must must drop and recreate the Model :-\

                  To prevent from that crash, you have to test the NOT EMPTY state of the model before any call to sem_apis.remove_duplicates.

                  Here is a script output (11.2.0.1) to reproduce the issue :

                  SQL> CREATE TABLE family_rdf_data (id NUMBER, triple SDO_RDF_TRIPLE_S);
                  Table created.

                  SQL> exec sem_apis.create_rdf_model('family', 'family_rdf_data', 'triple');
                  PL/SQL procedure successfully completed.

                  SQL> GRANT INSERT ON family_rdf_data TO MDSYS;
                  Grant succeeded.

                  SQL> exec sem_apis.remove_duplicates (model_name => 'family');
                  BEGIN sem_apis.remove_duplicates (model_name => 'family'); END;

                  *
                  ERROR at line 1 :
                  ORA-14098: index mismatch for tables in ALTER TABLE EXCHANGE PARTITION
                  ORA-06512: at "MDSYS.SDO_RDF", line 1965
                  ORA-06512: at "MDSYS.RDF_APIS", line 1055
                  ORA-06512: at line 1
                  SQL>
                  • 6. Re: SEM_APIS.REMOVE_DUPLICATES
                    alwu-Oracle
                    Hi Damien,

                    Good news is that in 11.2.0.3 this problem has been fixed.

                    Using the same test case you provided,

                    rdf1@semperf3:dbhome_1/% sqlplus scott/tiger

                    SQL*Plus: Release 11.2.0.3.0 Production on Mon Mar 26 11:21:47 2012

                    Copyright (c) 1982, 2011, Oracle. All rights reserved.


                    Connected to:
                    Oracle Database 11g Enterprise Edition Release *11.2.0.3.0* - 64bit Production
                    With the Partitioning, Automatic Storage Management, OLAP, Data Mining
                    and Real Application Testing options

                    SQL> CREATE TABLE family_rdf_data (id NUMBER, triple SDO_RDF_TRIPLE_S);

                    Table created.

                    SQL> exec sem_apis.create_rdf_model('family', 'family_rdf_data', 'triple');

                    PL/SQL procedure successfully completed.

                    SQL> GRANT INSERT ON family_rdf_data TO MDSYS;

                    Grant succeeded.

                    SQL> exec sem_apis.remove_duplicates (model_name => 'family');

                    PL/SQL procedure successfully completed.

                    SQL>

                    Hope it helps,

                    Zhe Wu

                    Edited by: alwu on Mar 26, 2012 9:05 AM
                    • 7. Re: SEM_APIS.REMOVE_DUPLICATES
                      24743
                      Hi

                      Just a follow-up: my model was not empty!

                      Regards - Christian
                      • 8. Re: SEM_APIS.REMOVE_DUPLICATES
                        alwu-Oracle
                        Hi Christian,

                        I know your model was not empty. If you encounter another problem like this, please let us know.

                        Thanks,

                        Zhe Wu
                        • 9. Re: SEM_APIS.REMOVE_DUPLICATES
                          damien.claveau
                          I confirm it is fixed in 11.2.0.3.
                          Thank you Zhe.
                          • 10. Re: SEM_APIS.REMOVE_DUPLICATES
                            alwu-Oracle
                            Thank you for the confirmation!

                            Zhe Wu