Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6...
Transcript of Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6...
![Page 1: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/1.jpg)
#PIWorld ©2019 OSIsoft, LLC
Modernizing PI SQL For The Future
Bodo Bachmann
Christopher Sawyer
1
![Page 2: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/2.jpg)
#PIWorld ©2019 OSIsoft, LLC
Your Speakers Today
2
• Bodo Bachmann
• Team Leader, Software Development
• Christopher Sawyer
• Technology Enablement
![Page 3: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/3.jpg)
#PIWorld ©2019 OSIsoft, LLC
#PIWorld ©2019 OSIsoft, LLC
Why SQL for the PI System
3
• Simplest place to cross-pollinate actionable line-of-business (LOB) data with real-time data
• Enhancing Real Time Data with LOB data
• Enhancing LOB Data with RT
• Maximizes the resources you already have to complete data projects:
• SQL Database Administrators • Web Developers • LOB App Developers
![Page 4: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/4.jpg)
#PIWorld ©2019 OSIsoft, LLC
#PIWorld ©2019 OSIsoft, LLC
Why SQL for the PI System
4
•Some data will never live in SQL (streams)
•Some data will never live in the PI System (financial costing)
•We’ve optimized how we merge relational structures and their relationships to assets with streaming data in the PI System
![Page 5: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/5.jpg)
#PIWorld ©2019 OSIsoft, LLC
• Performance and scalability
• Review data model • Reduce query complexity • What are top use cases (use customer feedback) • Address known issues (e.g. timestep data type, PI time literals)
• Infrastructure to support multiple standards and thin clients
• Works across WAN and different time zones
• Review security and authentication
Next Generation Development Goals
![Page 6: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/6.jpg)
#PIWorld ©2019 OSIsoft, LLC
Java Client Application
JDBC Client
PI SQL Client JDBC SQL
Queries JDBC
v4.0,v4.1, v4.2 https
6
PI SQL Client Architecture
Client Application
OLE DB Consumer
PI SQL Client OLEDB SQL
Queries
PI Data Archive
PI AF Server
OLE DB
API
net.tcp or
https
C++
Lib
Middleware
PI Integrator for Business
Analytics
PI SQL DAS
(Integrator
Framework)
Middleware
PI SQL Data Access
Server
PI OLEDB
PI
OLEDB
Enterpris
e
Middleware
PI SQL DAS
(RTQP
Engine)
MS SQL Server
AF Server
Client Application
ODBC Client
PI SQL Client ODBC SQL
Queries ODBC v3
API
net.tcp or
https
C++
Lib
![Page 7: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/7.jpg)
#PIWorld ©2019 OSIsoft, LLC
Architecture
![Page 8: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/8.jpg)
#PIWorld ©2019 OSIsoft, LLC
• Deployment
• Working with different internal data sources
• Issue of Data References
• Memory Management / Intermediate Results
• Optimization
• Streaming
• Security
RTQP Engine – A Learned Technology
![Page 9: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/9.jpg)
#PIWorld ©2019 OSIsoft, LLC
RTQP Engine: Data Model
• Entity-Relationship Model
• Connection = AF Database
• Master Catalog
• Elements and Event Frames
• Attributes and Data
• Categories and Templates
• Template based Table-Valued Functions (New!)
• Denormalization
• Navigation Columns
• Multiple Value columns
![Page 10: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/10.jpg)
#PIWorld ©2019 OSIsoft, LLC
Denormalization
Simplified Queries
SELECT eh.Path + eh.Name Element, et.Name Template FROM NuGreen.Asset.Element e LEFT OUTER JOIN NuGreen.Asset.ElementTemplate et ON et.ID = e.ElementTemplateID INNER JOIN NuGreen.Asset.ElementHierarchy eh ON eh.ElementID = e.ID WHERE et.Name IN ('Boiler', 'Heater')
SELECT e.PrimaryPath + e.Name, e.Template FROM Master.Element.Element e WHERE e.Template IN ('Boiler', 'Heater')
![Page 11: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/11.jpg)
#PIWorld ©2019 OSIsoft, LLC
Simplified Queries SELECT eh.Path + eh.Name Element, et.Name Template, ea.Name Attribute, s.Time, s.Value FROM NuGreen.Asset.Element e LEFT OUTER JOIN NuGreen.Asset.ElementTemplate et ON et.ID = e.ElementTemplateID INNER JOIN NuGreen.Asset.ElementHierarchy eh ON e.ID = eh.ElementID INNER JOIN NuGreen.Asset.ElementAttribute ea ON eh.ElementID = ea.ElementID INNER JOIN NuGreen.Data.Snapshot s ON ea.ID = s.ElementAttributeID WHERE et.Name IN ('Boiler', 'Heater') AND eh.Path = N'\NuGreen\Houston\Cracking Process\Equipment\' ORDER BY 1
SELECT e.PrimaryPath + e.Name Element, e.Template, ea.Name Attribute, ea.ValueTimeStamp, ea.Value FROM Master.Element.Element e INNER JOIN Master.Element.Attribute ea ON e.ID = ea.ElementID WHERE e.Template IN ('Boiler', 'Heater') AND e.PrimaryPath = N'\NuGreen\Houston\Cracking Process\Equipment\' ORDER BY 1
Extention
![Page 12: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/12.jpg)
#PIWorld ©2019 OSIsoft, LLC
RTQP Engine: Custom Objects
• Views
• Custom Table-Valued Functions
• Function Tables for Table-Valued Functions
• Custom Functions
![Page 13: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/13.jpg)
#PIWorld ©2019 OSIsoft, LLC
13
SQL Clients
13
![Page 14: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/14.jpg)
#PIWorld ©2019 OSIsoft, LLC
• No AF SDK dependency
• ODBC added
• JDBC added
PI SQL Client 2018 R2
![Page 15: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/15.jpg)
#PIWorld ©2019 OSIsoft, LLC
• AF Database names can be browsed when PI Web API Core Services are configured
• Time Zone support
• Query Date
Connection and Connection Options
![Page 16: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/16.jpg)
#PIWorld ©2019 OSIsoft, LLC
PI SQL Client: OLE DB Provider
•SQL Server integration (SSRS, SSIS, etc.)
•BizTalk
•SAP Crystal Reports
•ADO.NET, ASP.NET
![Page 17: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/17.jpg)
#PIWorld ©2019 OSIsoft, LLC
PI SQL Client: ODBC Driver
•Oracle integration
•BI Tools, e.g. Tibco, Spotfire, Power BI
•Crystal Reports
•ADO.NET, ASP.NET
![Page 18: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/18.jpg)
#PIWorld ©2019 OSIsoft, LLC
PI SQL Client: JDBC Driver
•Pure Java
•Https only
![Page 19: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/19.jpg)
#PIWorld ©2019 OSIsoft, LLC
PI SQL Client: PI SQL Commander
• Browse Data Model and Functions
• Compendium
• Code/keyboard pre-completion (it might also be known as IntelliSense™®©)
![Page 20: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/20.jpg)
#PIWorld ©2019 OSIsoft, LLC
Sample Queries and Performance
![Page 21: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/21.jpg)
#PIWorld ©2019 OSIsoft, LLC
Future
• Locale property: • e.g. '01-Dec-2019' vs N'01-Dez-2019’
• Data Archive tables (PI tags vs AF attributes)
• INSERT/UPDATE/DELETE event frames
• INSERT/UPDATE/DELETE tags/attribute values
![Page 22: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/22.jpg)
#PIWorld ©2019 OSIsoft, LLC
DEMO
22
Microsoft SQL Server – PI SQL Client Remote Connection
![Page 23: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/23.jpg)
#PIWorld ©2019 OSIsoft, LLC
![Page 24: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/24.jpg)
#PIWorld ©2019 OSIsoft, LLC
Questions?
Please wait for
the microphone
State your
name & company
Please remember
DOWNLOAD THE MOBILE APP
24
![Page 25: Modernizing PI SQL For The Future - OSIsoft...SQL PI SQL Client JDBC Queries v4.0,v4.1, v4.2 https 6 PI SQL Client Architecture Client Application OLE DB Consumer (RTQP PI SQL Client](https://reader030.fdocuments.us/reader030/viewer/2022040610/5ed36d3cc0c9044a864b0e9c/html5/thumbnails/25.jpg)
#PIWorld ©2019 OSIsoft, LLC
25