Openlink Virtuoso

Hi,

in my “EXTERNAL RESOURCES” I view only “LOCAL VIRTUOSO” , I must configure a connection with ORACLE DB via ODBC ? Where I can download the drivers and what are the configuration steps? If you can, can you share a link, I will appreciate.

Regards.

Yes, you need to have a function Oracle ODBC Driver installed and Configured that can be used to link/attach Oracle resources into Virtuoso as detailed in this Linking Oracle Database Objects into Virtuoso document. As indicated in the document this can be an existing or new third party Oracle ODBC driver or we have OpenLink ODBC Drivers for Oracle, that can be installed and configured on the target OS and used. We also this this document on Virtuoso RDF Linked Data Views for the Oracle Human Resources Sample Database demonstrating how RDF Linked Data Views can be created across Oracle tables, which I presume you would be seeking to do ultimately.

1 Like

Ok,
so I must link Oracle objects to Virtuoso, in file odbc.ini I have specified:

[Test MyTest]
Driver = OpenLink Virtuoso
Address = XXX.XXX:XXX:1521
Service = ZZZ

Is the Driver (OpenLink Virtuoso) correct ? Is possible to set the Service parameter ? How can I debug the connection ?

Thanks.

The OpenLink Virtuoso driver is a Virtuoso specific ODBC driver and can only connect to Virtuoso database, as is the case for and ODBC driver for a given database which needs to be installed, configured and able to connect to the target database, before it can work with Virtuoso.

Have you read any of the documentation links I sent previously, as trying to use the OpenLink Virtuoso driver to connect to Oracle implies lack of ODBC knowledge, which you need to understand.

Basically you first need to:

  1. Install an Oracle ODBC Driver for the target OS Virtuoso is running ie Linux, Windows or macOS

  2. Configure an ODBC DSN for the Oracle Driver to make a successful ODBC connection to the target Oracle database

  3. Once and ODBC connection to Oracle can be made you can then connect Virtuoso to the working ODBC DSN and link/attach resources into Virtuoso as detailed in the documentation links.

1 Like

According to your documentation (Data Access Drivers HowTo Guides) :
I cant find this file for the configuration: openlink.sh and openlink.ini
Configuration of the Lite Edition (Single-Tier) ODBC Driver for Oracle 10g+ Data Sources, for Linux
Prerequisites:
You MUST be proficient in using a Unix shell.
You MUST be proficient in using a Unix editor such as vi.
You MUST be in possession of relevant database connectivity details such as Database name, Username, password, etc.
You MUST have installed and available either a full installation of Oracle, Oracle Client, or Oracle Instant Client (release 6.x only).
Open the file <OPENLINK_INSTALL>/openlink.sh with a suitable text editor such as vi.
Locate the section that deals with the location of shared libraries pertaining to your system (LD_LIBRARY_PATH, LIBPATH, or SHLIB_PATH) and add to it the location of your Informix lib and lib/esql directories:

  LD_LIBRARY_PATH="<OPENLINK_INSTALL>/lib:/oracle/lib:$LD_LIBRARY_PATH"

Open the file <OPENLINK_INSTALL>/openlink.ini with a suitable text editor such as vi.
Locate the [Environment Oracle xxx] section that deals with the driver specific Oracle configuration and edit to reflect your Oracle installation:

          [Environment Oracle 10.x]
          ORACLE_HOME        = /oracle/
          ;ORACLE_SID         = ORCL
          ;ORACLE_SERVER      = T
          ;TWO_TASK           = P:
          ;ODBC_CATALOGS      = Y     ; Uncomment after loading odbccat10.sql
          ;MULTIPLEX_LDA      = 5     ; Allow 5 OpenLink clients on a single lda
          ;OPL_USR_TBLS_FIRST = Y     ; Sort SQLTables starting with user tables
          SHOW_REMARKS        = N     ; Retrieve SQLColumns REMARKS field
          CURSOR_SENSITIVITY  = LOW   ; Set to HIGH after loading odbccat10.sql
          ;OCI_PREFETCH_ROWS  = 100   ; Number of rows to prefetch
          ;OCI_PREFETCH_MEMORY = 65535 ; Amount of memory to use for prefetching
          ;NLS_LANG           = AMERICAN_AMERICA.UTF8 ; Unicode connection

Open the file <OPENLINK_INSTALL>/bin/odbc.ini with a suitable text editor such as vi.
Locate and edit the sample OpenLink Oracle ODBC data source (DSN) created during the installation process and edit as follows:

  [oracle]
  Driver            = <OPENLINK_INSTALL>/lib/ora100_mt_lt.so
  ServerType        = Oracle 10.x
  Options           = <TNSName>
  Username          = <scott>
  Password          = <**********>
  FetchBufferSize   = 99
  ReadOnly          =
  DeferLongFetch    =
  JetFix            = No
  Description       = Sample Oracle 10.x Lite Connection

Use the iodbctest tool which is packaged with the HTTP-based OpenLink ODBC Administrator as follows:
# cd <OPENLINK_INSTALL>
# . ./openLink.sh
# iodbctest oracle

iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.0507.0105
Driver: 06.02.1217 OpenLink Generic ODBC Driver (ora100_mt_lt.so)

SQL>
You should now be able to issue SQL statements directly against the target database.

Additional Information:

The bitness of the ODBC Driver for MySQL is determined by the bitness of your ODBC client application.

That is, if your ODBC client application is 32-bit then the Generic ODBC Driver component MUST also be 32-bit.

