DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
scottopizza



Group memberships:
Premium Members

Joined: 05 Feb 2002
Posts: 46

Points: 436

Post Posted: Thu Oct 12, 2006 1:47 pm Reply with quote    Back to top    

DataStage® Release: 7x
Job Type: Server
OS: Windows
Greetings.

I'm trying to move KeyMgtGetNextValue() values from one server to another. So, for a start I would like to at least list all of the values. I found a thread titled, "Handling KeyMgtGetNextValue() while moving machines" that has the answer I'm looking for. But I think I need a little extra help. Here is the solution that Craig Hulett posted:
<< If you look at the source for the routine in question, you can see that it uses a Hash file called "SDKSequences". In the absense of some back-door Universe methodology for transferring the contents from one Project to another, I would think it would be fairly straight-forward to write two DataStage jobs - one to dump its contents to a flat file and then another to populate it from that flat file after you transfer it to the new server.
I'd run KeyMgtGetNextValue once on your new machine so that it can create it with the specs it wants, either that or make you create it using the same command as in the source code:
Code:
EXECUTE "CREATE.FILE SDKSequences 2 1 1"
FYI - This is from a Version 6 server.>>

I tried to find this hashed file and found the name at "E:\Ascential\DataStage\Projects\PROD\SDKSequences", but it doesn't look like a normal hashed file to me. Am I missing something. A little extra hint would be appreciated.

Thanks,

Scott

_________________
dsdev750


since May 2006

Group memberships:
Premium Members

Joined: 04 Jun 2005
Posts: 16

Points: 128

Post Posted: Thu Oct 12, 2006 2:02 pm Reply with quote    Back to top    

As Craig pointed out:

1. Create first job ( on the existing server )

Hash --> Xfm --> Seq
(SDKSequences)
Have two columns defined in the hash file e.g.:
ID VARCHAR(10),
VALUE INTEGER(10)

Run this job. Transfer the seq file to the 2nd server.

2. Create a 2nd job ( on the new server )

Seq --> Xfm --> Hash

Read the Seq file created in step 1 and write to the SDK Sequences file.

The easiest way to create an SDKSequences file is to test the routine KeyMgtGetNextValue which will create the file, if it does not exist already.
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 40572
Location: Melbourne, Australia
Points: 226407

Post Posted: Thu Oct 12, 2006 2:12 pm Reply with quote    Back to top    

I'd use a longer VarChar for the ID column; possibly VarChar(254) to be on the safe side.

_________________
Zenith Solutions (Australia) Pty Ltd
-- from obscurity to clarity
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 28418
Location: Denver, CO
Points: 146801

Post Posted: Thu Oct 12, 2006 3:11 pm Reply with quote    Back to top    

scottopizza wrote: EXECUTE "CREATE.FILE SDKSequences 2 1 1" FYI - This is from a Version 6 server.>> I tried to find this hashed file and found the name at "E:\Ascential\DataStage\Pr ...

_________________
-craig

Sarchasm: The gulf between the author of sarcastic wit and the person who just doesn't get it.
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 40572
Location: Melbourne, Australia
Points: 226407

Post Posted: Thu Oct 12, 2006 3:14 pm Reply with quote    Back to top    

It can be dynamic (Type 30), but is created as Type 2 by the function. Type 18 would probably be a better choice once modulo exceeds 1.

_________________
Zenith Solutions (Australia) Pty Ltd
-- from obscurity to clarity
Rate this response:  
Not yet rated
kduke

Premium Poster


since February 2006

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 29 May 2003
Posts: 4628
Location: Dallas, TX
Points: 30879

Post Posted: Thu Oct 12, 2006 3:29 pm Reply with quote    Back to top    

Hashed files should not be considered persistent meaning these values should be recreated every job run.

Select max(surrogate_key) from dimension_table -> SDKSequences

This is a job included in EtlStats called reseed_sequences. The surrogate_key is a parameter and so is the table name so the SQL looks a little different because of the # marks. Download EltStats and load his job it will save you some time. Most tables the surrogate key is a primary index so this is very fast to run.

_________________
Uncle Kim

EtlStats take adapt shine.
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 40572
Location: Melbourne, Australia
Points: 226407

Post Posted: Thu Oct 12, 2006 4:51 pm Reply with quote    Back to top    

There have been a number of posts on resetting sequences, this one for example provides a function that can be used.

_________________
Zenith Solutions (Australia) Pty Ltd
-- from obscurity to clarity
Rate this response:  
Not yet rated
scottopizza



Group memberships:
Premium Members

Joined: 05 Feb 2002
Posts: 46

Points: 436

Post Posted: Fri Oct 13, 2006 12:49 pm Reply with quote    Back to top    

Wonderful! Thanks for filling in the details I was missing. Thanks also to Kim for the code sample. - Scott

_________________
Rate this response:  
Not yet rated
kduke

Premium Poster


since February 2006

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 29 May 2003
Posts: 4628
Location: Dallas, TX
Points: 30879

Post Posted: Fri Oct 13, 2006 1:52 pm Reply with quote    Back to top    

You are welcome.

_________________
Uncle Kim

EtlStats take adapt shine.
Rate this response:  
Not yet rated
kduke

Premium Poster


since February 2006

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 29 May 2003
Posts: 4628
Location: Dallas, TX
Points: 30879

Post Posted: Fri Oct 13, 2006 1:53 pm Reply with quote    Back to top    

You are welcome.

_________________
Uncle Kim

EtlStats take adapt shine.
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 40572
Location: Melbourne, Australia
Points: 226407

Post Posted: Fri Oct 13, 2006 3:30 pm Reply with quote    Back to top    

kduke wrote:
Hashed files should not be considered persistent meaning these values should be recreated every job run.

...except, of course, for the Repository tables and SDKSequences.

_________________
Zenith Solutions (Australia) Pty Ltd
-- from obscurity to clarity
Rate this response:  
Not yet rated
sylvan_rydes
Participant



Joined: 12 Apr 2006
Posts: 47

Points: 349

Post Posted: Mon Jan 22, 2007 4:36 pm Reply with quote    Back to top    

Hi All,

I have something common with this. How can I update my oracle sequence number within datastage for a table following that I have used keymgtngetextvalue function.

Thanks in advance.

Sylvan.

_________________
sylvan rydes
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 40572
Location: Melbourne, Australia
Points: 226407

Post Posted: Mon Jan 22, 2007 8:20 pm Reply with quote    Back to top    

The same way you'd reset a sequence from any other client application. Perhaps use the "after SQL" in a job that does something else or, better, in a job that does nothing else. Then you can cal ...

_________________
Zenith Solutions (Australia) Pty Ltd
-- from obscurity to clarity
Rate this response:  
sylvan_rydes
Participant



Joined: 12 Apr 2006
Posts: 47

Points: 349

Post Posted: Tue Jan 23, 2007 3:14 pm Reply with quote    Back to top    

Hi Ray,

Thanks a lot for the reply. It worked well.

Thanks again.

Sylvan

_________________
sylvan rydes
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours