Monthly Archives: May 2016

Create a report with BI Publisher

One could create reports within the OBIEE sphere with the analytics. Another possibility is to use the BI Publisher. This option has several advantages. One advantage is that one choose between a direct query on the database or use the route via the creating of a subject area.
I can see advantages using a direct query on the database.
Let us take a table that may be used as a source for a report. The take looks like:
Untitled
We want to create a report where name is shown along with the sum of Aantal. So, we expect something like pipo having 4 and jan having 6.

The first step is to invoke the BI Publisher with something like http://van-maanen.com:7780/xmlpserver, where van-maanen.com is the server, 7780 the port and xmlpserver the application.
One must check whether a datasource is available to the database where the table is stored. This can be done with Administration>JDBC where the datastores are listed.
Such a datasource is not limited to Oracle databases. It is possible to use other databases as well. From OBIEE interface, I got the impression that SQL Server and NCR was well supported. However, I could create a link to a MySQL database quite easily. I assume that all databases that have a JDBC connection can be reached. This would imply that Postgress etc can be used as a source as well.
Once that is fixed, one must create a so-called data model. The data model can be created from the homepage. There the possibility is to select under Create, the data model option.
Untitled
There one comes into a menu where one might opt to use a query builder to create a structure that contains the necessary data:
Untitled
This can then be saved to have a data model. Roughly stated, a data model is a dataset that one may capture in a report.
The report can subsequently be created from this environment.
See:
Untitled
This allows to create a report. Do not forget to save the report.
A nice twist is that one may create the final version of the report with Word. When the proper BI Publisher version is installed (in my case BIPublisherDesktop32), one could use Word as a means to modify the report. If properly installed, one has a Bi Publisher tab in Word. This allows to include fields from the report in a word document. One must log in to to the weblogic server (where the report is stored), select the report and one may then enter fields from that report in a word document. See:

Untitled.
The actual content can be shown if the preview is selected from the menu. This then finally renders the report that we expected to see:
Untitled

Bash script to upload file

In many environment, we have a situation whereby a file must be transmitted via a script from one server to another. Assume we have a linux environment where Bash is installed. In that case, a sftp connection can be used. The principle is relatively simple: a sftp session is started from one machine to another. Via ftp commands, the file is transferred. But one may prefer to have a batch script that takes care of setting up the connection, transferring the file and closing the connection.
I assume that the two machines have set up a connection via private/ public keys. This avoids the necessity of having to provide a password.
One might use:

#!/usr/bin

sftp_user="pi"
sftp_machine="192.168.2.11"

eval sftp -b ftpregel $sftp_user@$sftp_machine

rc=$?
echo $rc
        if [ $rc -ne 0 ]
        then
                echo "$PROGNAME: ERROR in sftp!"
        fi

and the ftpregel that contains the ftp command looks like:

put GeileBeer.log
quit