Hadoop OpenTSDB timeseries database and Grafana with WinCC OA…

Forwarding events from WinCC OA to OpenTSDB, which is based on HBase. Based on OpenTSDB Grafan can be used to build cool dashboards in a very fast way.

Live Example (my photovoltaic data) : http://82.149.127.81/grafana

On my test environment (i7 with 32gb RAM and 8 threads) i was able to push about 20000(!) values per second from my WinCC OA system to my Hadoop/HBase cluster. WinCC OA and the Hadoop Cluster are running on Hyper-V.

Grafana

Monitoring WinCC OA detected failures…

By monitoring the CPU load of my Oracle Database and the RDB-Buffer-Blocks i was able to detect a relationship … after some time the RDB Manager is not able to write data anymore and restarts…  seems to be an Oracle Problem… i should add more WinCC OA metrics…

CPU-Monitoring

 

DDE: Problem Key ‘ORA 600 [peshmgel: Table size]’ was completely flood controlled (0x6)
Further messages for this problem key will be suppressed for up to 10 minutes
Errors in file /app/oracle/diag/rdbms/cdb/cdb/trace/cdb_ora_50519.trc (incident=223091) (PDBNAME=PVSS):
ORA-00600: internal error code, arguments: [26599], [1], [150], [], [], [], [], [], [], [], [], []
Incident details in: /app/oracle/diag/rdbms/cdb/cdb/incident/incdir_223091/cdb_ora_50519_i223091.trc
Use ADRCI or Support Workbench to package the incident.

Oracle Inmemory Database (and materialized view)…

# turn on the inmemory option (it’s part of the SGA, so get sure that the SGA is big enought)

alter system set inmemory_size=1G scope=spfile;

One gigabyte seems to be less, but inmemory tables are stored column oriented. so, Oracle uses also compression .. for example i loaded a table with 1.2 Mio Rows (but only 5 columns) and i just needed ~30MB (in)memory.

# create a materialized view which is refreshd every 5 minutes

create materialized view sma_ext_5min_snp
refresh complete start with (sysdate) next (sysdate+5/24/60) with rowid
as select * from sma_ext_5min;

# put the materialized view table into memory
alter table sma_ext_5min_snp inmemory;

# check the inmemory state of the materialized view (table)

SELECT table_name, inmemory, inmemory_priority, inmemory_distribute, inmemory_compression, inmemory_duplicate FROM user_tables WHERE table_name = ‘SMA_EXT_5MIN_SNP’

# access the view so that it will be loaded into memory (default is load on use)

select count(*) from sma_ext_5min_snp;

# check if it is loaded into memory:

select * from v$im_segments

How to send alerts to an Android App by push notifications…

With the new WinCC OA version 3.13 it is very easy to use webservices. A simple example is to send alerts to an app (Android, iOS, Windows) by push notifications (powered by Windows Azure Cloud).

 

All you need is:

* Download a panel: http://rocworks.at/share/rocworks.pnl

* Download an Android-App: http://rocworks.at/share/rocworks.apk

* Android Barcode Scanner: https://play.google.com/store/apps/details?id=com.google.zxing.client.android

* Start the panel and scan the QR-Code with the App (top right menu button “scan”)

* You can create your own distribution channel with a click on “create new QR code” in the panel and scan it with your phone(s).

 

This is just a demo. It is not safe and not secure.

You can use and adapt the panel as you want.

No guarantee about the availability of the cloud service.

 

Panel

 

Screenshot_2014-12-18-18-08-14

How to use “server side database access” (sdb.ctl) for WinCC OA

The sdb.ctl is a client library which can be used to access relational databases from the WinCC OA client without the need to install any database client software at the client. The connection to the relational database is handled by the WinCC OA server. The client communicates with the WinCC OA server only by data points. The SQL-Statements are transferred by data points to a WinCC OA control, this control executes the SQL-Statements and sends back the result to the client by data points.

Howto: sdb

How to replicate values to data centers, big-data, SOA, … with WinCC OA…

With a little adaptor in the RDB-Manager it is easy to forward values to an Java EE Server like Glassfish (free).

And from a Java-Bean values can be forwarded to any kind of data sink.

 

As an example i forwared values to Oracle Event Processing

http://www.oracle.com/us/products/middleware/soa/overview/complex-event-processing-ds-066411.pdf

Enabling Fast Data and the Internet of Things.

 

Calculate a moving average in WinCC OA? Quite simple with CQL (Continous Query Language, this is not SQL):

select el, avg(val) as val from channel1 [RANGE 1 MINUTE SLIDE 5 SECONDS] group by el

 

Or use the power of Microsoft Machine Learing: http://azure.microsoft.com/en-gb/services/machine-learning/

Machine learning – mining historical data with computer systems to predict future trends or behaviour – touches more and more lives every day. Search engines, online recommendations, ad targeting, virtual assistants, demand forecasting, fraud detection, spam filters – machine learning powers all these modern services. But these uses barely scratch the surface of what’s possible.

Rest-Forward

How to use “server side database access” (sdb.ctl) for WinCC OA

The sdb.ctl is a client library which can be used to access relational databases from the WinCC OA client without the need to install any database client software at the client. The connection to the relational database is handled by the WinCC OA server. The client communicates with the WinCC OA server only by data points. The SQL-Statements are transferred by data points to a WinCC OA control, this control executes the SQL-Statements and sends back the result to the client by data points.

http://www.winccoa.net/index.php?action=attachment&id=2