IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

A typical scenario of usage of CLONE table.


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Thu Feb 10, 2011 1:06 pm
Reply with quote

I know the attributes of clone table and how it works, but I cannot find a typical scenario of usage of CLONE table.
Can you experts provide me one?
when and under what circustances should CLONE tables be used?
How will CLONE tables provide us benefits?

Thanks.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Feb 10, 2011 1:25 pm
Reply with quote

1) Online processes fill a table, batch process empties it.
2) Information wharehouse tables are prepared/filled in clones.
during this process IW is still up
when the whole IW is ready, switch is made
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Fri Feb 11, 2011 8:52 am
Reply with quote

GuyC wrote:
1) Online processes fill a table, batch process empties it.
2) Information wharehouse tables are prepared/filled in clones.
during this process IW is still up
when the whole IW is ready, switch is made


Thanks, GuyC,

Is there a IBM article exaustively explaining these scenarios?
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Feb 11, 2011 1:39 pm
Reply with quote

This briefly describes it : it.toolbox.com/blogs/db2zos/the-clones-are-coming-the-clones-are-coming-with-db2-9-15271
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sat Feb 12, 2011 8:26 am
Reply with quote

Thanks, GuyC,
Although the link you provided is just a brief introduction to Clone table, which can be found in IBM redbooks, thanks all the same.

One question:
It is mentioned in the link that:
<blockquote>While you are accessing the base table, the clone can be loaded with new data. When the clone is ready, it has all the data you intend to load loaded, the base table and clone table are switch. The new SQL EXCHANGE statement is used to force the switch. Once the EXCHANGE completes, all references are now to the clone, which is now actually the real table. </blockquote>

I want to ask, if you UPDATED the base table before the SQL EXCHANGE, what will be the result? Will the UPDATED data exist both in the clone table and base table after the execution of SQL EXCHANGE&#65311;&#65311;&#65311;
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Feb 14, 2011 2:25 pm
Reply with quote

no data that is inserted/loaded is only in clone table.
after exchange the clone is the base and the base becomes the clone. so that data exists in the base and not in the clone.
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Mon Feb 14, 2011 5:19 pm
Reply with quote

then, how to keep sync between base table and clone table?
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Feb 14, 2011 6:53 pm
Reply with quote

You don't. That's not what they are for.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Feb 15, 2011 12:52 am
Reply with quote

Hello,

This sounds like another solution (clone table) in search of a requirement.

What do you need to do? If you explain what requirement you are tyring to accomplish, someone will probably be able to provide some alternatives.
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Tue Feb 15, 2011 6:00 am
Reply with quote

I mean, if there is no sync relationship between base table and clone table, "CLONE" just provides convenience no more than existing function called "INCURSOR LOAD", which should not be the fact, I suppose.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Feb 15, 2011 7:59 am
Reply with quote

Hello,

If you have no actual requirement, your time will be better spent elsewhere. . .

Is there no "real work" to be done icon_confused.gif

d
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Tue Feb 15, 2011 2:02 pm
Reply with quote

I just want to prepare for urgent requirement...
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Tue Feb 15, 2011 2:20 pm
Reply with quote

I guess you didn't have to deal with many locking problems.
or with a set of tables establishing a consistent whole.

Loading a set of tables can be a lengthy process, exchanging clones isn't.

Cloning doesn't supply new functional solutions, only other ways to do the same faster and with better availability.
fe. There are sites which have views on one table that they change to another table and back. Cloning can do the same, but without invalidating packages.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Feb 15, 2011 8:29 pm
Reply with quote

Hello,

Quote:
I just want to prepare for urgent requirement...
Then post the requirement. . .

I have not yet seen a crisis situation where the resolution was to "send in the clones". . .
Back to top
View user's profile Send private message
singhju

New User


Joined: 01 Dec 2010
Posts: 25
Location: Gurgaon

PostPosted: Wed Feb 16, 2011 1:35 pm
Reply with quote

Hi,

Quote:
I know the attributes of clone table and how it works, but I cannot find a typical scenario of usage of CLONE table.
Can you experts provide me one?
when and under what circustances should CLONE tables be used?
How will CLONE tables provide us benefits?



I am working in a Banking application where during night batch we have to prepare the balances of the accounts for the next business day in files. Then we take an outage on the database and load the prepared data from files to corresponding tables.

So here we can use these clone tables. Without taking outage, we can load the clone table and then can switch it as base table. So we can make our application truely 24x7. However, we are not planning anything as such but I was just trying to give example for the usage of Clone table.
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Wed Feb 16, 2011 1:48 pm
Reply with quote

I'm thinking of below question:

What if base table changes need to be applied to clone table?
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Feb 16, 2011 2:14 pm
Reply with quote

again : not what clones is about.

Clones are not copies, they are identical structures !

If you're looking for replication or mirroring solutions, do not look at clones.
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Wed Feb 16, 2011 2:19 pm
Reply with quote

Sorry, my mistake...
Thanks. GuyC
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Feb 16, 2011 2:38 pm
Reply with quote

np, you're not the only one that makes it. I had to tell this to several people, that's why I come over short.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top