2 Replies Latest reply on Oct 22, 2015 2:17 PM by yenier

    Create an RDF view in Oracle 12c from tables in an Oracle server 11g

    yenier

      Hi!

       

      I have a relational database in Oracle Server 11g, but I need to create RDF view model in Oracle 12c from the tables in that database.

       

      I created a Database link to connect the Oracle Server 11g from the Oracle 12c, using the statement:

       

      CREATE DATABASE LINK myDBLink

        CONNECT TO user_test

        IDENTIFIED BY test123

        USING '(DESCRIPTION=

        (ADDRESS=(PROTOCOL=TCP)(HOST=192.0.56.158)(PORT=1521))

        (CONNECT_DATA=(SID=orcl)))';

       

      The SELECT statement works:

       

      select * from EMP@myDBLink;

       

      I created too a SYNONYM:

       

      CREATE SYNONYM MY_EMP FOR EMP@myDBLink;

       

      The SELECT statement with the synonym works too:

       

      select * from EMP@MY_EMP;

       

      Well, to create the RDF view I am using a function sem_apis.create_rdfview_model. Now, I wrote the statement of two ways:

       

      BEGIN

      sem_apis.create_rdfview_model(

      model_name => 'test_linked',

      tables => SYS.ODCIVarchar2List('MY_EMP','MY_DEPT'),

      prefix => 'http://grdf/',

      options => 'CONFORMANCE=T'

      );

      END;

       

      BEGIN

      sem_apis.create_rdfview_model(

      model_name => 'test_linked',

      tables => SYS.ODCIVarchar2List('EMP@myDBLink','DEPT@myDBLink'),

      prefix => 'http://grdf/',

      options => 'CONFORMANCE=T'

      );

      END;

       

      And I get the following error:

       

      ORA-13199: fetchTabIDList: No tables found:

      ORA-06512: at "MDSYS.SDO_RDF_INTERNAL", line 14308

      ORA-06512: at "MDSYS.SDO_RDF", line 3616

      ORA-06512: at "MDSYS.RDF_APIS", line 1253

      ORA-06512: at line 2


      I am using the examples tables from the Oracle's book.


      Thanks,


      Yenier

        • 1. Re: Create an RDF view in Oracle 12c from tables in an Oracle server 11g
          Sdas-Oracle

          Yenier,

           

          Could you please try by creating a view instead of a synonym? Here is an example:

           

          SQL> -- create dblink

          SQL> create public database link

            2    mylink

            3  connect to

            4    scott

            5  identified by

            6    tiger

            7  using '<host>:<port>/<sid>';

           

          Database link created.

           

          SQL>

          SQL> -- create local view using query involving remote database objects

          SQL> create view dblink_scott_EMP as select * from EMP@mylink;

           

          View created.

           

          SQL>

          SQL> -- add primary key (helps queries against Direct Mapping based RDFView models to have shorter SubjectMaps)

          SQL> alter view dblink_scott_EMP add constraint pk_EMPNO primary key(EMPNO) disable;

           

          View altered.

           

          SQL>

          SQL> -- create DM-based RDFview model

          SQL> exec sem_apis.create_rdfview_model('dblink_test_rv', sys.odcivarchar2list('DBLINK_SCOTT_EMP'), 'http://dm/');

           

          PL/SQL procedure successfully completed.

           

          SQL>

           

          Thanks,

          - Souri.

          1 person found this helpful
          • 2. Re: Create an RDF view in Oracle 12c from tables in an Oracle server 11g
            yenier

            Hi Souri:

             

            Thank you very much!

             

            Very helpful your answer!!

             

            Your answer really confirms my suspicion about the solution.


            Thanks again,


            Yenier