473,386 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Archiving data from 2 db2 tables...........

Hi Guys ,
I am still new to the db2 world so pls help me with the
following :

I have 2 tables A & B in different databases . They can be joined on a
customer_number column. I have to archive all the data from A which is
more then 30 days old in a seprate table ( say arch_a) . For all the
archived data from A , I also have to archive related data from B in a
separate table( say arch_B) (again joined by customer number) and once
the data has been inserted in both the archived tables, It must be
deleted from the original tables(a and B).

Had it been oracle , I would have used a cursor to process the data
from A and then for each record from A , the related record from B . I
also would have used a db link to access B as its in another database.
But how could I achive the same thing in DB2 ? My challneges are :

1. How to access table B along with A as they are in different
databases ( I guess I may have to use Fedarated database)

2. How to process 30 day old data from A and then for each record
related data from B and then archive them into archived tables and in
the end delete them from the source ? ( Does db2 have cursor
functionality ? Any place where I can see examples )

3. Also how can i ensure that the archive process completes in its
entirity maintaining consistency? If there is any problem during
process , everything should rollback .(

Sorry for a long description.

Pls help.

Thanks.

Nov 12 '05 #1
1 1325
In DB2 this is called Distributed Unit of Work (DUOW) or Multisite update.
Supported is the two-phase-commit protocol.
If you search on these terms in the admin guide - programming client apps
(DB2 UDB V8) you will find instructions on how to do the above.

--
Message posted via http://www.dbmonster.com
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sally Ruggero | last post by:
I need advice on archiving data from our production database. Each night I would like to save and remove a day's data from two weeks ago, from all the tables. I know how to delete the...
4
by: Geoff | last post by:
I want to archive records from one recordset to another recordset. Not too sure of what to do in commented areas shown below. Dim Db As DAO.Database Dim Rec1 As DAO.Recordset 'Set as...
1
by: sandip | last post by:
Hi All, Can someone please help me with good and easy-to-use data archiving tools for DB2 database? Does anyone have previous experience with IBM DB2 Data Archive Expert tool? Is this a...
4
by: Paul H | last post by:
Could some one give me some pointers on basic archiving techniques? I have developed several databases but never been faced with this issue. Here is the basic scenario.. Suppose I have the...
3
bvdet
by: bvdet | last post by:
Following is an example that may provide a solution to you: """ Function makeArchive is a wrapper for the Python class zipfile.ZipFile 'fileList' is a list of file names - full path each name...
5
by: Massimo | last post by:
The iussue: Sql 2K I have to keep in the database the data from the last 3 months. Every day I have to load 2 millions records in the database. So every day I have to export (in an other...
4
by: mforema | last post by:
Hi Everyone, I have a database that currently has two types of tables: one type has all of the current data, and the other type has all of the previous, outdated data. I already have command...
6
by: Salad | last post by:
I'm going to implement an archival database for my app. I have Table1 and Table2. Table2 is a duplicate structure of Table1. I appended records with "ID between 1 and 100", then "ID between 300...
3
nurikoAnna
by: nurikoAnna | last post by:
how to data archiving? I need you help I have no idea how to start coding data archiving . Please help
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.