Change database connection in pentaho without using GUI - pentaho

i wanted to try to run the pentaho from Linux Centos 7.
In the server there are no GUI for it, so i can't open the Spoon GUI where we usually drag and drop the components.
If we use the Spoon, we can change the Database Connection by clicking the Database Connection then re-type the host.
But how do i do that if i can't open the Spoon? Is there a file or something where i can change those?

All transformation and job files are just XML.
You can edit a transformation in your laptop with the correct parameters, save it, find the relevant XML snippet, copy, open the ktr on the server in a text editor, delete the old db connection and paste in the new one.
It may actually be a bit tricky if you mess something up, but with a few tries you should have it done.

You can use JSON file to change database connection in Pentaho Data Integration without using GUI.
Set variable and database connection value in that variable inside that JSON file so that next time you just drag and drop JSON file in server where you cannot open Spoon GUI to change the database connection values.
Let me explain how we do it.
First create a transformation where we take JSON file as input and set that value into variable to later use that value anywhere inside that job as ${variable_name}.
JSON file looks like this ...
Browse and add your JSON file ...
Go to Fields tab and Select field ...
Now in set variable step go to Get Fields ...
Now let us suppose we have created these variables in JSON file now we use these variables to create a database connection.
${mysql_host}
${mysql_port}
${mysql_username}
${mysql_password}
${mysql_database_name}
like this ...
In this way you can build your ETL with dynamic database connection in Pentaho Data Integration. Just replace JSON file in server then database connection will be changed in that whole ETL package.
This example ETL package can be downloaded from this link:
Download

Related

Shared Data Source for Excel

I am currently creating reporting within excel for lets say 'Non Advanced Users'. I Have successfully created this in and I can execute the stored procedure with parameters typed into excel cells. But when I send this to another user it is saying that it is unable to connect to the data source. Is there a way I could tell excel to use a data source on our network. The connection has SQL Authentication. Basically I want to try and avoid having to create data sources via excel on 100+ machines!!
Yes you can. You can save the connection setting in the excel file itself, and just send out that file. See picture below for step-by-step guide.
Remember to CLEAR (uncheck) the 'Always Use Connection File' in Step 6.

how can I get the data out of an .fb file?

I'm working with a company trying to setup a new database system as their old database software has gone out of business. All the data is in a .fb file that is encrypted (You used to have to get backups 'unlocked' before they would let you use them).
I've managed to get a copy of the database (I think it's unencrypted as I copied it while the database was open and then changed the copied files permissions using terminal).
The problem is that it's a .fb file and I can't find a way to 'open' it to browse the data...
Any Ideas?
Generally speaking, data stored in relational databases aren't just stored as ascii csv files. So you won't be able to just open up a .fb file in a text editor and grab the data.
If you're still able to query the database, you will need to have the frontbase server generate a dump of the data into a flat file.
See the frontbase documentation for backup and restore. Specifically 4.9.1. Exporting Schema and Content Data:
WRITE ALL OUTPUT('<output-directory>' [,'YES']);

Some useful functions of MySQL Workbench for SQL Server management studio

Our project is moving from MySQL to MS SQL and after a long time working with MySQL Workbench I really miss some features in SQL Server Management studio (2014).
Do you know whether they exist in SSMS or there is an alternative/replacement application for SSMS to work with database?
Functions are listed below:
Generate update data script to review and to be able to copy-paste it. Do not update data when I move to another row when the table is opened for editing.
Some changes are still made in database in our project, and sometimes it's easier to add some rows manually in 5 tables, get the script, test it and run the script at production environment. I don't want to write a script for each update and I don't want to make a mistake when copying data to production server using edit table option.
Review update table script BEFORE the changes were made, not after (I am talking about Tools - Options - Designer - Auto generate change scripts).
Upload a file using select file dialog into a binary field.
Again, I know about using OPENROWSET function, just interested how to do it as I used to.
Ability to view large text fields in a convenient way in SSMS. Now I have to copy data from a field and paste it into notepad. (For example, error message with a long trace log)
Save a few tabs with some useful scripts and open all of them when I open SSMS.
Is there any way to organize tabs to be able to work with 10+ tabs more effectively? Now only 6 of them can be shown on the screen (compate it to 15 tabs in MySQL WB).
Simple 'search field' (like Ctrl+F in Excel) to be able to search data in all fields displayed on the screen.
I would appreciate any ideas.
Thank you.

How to run SQL in Intellij from file instead of console

I am using Intellij 14.1.4. I am able to run SQLs by custom defined db data sources in database console.
I have some sql files in my project and would like to execute them directly instead of copying them to the database console. However, I am not able to use the same data sources that I created for the console when setting up connections from the DB Connections drop down.
I wonder how to run SQL statements from sql files with the same data sources as the ones I defined in the db console?
Thanks
You can right-click on an sql file in the editor and there is an option "Run myfile.sql"
To run SQL statements from sql files You must associate with file type
see how

Generate script for both schema and data

I have a SQL Server database for which I want to generate script of data as well as schema both. I tried Tasks -> Generate Scripts -> Script all objects in the selected database but it does not give the .sql for the data itself.
How do we generate the .sql database for both data as well schema? Please suggest some easy method such as a tool or something that can be used easily
Backing up/Exporting database
There are two ways to Back up/Export a SQL Server database using SQL Server Management Studio:
Right click database → Tasks → Generate Scripts → Choose DB → Change “Script Data” option to true → …
Right click database → Tasks → Backup → ...
The first method creates a .sql file that then we need to run. The problem with this method is that the .sql file can be too big to be opened with SQL Server Management Studio. In that case we need to use the sqlcmd utility (should be already installed if we have SQL Server MS). Instructions below.
The second method creates a .back file that is then easy to import into an empty database.
Importing Database
If we have a .sql file and it’s not too big we can just open it with SQL Server MS and run it.
If we have a .sql file but it’s too big to be opened with SQL Server MS we have to use sqlcmd like this:
>sqlcmd -i C:\panels_QA28July11.sql -o C:\PanelsImportResult.txt
The parameter after -i is the file to import. The parameter after -o is where to save the output. We can omit the second parameter if we want to see the process on the screen.
By default it will use the local machine and local database server. If we want to use a different machine and server we use the -S option.
Right Click on db => Tasks => Generate Scripts => In "Set Scripting Options: Click Advanced, find Types of data to script. You can choose between Data only, Script and data and Schema only. The default is Schema only
Images talks better than words, :)