Finally I got the ODBC ADMIN working but I have this errors, related to the fact that I dont have an Oracle Client but I want to use Oracle only as External Resource, I need this client ?

    Connect Failed
    SQLConnect failed
    
    Error Message : [iODBC][Driver Manager]Specified driver could not be loaded
    SQL STATE     : IM003
    Native error  : 0         
      
    Error Message : [iODBC][Driver Manager]libclntsh.so.12.1: cannot open shared object file: No such file or directory
    SQL STATE     : 00000
    Native error  : 0         
    ODBC Data Source Names List
    OpenLink ODBC Administrator Main Menu
    The HTTP-based OpenLink ODBC Administrator v1.60 - Copyright © 1993-2019 OpenLink Software

Have you installed the Oracle Instant Client for Oracle 12 and setup the $PATH environment variable as detailed in the OpenLink Oracle Pre-Installation Guide to enable the Oracle Instant Client library libclntsh.so.12.1 required by the OpenLink Oracle 12 ODBC Driver to load ? As that is the most probable cause of the [iODBC][Driver Manager]libclntsh.so.12.1: cannot open shared object file: No such file or directory error` loading the driver.

1 Like

Yes, I solved the problem setting the correct path to the client SO but now I have the last, I hope, problem:

  Connect Failed
  SQLConnect failed
  
  Error Message : [OpenLink][ODBC]License not found
  SQL STATE     : 08004
  Native error  : 0         
  ODBC Data Source Names List
  OpenLink ODBC Administrator Main Menu

Where I must set the ora12_lt.lic ?
# echo $OPL_LICENSE_DIR
/etc/oplmgr:/var/virtuoso82/installoracle/bin

You should place the ora12_lt.lic in the /etc/oplmgr which is the common location we recommend all OpenLink product licenses be placed, and so I assume is where your virtuoso.lic license resides for Virtuoso. Then the OpenLink License Manage (oplmgr) will pick up all license from that location which is where it should be set to check by default. Run ps -ef | grep oplmgr to see how the license manage has been started which should typically be:

$ ps -ef | grep oplmgr
root        2103       1  0 Sep20 ?        00:00:01 /usr/sbin/oplmgr +start +directory /etc/oplmgr +pid /run/oplmgr.pid
$

The oplmgr +directory attribute is normally used to specify where to check for licenses, or the old OPL_LICENSE_DIR environment variable can also be used, but the former is recommended.

1 Like

Ok, solved restarting :slight_smile:

Now I have this error I must specify the service_name but where ? In:

Where I specify the HOSTNAME and PORT for an External DB ORACLE ?

  Connect Failed
  SQLConnect failed
  
  Error Message : [OpenLink][ODBC][Oracle Server]ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
  SQL STATE     : S1000
  Native error  : 12504     
  ODBC Data Source Names List
  OpenLink ODBC Administrator Main Menu

As detailed in the Oracle Instant Client documentation the connect string format for an Oracle database server instance is //host[:port][/service_name], which is what the Database Server setting for the Oracle DSN in the Admin Assistant should be set to, and maps to the Options parameter for the DSN in the odbc.ini file on disk.

So you should just have to add /service_name to the current host:port you have set for the Database Server in the screenshot …

1 Like

Ok, thanks, right now I have this error:

Connect Failed
SQLConnect failed

Error Message : [OpenLink][ODBC][Oracle Server]ORA-12545: Connect failed because target host or object does not exist
SQL STATE     : S1000
Native error  : 12545     

There is some way to debug ?

SOLVED …
The parameters must be set in Database Server

I have copied the working configuration on Virtuoso istance so i copied file odbc.ini, odbcinst.ini and openlink.ini , I must copy some other files ?
Now, in the Virtuoso ISTANCE I have this error:

  VD052: Remote DSN ora120_lite: [iODBC][Driver Manager]Specified driver could not be loaded

Is the PATH to the Oracle Instant client libraries set for Virtuoso to pickup when started by either setting it system wide in the /etc/profile.d file or for the specific user Virtuoso is being run as. Virtuoso will have to be restarted when the setting is in place such that it is aware of the setting and then able to locate the require libs to load the driver.

1 Like

Right now the configuration that is working on the ODBC tool is:

  [ora120_lite]
  Description       = Sample Oracle 12.x Lite Connection
  Driver            = /var/virtuoso82/installoracle/lib/ora120_mt_lt.so
  ServerType        = Oracle 12.x
  Username          = XXXXXXXXX
  Password          = 
  FetchBufferSize   = 99
  ReadOnly          = Yes
  JetFix            = No
  NoRowSetSizeLimit = No
  NoAutoCommit      = No
  NoLoginBox        = No
  Options           = XXXXXXXXXXXXXXXX

I am setting:
$ export LIBPATH=“/var/virtuoso82/installoracle/lib”
$ export SHLIB_PATH=“/var/virtuoso82/installoracle/lib”
$ export LD_LIBRARY_PATH=“/var/virtuoso82/installoracle/lib”

But

Now I must restart Virtuoso and all must be work ? Not working at the moment :frowning: Or I am missing again some steps ?
Also Driver must be a reference or a path because I have ( Driver = OpenLink Virtuoso) :

  [Local Virtuoso]
  Driver  = OpenLink Virtuoso
  Address = localhost:1111

Ok, now is working It was missing the ORACLE CLIENT path…
Thanks ! Regards !

OK, good to hear it is working now …