| Author |
Message |
scottopizza

Group memberships: Premium Members
Joined: 05 Feb 2002
Posts: 46
Points: 436
|
|
| 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
|
|
|
|
|
|
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.
|
|
|
|
|
 |
ray.wurlod
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
|
|
|
|
|
|
|
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
|
|
|
|
 |
chulett
 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
|
|
|
|
|
|
|
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. |
|
|
|
 |
ray.wurlod
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
|
|
|
|
|
|
|
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
|
|
|
|
 |
kduke
 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
|
|
|
|
|
|
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. |
|
|
|
 |
ray.wurlod
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
|
|
|
|
|
|
|
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
|
|
|
|
 |
scottopizza

Group memberships: Premium Members
Joined: 05 Feb 2002
Posts: 46
Points: 436
|
|
|
|
|
|
|
Wonderful! Thanks for filling in the details I was missing. Thanks also to Kim for the code sample. - Scott
|
_________________ |
|
|
|
 |
kduke
 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
|
|
|
|
|
|
|
You are welcome.
|
_________________ Uncle Kim
EtlStats take adapt shine. |
|
|
|
 |
kduke
 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
|
|
|
|
|
|
|
You are welcome.
|
_________________ Uncle Kim
EtlStats take adapt shine. |
|
|
|
 |
ray.wurlod
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
|
|
|
|
|
|
| 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
|
|
|
|
 |
sylvan_rydes
Participant
Joined: 12 Apr 2006
Posts: 47
Points: 349
|
|
|
|
|
|
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 |
|
|
|
 |
ray.wurlod
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
|
|
|
|
|
|
|
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
|
|
|
|
 |
sylvan_rydes
Participant
Joined: 12 Apr 2006
Posts: 47
Points: 349
|
|
|
|
|
|
Hi Ray,
Thanks a lot for the reply. It worked well.
Thanks again.
Sylvan
|
_________________ sylvan rydes |
|
|
|
 |
|
|