X architecture db2 to connect 2 databases - command-line

I am just a beginner and I was trying to learn how to use the x Architecture to connect two db2 databases. I know some stuff about XA like, it acts like an API between different databases. I was wondering if someone has some resource with all the xa db2 commands and I could try them out. I think I cannot use command line for xa, I need to write an SQL application. Please, correct me where I am wrong. Thank you. Every answer is appreciated.

Why are you not using db2 federation?

Related

Using ODBC in Matlab without database toolbox

I want to connect from Matlab to Algo Financial Modeller results that are accessible through ODBC. However, I cannot find anyway to do it without database toolbox that I do not have.
I found this discussion:
How to connect to Microsoft SQL Server 2008 (MSSQL) from Matlab?
But unfortunately there isn't presented any way that uses ODBC.
I would be grateful for any help in that matter.
Thanks in advance!
Artur
Yes, you can do without the database toolbox and use ODBC via ADO.
Example of something that works for me:
conn = actxserver('ADODB.Connection')
conn.Open('driver={MariaDB ODBC 3.0 Driver}; server=myserver; port=myport; dns=mydb; uid=user; pwd=password')
conn.Execute('use mydb')
r = conn.Execute('select * from my_table')
r.GetRows()
Some remarks:
Obviously, replace MariaDB ODBC 3.0 Driver with your own ODBC driver
Despite what some documentations say, server=myserver,myport does not work for me, port=myport does.
For some reason, despite having dns=mydb in the connection string, I still have to use mydb.

Does Flyway support DB2 for zOS?

Does Flyway support DB2 for zOS?
The information here http://flywaydb.org/documentation/database/db2.html seems to indicate it is only tested on DB2 for LUW.
This has not been tested. Please give it a try and let me know how it went! Feel free to file any problems you encounter in the issue tracker.
It can't work as written for Db2 for Z as there is a system table that LUW has that Z does not have. It would be really nice to have this in the Z environment.

Accessing non-public schema in PostgreSQL with Pentaho

Let me start by saying, what I know about Pentaho wouldn't fill up a single paragraph. I'm more knowledgeable about PostgreSQL. I'm working with some contractors that are building a set of monthly reports in Pentaho (v. 4.5) for my company. Some of the data needs to go through a ETL process and get rolled up for reporting purposes. From a dba(ish) point of view, I would like to move these tables into a separate PostgreSQL schema.
I know that Pentaho is often times used with MySQL (which doesn't have schemas) and I'm concerned this might cause problems. I've done some "googlin'" and I don't turn up a lot of hits on the topic, but I did find a closed bug from a few years ago - thus implying that the functionality should be supported.
before I do this, I would like to see if anyone knows of a reason this will fail or be a bad idea. (or if you've done it an it works great, please let me know that, too).
Final notes: I'm using PostgreSQL 9.1.5, and I don't have access to a Pentaho instance to even test this myself. And I'm hoping the good folks in the Stackoverflow community will share their expertise and save me from having to install one and the hours of playing/testing to get an idea of this is a bad idea.
EDIT:
I sort of knew this question was a bit vague, but I was hoping that some one would read it and share any experience they have. So, Let me spell it out more clearly and ask more explicit questions.
I have not done anything. I don't know Pentaho. I don't want to learn Pentaho (not that there is anything wrong with Pentaho... It's just not where my interests are right now). My company hired contractors (I did not hire them). They have experience with Pentaho, but with MySQL. They don't really know anything about PostgreSQL. There are some important difference between PostgreSQL and MySQL. Including the fact that PostgreSQL supports schemas (whereas MySQL uses separate database... similar in concept be behave differently in some ways). Some ORMs (and tools) don't really like this... for example, the Django framework still doesn't really fully support schemas in Postgresql (I know this because I use Python and Django often and my life is much better when I keep things in the "public" schema). Because of my experience with Django and PostgreSQL schemas, I'm a bit leery of moving this data to a new schema.
I do understand that where ever the tables are, they will need permissions to be able to access the data.
My explicit questions:
Do you use Pentaho to access a PostgreSQL database to access tables in schemas other than "public" (the default).
If so, does it just work (no problems)?
If you had problems, would you please be willing to share with me (and the Stackoverflow community) any online resources that helped you? Or would you be willing to detail what you remember here?
Do you know of anything that just won't work correctly? For example, an open bug in Pentaho related to this topic.
Again, it's not your standard kind of question. I'm hoping that someone out there has experience and is willing to share it here and save me from having to spend time setting up a new Pentaho instance and trying to learn Pentaho well enough to test it, etc.
Thanks.
Two paths you can take:
1) What previous post said ("Pentaho steps (table inputs, outputs, etc.) usually allow you to specify a database schema.")
2) In database connection, advanced tab, "The preferred schema name".
If you're working with different schemas, you can create one database connection per schema. With this approach you can leave schema field in input/output steps empty.
We use MS SQL server and I can tell you that Pentaho does struggle with the idea of a schema. Many of their apps allow you to select a schema but Pentaho, like you said, is built to use something like mySQL.
Make you pentaho database user work like it would be working in mySQL.
We made the database user default to dbo then we structured our tables like dbo.dimDimension,
dbo.factFactTable etc. Basically, only use dbo for Pentaho purposes. (Or whatever schema you want to default to.)
I use PDI and PgSQL extensively every day with a bunch of different schemas. It works fine. The only trouble you might run into is Pg's troublesome practice of forcing unquoted identifiers to lower instead of upper case. I soon realized everything was easier when I set the Advanced connection property to "Quote all in database".
Yes, you have to quote everything when you type SQL if PDI doesn't do it for you, but it works quite well. Haven't experimented with forcing all identifiers to lower case, but I expect that would work as well.
And yes, use the "Preferred schema nanme" as well, but be aware that some steps use that option and others don't. You can't, for example, expect it to add schema names to SQL you type into a Table Input step.
The only other issues you might run into are the limits of Pg's JDBC driver. It's not as good as SQL Server's or DB2's, but the only thing I've every had trouble with was sending error rows from a Table Output step to another step when the Table Output step was in batch mode.
Have fun learning PDI. It makes a great complement to your DBA skills.
Brian
Pentaho steps (table inputs, outputs, etc.) usually allow you to specify a database schema.
I did a quick test using PDI and our 8.4 Postgres instance and was able to explore, read from and write to tables in different schemas.
So, I think this is a reasonable direction. Hope this helps.

How to create and compile procedures in IBM db2

I am new to db2. I have written procedures in oracle.
I need to convert those procedures from oracle to db2.
I want to know how the procedures in db2 will be created and compiled.
Thanks in advance.
A good walkthrough can be found here.
But then you always have the redbooks that IBM puts out such as this or this.
It is worth pointing out this migration tool that you might find useful.

PostgreSQL data comparsion tool

I am looking for a tool/command which can compare data between two PostgreSQL databases. The reason to do this is to have some external verification that the SQL script responsible for data migration from one PostgreSQL database to the other have been written correctly.
Any pointers would be appreciated
regards
Sameer
EMS makes a tool which can do this.
http://sqlmanager.net/en/products/postgresql/dbcomparer
The PostgreSQL site has a nice Software catalogue. Peruse the Administration/development tools category.