If you have IBM DB2 client and you have to move data from remote source database to local target database then you can use db2 move utility.
First, catalog the node:
1) db2 catalog tcpip node <node_name> remote <server_name> server <port_number>
2) db2 terminate
Second, catalog the database:
3) db2 catalog db <remote_db_name> as <local_alias_db_name> at node <node_name>
4) db2 terminate
Export data:
db2move <db_name> export -sn <schema_name> -aw -u <login> -p <password>
You can move schemas or given tables. See help for db2move.
Before importing tables data in existent tables you should turn off identity constraint else import process fail:
db2 alter table <table_name> alter column <column_name_with_identity> drop identity
Import data:
db2move <db_name> import -u <login> -p <password>
After import restore identity constraint:
db2 ALTER TABLE <table_name> ALTER COLUMN <column_name_with_identity> SET GENERATED AS IDENTITY ( START WITH <count_the_number_yourself> INCREMENT BY 1)
To uncatalog database and node:
db2 uncatalog database <alias-name>
db2 uncatalog node <node_name>
This blog is a collection of minds around linux, java, javascript, etc. Looking for great opportunities.
понедельник, 1 июня 2015 г.
понедельник, 25 мая 2015 г.
AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis
Ever heard of antipatterns? Read the top rated book about antipatters. Think is it right thing to read? Read the review here. Well, you can save up some time and instead read the wiki page about them.
Recommendations for using E-mail at work
• Treat every e−mail as if it could be used as evidence in a court of law.
• Treat every e−mail as if it were going directly to your enemy.
This rules are simple and add safety to you.
• Treat every e−mail as if it were going directly to your enemy.
This rules are simple and add safety to you.
среда, 13 мая 2015 г.
Teach Yourself Programming in Ten Years
Do you know how much it take to learn programming? I don't know. Practice a lot, learn a lot, solve problems a lot.
Read an article by Peter Norvig about teaching yourself programming. This article is under cut for a historical reference and convenience. All rights for it belongs to Peter Norvig.
Read an article by Peter Norvig about teaching yourself programming. This article is under cut for a historical reference and convenience. All rights for it belongs to Peter Norvig.
Last read book: SQL Antipatterns: Avoiding the Pitfalls of Database Programming
Hello! Today I'm going to share my impressions about
SQL Antipatterns: Avoiding the Pitfalls of Database Programming.
SQL Antipatterns: Avoiding the Pitfalls of Database Programming.
вторник, 5 мая 2015 г.
Db2 LUW 10.5 JDBC driver properties
Db2 JDBC driver for LUW has a lot of properties. Description one can find on http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_r0052607.html.
One useful property I was needed is "currentSchema" . It specifies the default schema name that is used to qualify unqualified database objects in dynamically prepared SQL statements. The value of this property sets the value in the CURRENT SCHEMA special register on the database server. The schema name is case-sensitive, and must be specified in uppercase characters.
In WebSphere Application Server this properties can be found in "Custom properties" section of the datasource.
One useful property I was needed is "currentSchema" . It specifies the default schema name that is used to qualify unqualified database objects in dynamically prepared SQL statements. The value of this property sets the value in the CURRENT SCHEMA special register on the database server. The schema name is case-sensitive, and must be specified in uppercase characters.
In WebSphere Application Server this properties can be found in "Custom properties" section of the datasource.
среда, 29 апреля 2015 г.
Use code generator for automation JDBC DAO creation
I'm tired of writing JDBC DAO for database access. It is tedious and repetitive work. Why can't you use JPA? Not every data model can be covered with JPA.
After some research I've found out the project Telosys tools. It allows you to generate the JDBC DAO.
What can it offer for free? It's open source :-).
It provides you an Eclipse plugin and templates. Templates can be found here.
Also it has a good documentation. About five minutes and you can find out how to use it.
What you get is a free time.
After some research I've found out the project Telosys tools. It allows you to generate the JDBC DAO.
What can it offer for free? It's open source :-).
It provides you an Eclipse plugin and templates. Templates can be found here.
Also it has a good documentation. About five minutes and you can find out how to use it.
What you get is a free time.
Convert XSD to sql with Altova XmlSpy 2011
Sometimes you got a task to parse xml and load it into database. The xml conforms to xml schema.
You have to create the sql for the xsd. How to do it?
XmlSpy has the ability to convert xsd into sql. Well, it claims to support DB2.
So, the surprise was that XmlSpy uses ODBC driver. That's a big surprise. Ok.
After after some processing XmlSpy figured out the sql, but... all attributes were VARGRAPHIC.
XmlSpy allows you to change the sql types, but it is a lot of work.
That is very strange behavior, because in XSD was already signed the standard XML schema types.
At least, I've got a start sql to work with...
You have to create the sql for the xsd. How to do it?
XmlSpy has the ability to convert xsd into sql. Well, it claims to support DB2.
So, the surprise was that XmlSpy uses ODBC driver. That's a big surprise. Ok.
After after some processing XmlSpy figured out the sql, but... all attributes were VARGRAPHIC.
XmlSpy allows you to change the sql types, but it is a lot of work.
That is very strange behavior, because in XSD was already signed the standard XML schema types.
At least, I've got a start sql to work with...
вторник, 28 апреля 2015 г.
Bugs in your code
"The software industry average is 15 to 50 bugs per 1,000 lines of code."
This is quotation from the book SQL Antipatterns: Avoiding the Pitfalls of Database Programming (p. 71).
I don't know how did they get the results, but info is rather curious.
Do you know how many bugs in you code?
This is quotation from the book SQL Antipatterns: Avoiding the Pitfalls of Database Programming (p. 71).
I don't know how did they get the results, but info is rather curious.
Do you know how many bugs in you code?
четверг, 23 апреля 2015 г.
Подписаться на:
Сообщения (Atom)