<docbook><section><title>VirtOracleLinkingObjects</title><para> </para>
<title> Linking Oracle Database Objects into Virtuoso</title> Linking Oracle Database Objects into Virtuoso
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Prerequisites</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><emphasis>Virtuoso Universal Server, Commercial Edition</emphasis> Virtuoso Universal Server Release 6.x or later is recommended, optimally the latest version available. </listitem>
<listitem><emphasis>ODBC Driver for Oracle</emphasis> The Virtuoso Server uses an ODBC Driver for Oracle to link in the Oracle Schema Objects.
 The <emphasis>OpenLink Multi-Tier ODBC Driver for Oracle</emphasis> will be used in this document, and a functional ODBC Data Source Name (DSN) of <emphasis>ora10ma-hr</emphasis> will be assumed to exist on the machine hosting the Virtuoso Server.
 Any ODBC compliant driver for Oracle should work. </listitem>
<listitem><emphasis>Oracle DBMS</emphasis> An Oracle DBMS hosting the required Schema Objects needs to be available.
 This may be on any host which is TCP/IP accessible from the Virtuoso Server host.
 In this document, the Oracle <emphasis>Human Resources</emphasis> database will be used to demonstrate the process.</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Steps</bridgehead>
<orderedlist spacing="compact"><listitem>Load the HTTP-based Virtuoso User Interface in your browser.
<ulink url="VirtOracleLinkingObjects/VirtWebHome.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtWebHome.png" /></figure></ulink> </listitem>
<listitem>Click the <emphasis>Conductor</emphasis> link in the left-side navbar, and log in as a user with DBA privileges, such as the default <emphasis>dba</emphasis> user.
<ulink url="VirtOracleLinkingObjects/VirtConductor.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtConductor.png" /></figure></ulink> </listitem>
<listitem>Drill down to the <emphasis>Databases</emphasis> -&gt; <emphasis>External Data Source</emphasis> -&gt; <emphasis>Data Sources</emphasis> tab.
<ulink url="VirtOracleLinkingObjects/VirtLinkOra01.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra01.png" /></figure></ulink> </listitem>
<listitem>Locate the DSN for the desired remote data source (we&#39;re using <emphasis>ora10ma-hr</emphasis> for this example).
 If not yet connected to the DSN, click <emphasis>Connect</emphasis>, and input your user credentials for the remote data source.
<ulink url="VirtOracleLinkingObjects/VirtLinkOra02.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra02.png" /></figure></ulink> </listitem>
<listitem>Once connected to the DSN, click the associated <emphasis>Link objects</emphasis> to get a list of available objects (tables, views, stored procedures).
<ulink url="VirtOracleLinkingObjects/VirtLinkOra03.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra03.png" /></figure></ulink> </listitem>
<listitem>Locate and select the desired objects.
<ulink url="VirtOracleLinkingObjects/VirtLinkOra04.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra04.png" /></figure></ulink> <itemizedlist mark="bullet" spacing="compact"><listitem>You can use the Catalog and Schema drop-down selectors and the table name test-entry box to construct a filter to shorten the visible list.
</listitem>
<listitem>For this example, we&#39;ll choose the main tables from Oracle&#39;s sample <emphasis>HR</emphasis> schema -- <emphasis>HR.COUNTRIES, HR.DEPARTMENTS, HR.EMPLOYEES, HR.JOBS, HR.JOB_HISTORY, HR.LOCATIONS, and HR.REGIONS</emphasis>.
</listitem>
<listitem>When all desired objects are selected, click the <emphasis>Link...</emphasis> button.
</listitem>
</itemizedlist></listitem>
<listitem>Virtuoso will interrogate the remote data source to learn about primary keys, and present you with a default linkage setup.
<ulink url="VirtOracleLinkingObjects/VirtLinkOra05.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra05.png" /></figure></ulink> </listitem>
<listitem>You can adjust the Virtuoso catalog, schema/owner, and object identifiers to suit your goals.
 The <emphasis>Set To All</emphasis> button can be used to speed the process.
 In this example, we&#39;ll put all linked objects into the <emphasis>Oracle</emphasis> catalog, and the <emphasis>HR</emphasis> schema.
 We&#39;ll leave the object identifiers unchanged.
<ulink url="VirtOracleLinkingObjects/VirtLinkOra06.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra06.png" /></figure></ulink> <itemizedlist mark="bullet" spacing="compact"><listitem>Sometimes a primary key is not reported properly, or you want to use a different key, either simple or compound.
 Click <emphasis>Edit</emphasis> next to the primary key you want to change, and select the columns that Virtuoso should use for the purpose -- <ulink url="VirtOracleLinkingObjects/VirtLinkOra07.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra07.png" /></figure></ulink> </listitem>
</itemizedlist></listitem>
<listitem>When all are set as desired, click the <emphasis>Link</emphasis> button to link the objects into Virtuoso.
 <emphasis>Virtuoso may take some time to complete this step,</emphasis> depending on network infrastructure, DBMS load, etc.
</listitem>
<listitem>The Link process will complete by listing the linked objects in the <emphasis>Databases</emphasis> -&gt; <emphasis>External Data Source</emphasis> -&gt; <emphasis>External Linked Objects</emphasis> tab.
<ulink url="VirtOracleLinkingObjects/VirtLinkOra08.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra08.png" /></figure></ulink></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Confirmation and Testing</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Working with External Linked Objects</bridgehead>
<orderedlist spacing="compact"><listitem>Linked object are shown in the <emphasis>Databases</emphasis> -&gt; <emphasis>External Data Source</emphasis> -&gt; <emphasis>External Linked Objects</emphasis> tab.
<ulink url="VirtOracleLinkingObjects/VirtLinkOra08.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra08.png" /></figure></ulink> </listitem>
<listitem>Clicking the hyperlinked <emphasis>Local Name</emphasis> of the <emphasis>External Linked Objects</emphasis> will load the Virtuoso <emphasis>Interactive SQL</emphasis> (iSQL) HTTP interface (in a new browser tab or window) with a default <emphasis>SELECT *<emphasis> SQL query.
For instance, clicking on <emphasis>Oracle.HR.COUNTRIES</emphasis> brings -- <ulink url="VirtOracleLinkingObjects/VirtLinkOra09.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra09.png" /></figure></ulink> </emphasis></emphasis></listitem>
<listitem>Click the <emphasis>Execute</emphasis> button to run the query.
 Virtuoso will retrieve the results from the remote table.
 <emphasis><emphasis>Note:</emphasis> By default, iSQL will &quot;<emphasis>Show no more than 100 rows </emphasis>.&quot;  You can change this value as desired.</emphasis> <ulink url="VirtOracleLinkingObjects/VirtLinkOra10.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra10.png" /></figure></ulink></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Working with SQL Database Objects</bridgehead>
<orderedlist spacing="compact"><listitem>Linked objects are also visible through the <emphasis>Database</emphasis> -&gt; <emphasis>SQL Database Object</emphasis> tab, just as if they were local Virtuoso data.
<ulink url="VirtOracleLinkingObjects/VirtLinkOra11.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra11.png" /></figure></ulink> </listitem>
<listitem>Simply drill down to the Catalog you set while linking -- <ulink url="VirtOracleLinkingObjects/VirtLinkOra12.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra12.png" /></figure></ulink> </listitem>
<listitem>As you might expect, clicking on any of the <emphasis>Action</emphasis> links will reveal the table definition, indexes, triggers, constraints, or privileges.
 For example, clicking <emphasis>Definition</emphasis> for <emphasis>Oracle.HR.EMPLOYEES</emphasis> -- <ulink url="VirtOracleLinkingObjects/VirtLinkOra13.png"><figure><graphic fileref="VirtOracleLinkingObjects/VirtLinkOra13.png" /></figure></ulink></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Related</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VOSSQL2RDF">Mapping SQL Data to Linked Data Views</ulink> </listitem>
<listitem><ulink url="VirtOracleEntityFrameworkUsage">Using Microsoft Entity Frameworks to Access Oracle Schema Objects with Virtuoso</ulink></listitem>
</itemizedlist><para> <ulink url="CategoryDocumentation">CategoryDocumentation</ulink> <ulink url="CategoryVirtuoso">CategoryVirtuoso</ulink> <ulink url="CategoryDotNET">CategoryDotNET</ulink> <ulink url="CategoryEntityFrameworks">CategoryEntityFrameworks</ulink> <ulink url="CategoryWebSite">CategoryWebSite</ulink> </para>
</section></docbook>