PI SQL Data Access Server (OLE DB) 2018 Administrator Guide
PI SQL Data Access Server (OLE DB) 2018 Administrator Guide
Administrator Guide
OSIsoft, LLC
1600 Alvarado Street
San Leandro, CA 94577 USA
Tel: (01) 510-297-5800
Fax: (01) 510-357-8136
Web: http://www.osisoft.com
Introduction.............................................................................................................. 1
In this guide..................................................................................................................................................... 1
About Developer Technologies........................................................................................................................1
Architecture.................................................................................................................................................... 2
Deployment options........................................................................................................................................2
Troubleshooting...................................................................................................... 29
Run PI SQL DAS (OLE DB) interactively.........................................................................................................29
Checklist for troubleshooting a trusted connection in a double-hop scenario................................................ 29
Connection messages and errors................................................................................................................... 30
Third-party libraries..................................................................................................33
PI SQL Data Access Server (OLE DB) 2018 Administrator Guide iii
Contents
In this guide
This guide provides procedures for the installation and configuration of PI SQL DAS (OLE DB)
on Windows operating systems.
Users of this guide should be familiar with PI OLEDB Provider and PI OLEDB Enterprise.
• SQL-based data access (PI OLEDB Provider, PI OLEDB Enterprise, PI JDBC Driver, PI ODBC
Driver, and PI SQL Client OLE DB)
• Service-oriented architecture (PI Web API)
• Programmatic access (AF SDK)
Developer Technologies products are available for download from the OSIsoft Tech Support
Downloads page (https://techsupport.osisoft.com/Downloads/All-Downloads/) at no charge.
You can develop applications using the Developer Technologies tools and your PI Server. If you
do not have access to a PI Server, you can obtain development licenses for the PI Server
through membership in the PI Developers Club (https://pisquare.osisoft.com/community/
developers-club). For details, see PI Developers Club FAQ (https://pisquare.osisoft.com/docs/
DOC-1101).
Deployment of an application into production requires a PI System Access (PSA) license. This is
a runtime license that enables end users to access PI System data, including time series data in
PI Data Archive and asset metadata in PI AF Server, using any of the Developer Technologies.
For more information or questions, contact your Account Manager. In case of technical issues
with the PSA license, contact OSIsoft Technical Support (https://techsupport.osisoft.com).
Architecture
The family of SQL based drivers has been re-architected to leverage PI SQL DAS for query
execution. This allows reducing the software being installed on the client to a thin driver that
has no local dependency on bigger components such as a query engine and PI SDK or AF SDK.
Currently this architecture applies to PI ODBC Driver and PI JDBC Driver. The driver
architecture provides two query engine options such as the PI OLEDB Enterprise and PI OLEDB
Provider query engines.
PI SQL DAS provides secure network communication through Net.Tcp or HTTPS to the driver
on the client side.
Deployment options
PI drivers can be deployed in various combinations. The driver and PI SQL DAS can run on
different architectures (32-bit or 64-bit). However, PI SQL DAS (OLE DB) is constructed as a 64-
bit version.
The resulting combinations can be categorized as standalone and middleware scenarios.
Note:
OSIsoft recommends using 64-bit operating systems whenever possible. Performance
will be better on a 64-bit operating system than on a 32-bit operating system.
Multiple standalone and middleware configurations can be used as needed. This is useful if the
performance of one application should not be influenced by queries of another one.
Standalone deployment
Note:
When using the standalone deployment, the following points have to be taken into
account:
• All products are installed on the server.
• Only Windows is supported for this configuration.
• Standalone applications are supported.
Use the standalone deployment if a single application must be supported with maximum
performance.
Middleware deployment
Note:
When using this deployment, consider the following:
• PI SQL standard drivers are installed on the clients, other products are installed on the
server.
• This option is also suitable for WAN, which is recommended when the expected
number of resulting rows is rather low.
• A thin driver, which is resource inexpensive, is part of this configuration.
• Queries are executed in middleware.
Middleware deployment takes advantage of cross-architecture support; for example, when
using 64-bit query execution (in PI SQL DAS) from a 32-bit ODBC application.
System requirements
Operating systems
PI SQL DAS (OLE DB) is supported on the following servers:
• Windows 7 SP1
• Windows 8 and 8.1
• Windows 10
• Windows Server 2008 R2
• Windows Server 2012 and 2012 R2
• Windows Server 2016
Server platforms
Supported server platforms (PI Data Archive, PI AF Server) are defined by the underlying OLE
DB providers used. For more information, see the PI OLEDB Enterprise and PI OLEDB Provider
Release Notes available at the OSIsoft Tech Support Downloads page (https://
techsupport.osisoft.com/Downloads/All-Downloads/)
Further requirements
PI SQL DAS (OLE DB) requires
• Microsoft .NET Framework 4.6.2
• PI OLEDB Provider 2016 or later
• PI OLEDB Enterprise 2016 or later
The required products have additional dependencies (for example, AF SDK) that are
documented in the related product documentation.
For additional information about the specific PI software release you are using, see the Release
notes of the specific product available at the OSIsoft Tech Support Downloads page (https://
techsupport.osisoft.com/Downloads/All-Downloads/). The release notes also describe the
minimum version requirements when sharing PI SQL DAS (OLE DB) across clients.
Procedure
1. Double-click the PISQLDAS_version_.exe file. The self-extracting executable window
opens.
2. Review the extraction path for the installation files and click OK.
3. Review the installation files and click OK.
◦ Specify a different account for the PI SQL DAS service, for example a Managed Service
Account.
◦ Choose the ports that the service will use.
◦ Select an SSL certificate for encrypting the communication.
◦ Choose whether to create Windows Firewall Exceptions.
If you click the Install button, the following settings are applied by default:
◦ The service runs using a virtual service account
◦ HTTPS port defaults to 5461, Net.Tcp to 5462.
◦ Self-signed certificate
◦ Firewall exceptions for ports 5461 and 5462 are created.
Note:
Consider the following points:
◦ If you decide to use Managed Service Account instead of the virtual service account,
make sure it was installed on the computer. For more information, see the Add-
ADComputerServiceAccount and Install-ADServiceAccount Active
Directory cmdlets or Installing a Managed Service Account (https://
technet.microsoft.com/en-us/library/dd378855(v=ws.10).aspx).
◦ If you upgrade from an older version, advanced options are not accessible. PI SQL
DAS (OLE DB) gets installed using the default settings. You need to uninstall the
older version manually prior installing the new one if you want to use the custom
settings.
◦ If your scenario requires the usage of the domain account, OSIsoft strongly
recommends you use a Managed Service Account. If you need to use a standard
domain user account, run the installation with the argument USE_MSA=0.
msiexec.exe /i PI_SQL_Data_Access_Server_for_OLE_DB_x64.msi
USE_MSA=0
5. Verify that the PI SQL Data Access Server (OLE DB) Service is running.
Argument Description
SERVICE_ACCOUNT_TYPE "Default" corresponds to a virtual service account.
Specify "Custom" to use a custom service account. Use the
SERVICE_ACCOUNT_USERNAME parameter to specify the
account.
Note:
To run the complete package in silent mode, replace the setup.ini file with
silent.ini and run Setup.exe, or run Setup -f silent.ini from a command
prompt.
By default, PI SQL DAS (OLE DB) uses the following ports for the communication with the
specific driver:
Port Description
5461 The https endpoint is used for secure
communication with trusted connection or explicit
login.
5462 The net.tcp endpoint is used for communication
with trusted connection or explicit login.
You might have third-party firewall or virus scanner tools that restrict communication through
those ports. Make sure those ports are accessible.
versions, Kerberos delegation has to be enabled for either the middleware component (PI SQL
DAS machine or PI SQL DAS service account) or the resource (Resource Based Constrained
Delegation). Details for this configuration are described in the following section.
For newer product versions, this additional configuration may not be required because the
client requests delegation if allowed by the Kerberos realm policy. Refer to the corresponding
client administration guide to determine if RFC 5896 is supported.
Note:
A double-hop can only occur if Trusted Connection (TRUSTED CONNECTION=YES) is
specified for the client connection or a domain user account is provided. This is because
the original authentication occurs on the client.
If the driver is provided with a local user name and password, the information is sent to
PI SQL DAS and authentication occurs there, which is one fewer hop.
If you use a managed service account or a standard domain user account to run PI SQL DAS,
you need to enable the delegation for this particular account. Additionally you need to
associate the following service principal names (SPN) with the account:
• HTTP/computer name:port
• HTTP/computer fully qualified domain name:port
The association may be accomplished by using setspn command.
setspn -S HTTP/myserver:port mydomain\myserviceaccount$
setspn -S HTTP/myserver.mydomain.com:port mydomain\myserviceaccount$
If a domain account is used to run PI SQL DAS (OLE DB), Kerberos authentication is currently
supported for HTTPS trusted connection channel only. Net.Tcp connections will not work.
Procedure
1. In the Windows search, type Windows PowerShell and click to start the command-line.
2. Enter the following commands:
# For non-servers this requires installation of
# Remote Server Administration Tools for Windows
Import-Module ServerManager
# This is only for Windows server versions
Add-WindowsFeature RSAT-AD-PowerShell
Import-Module activedirectory
Note:
If the PI SQL DAS service runs under a domain account, use the Get-ADUser and Set-
ADUser instead.
2. Assign the front-end identity to the PrincipalsAllowedToDelegateToAccount property of the
back-end identity.
Set-ADComputer $afid -PrincipalsAllowedToDelegateToAccount $pisqldasid
Procedure
1. Download PsTools Suite.
Note:
The Windows Sysinternals website contains an introduction to PsTools and the
download of the PsTools Suite (https://technet.microsoft.com/en-us/sysinternals/
bb896649).
2. Run psexec -sid cmd.exe as administrator.
3. In the command window run PowerShell.
Settings verification
OSIsoft recommends checking the settings that were made with the following command:
Get-ADComputer $afid -Properties PrincipalsAllowedToDelegateToAccount
PI SQL DAS requires an SSL certificate to encrypt traffic between the server and clients. You can
select an SSL certificate using the advanced options during the installation. If another
certificate is already assigned to port 5461 and you select a different certificate, the original
assignment will be overwritten. OSIsoft recommends that you do not use self-signed
certificates.
Procedure
1. In a command prompt, run the tool with parameter -e. For example: From the C:\Program
Files\PIPC\SQLDAS\Tools directory, type PiSqlDasAutoConfig.exe -e.
2. Optional: Select a certificate from the Certificates dialog. The certificate must be intended at
least for Client Authentication and Server Authentication.
Note:
Enterprise certificates are typically already installed on your computer if it is part of a
domain. You should see your organization's name in the Issued by row. The certificate
named PISQLDAS is the self-signed certificate used by default.
3. Click OK.
4. This output indicates that the selected certificate has been bound to the SSL port:
C:\Program Files\PIPC\SQLDAS\Tools>PiSqlDasAutoConfig.exe –e
Found existing binding ....deleted
Create new SSL binding ....OK
Updating config file.......OK
In this example, the tool has configured the selected certificate to be used by PI SQL DAS and
bound this certificate to IP address/port 0.0.0.0:5461.
5. Restart the PI SQL DAS service to use the new configuration.
Use the following properties to map a PI Server identity for Windows user MyDomain\User1:
• Name: User1Map
• Windows Account: MyDomain\User1
• Identity: piadmin
In the PI SQL Client, the authentication information is usually configured in the connection
string. For details, see the related product documentation.
Upgrade scenarios
This section describes the installation behavior when a previous version of PI SQL DAS is
already installed. The following scenarios are possible:
Note:
This is a special situation. PI SQL Data Access Server (Integrator) is installed and a
previous version of PI SQL DAS is installed to support OLE DB queries.
SQL implementation
A PI driver delegates all SQL commands via PI SQL DAS (OLE DB) to the underlying query
engine.
• Provider Type=PIOLEDBENT
When connected to PI AF Server, the built-in query engine of PI OLEDB Enterprise is used.
For supported SQL syntax, see the PI OLEDB Enterprise topic "SQL statements" in Live
Library (https://livelibrary.osisoft.com) .
• Provider Type=PIOLEDB
When connected to a PI Server, the built-in query engine of PI OLEDB Provider is used. For
supported SQL syntax, see the PI OLEDB Provider topic "Statements" in Live Library
(https://livelibrary.osisoft.com).
PI OLEDB documentation is available at the OSIsoft Tech Support Downloads page (https://
techsupport.osisoft.com/Downloads/All-Downloads/).
Log message
Procedure
1. Start Event Viewer.
2. Click View > Show Analytic and Debug Logs.
3. Expand to Applications and Services Logs > OSIsoft > SQL > DataAccessServer-OLEDB >
Debug, right-click and click Enable Log.
Now all PI SQL DAS activity gets logged. Use any Event Tracing for Windows (ETW) tool for
analyzing the trace events.
See also Messaging features on how to receive further logging information.
Messaging features
PI SQL Data Access Server Trace
PI SQL DAS (OLE DB) optionally allows to generate logging information. To enable this feature
add the following or similar section to the PiSqlDas.exe.config file:
<system.diagnostics>
<trace autoflush="true">
<listeners>
<clear/>
<!-- Debug output -->
<add name="Default"
type="System.Diagnostics.DefaultTraceListener"/>
<!-- Event log (logs only errors) -->
<add name="EventLog"
type="System.Diagnostics.EventLogTraceListener"
initializeData="PI SQL DAS OLE DB">
<filter type="System.Diagnostics.EventTypeFilter"
initializeData="Error" />
</add>
<!-- Text file-->
<add name="TextFile"
type="System.Diagnostics.TextWriterTraceListener"
traceOutputOptions="DateTime" initializeData="C:\Temp\PI_SQL_DAS_OLE_DB.log"/>
</listeners>
</trace>
</system.diagnostics>
Note:
You can also direct output to other locations such as Windows Event Log or Console. For
configuration details see How to: Create and Initialize Trace Listeners (https://
msdn.microsoft.com/en-us/library/sk36c28t).
• PI SDK
Check the connectivity using About PI-SDK
• PI OLEDB Enterprise
Verify the functionality using PI SQL Commander
• PI OLEDB Provider
Verify the functionality using PI OLEDB Tester
• PI SQL DAS
Run PI SQL DAS interactively to verify the functionality, or use a PI OLEDB Provider query in
the pilog..pisdklog table to check for PI SQL DAS error messages
• PI driver
Start with the installation on the same computer as PI SQL DAS
Refer to Connection messages and errors for more troubleshooting information.
In case of a managed service or a standard domain user account verify that it is trusted for
the delegation.
• In Active Directory, the Account is sensitive and cannot be delegated check box is cleared
for users who access the application.
• The time stamp on the authenticator does not differ by more than five minutes from the
time stamp of the server.
• TCP/UDP port 88 is not blocked by a firewall or a router. By default, Kerberos
authentication uses TCP/UDP port 88.
• The HOST SPN is registered for the machine account (by default) or HTTP SPN is registered
for the managed service account or standard domain user account (register manually).
You can check the existing set of SPNs for the machine, managed service, or standard
domain user account by running the following command:
Setspn.exe -L <myServer-NetBIOS-name>
Setspn.exe -L <mydomain\myuser>
Successful connection
Connected to the PI SQL Data Access Server version 02.09.0000 rev.7979.
Product Version Architecture
------- ------- ------------
PI OLEDB Enterprise 1.4.2.95 64-bit
AF SDK 2.8.5.7759 MSIL
AF Server 2.8.5.7759 MSIL
AF Backend Database 2.9.0.7979
SQL Scripts for PI SQL 3.4.0.0
or
Connected to the PI SQL Data Access Server version 03.04.0405 rev.1198.
Product Version Architecture
------- ------- ------------
PI 3.4.405.1198
PIOLEDB 3.4.1.28 64-bit
PISDK 1.4.6.494 64-bit
or
PI System 'pisqldas63' is not registered.
or
ERROR [08004] [PIODBC] [PI SQL DAS gSOAP Channel] No connection
could be made because the target machine actively refused it.
Details: connect failed in tcp_connect()
Note:
This error message also occurs when the PI SQL DAS port is linked by rules, such as those
implemented by McAfee software (port 5461 or 5462 blocked by access rule).
You might be able to fix the problem by running the configuration tool
PiSqlDasAutoConfig.exe from an administrative account with elevated privileges.