If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Can a flat dataset from a DSN1COPY run be used to Load a DB2 table? and other questio

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-09-07, 20:11
pagwu pagwu is offline
Registered User
 
Join Date: Mar 2007
Posts: 70
Can a flat dataset from a DSN1COPY run be used to Load a DB2 table? and other questio

Hello all,

I have a question about loading DB2. I ran a DSN1COPY against a imagecopy of 1 tablespace and the output to a flat file instead of the original DB2 VSAM dataset. Can I use this flat file to load a DB2 table that was dropped and recreated? In this shop, not everyone has authority to work directly with the underlying DB2 VSAM datasets for security reasons.

How can one find out from a imagecopy the OBID of the table in that copy?

Can you create a table and assign the new table a specific OBID? e.g 444

Thank you all for your responses
Reply With Quote
  #2 (permalink)  
Old 10-09-07, 21:16
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Yes, you can use the output of DSN1COPY to load an existing table. The original VSAM dataset is actually worthless, even if you could access it.

You can find out the OBID of the original table and the table to be loaded. I forgot how, but do a search or look in the manuals.

Last time I looked, you cannot specify a specific obid when creating a table.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 10-10-07, 02:29
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
Quote:
Originally Posted by pagwu

Can you create a table and assign the new table a specific OBID? e.g 444

Yes, thats possible.

CREATE TABLE ... IN dbname.tsname OBID integer ...

But AFAIK you cannot reuse a value that was previously used by DB2
Reply With Quote
  #4 (permalink)  
Old 10-10-07, 02:57
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
Quote:
Originally Posted by pagwu

How can one find out from a imagecopy the OBID of the table in that copy?

Run a DSN1PRNT on that copy:

// EXEC PGM=DSN1PRNT,PARM='PRINT(2,2),FORMAT,FULLCOPY'
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=your.image.copy

search the output for PGSOBD='####'X , which gives you the hexadecimal value of the table OBID
Reply With Quote
  #5 (permalink)  
Old 10-10-07, 03:09
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by umayer
Yes, thats possible.

CREATE TABLE ... IN dbname.tsname OBID integer ...

But AFAIK you cannot reuse a value that was previously used by DB2
In any event, it does not matter what the obid of the new table is, because you can do an obid translation from old to new when you reload the data.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #6 (permalink)  
Old 10-10-07, 10:06
pagwu pagwu is offline
Registered User
 
Join Date: Mar 2007
Posts: 70
Quote:
Originally Posted by umayer
Run a DSN1PRNT on that copy:

// EXEC PGM=DSN1PRNT,PARM='PRINT(2,2),FORMAT,FULLCOPY'
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=your.image.copy

search the output for PGSOBD='####'X , which gives you the hexadecimal value of the table OBID
Umayer,

I ran dsn1prnt on the imagecopy and a few others but did not find any PGSOBD string. Could it be something else? We are DB2v8 in case it has changed.

Please let me know if you find out. I will research it also.

Thanks
Reply With Quote
  #7 (permalink)  
Old 10-10-07, 11:15
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
do you use segmented or simple tablespaces ?

try to print more pages : e.g. "PRINT(2,5),FORMAT,FULLCOPY"
Reply With Quote
  #8 (permalink)  
Old 10-11-07, 01:45
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
here is a sample output

PAGE: # 00000002 ---------------------------------------------------------------
DATA PAGE: PGCOMB='00'X PGLOGRBA='000000000000'X PGNUM='00000002'X PGFLAGS=''00'X PGFREE=6
PGFREE='0006'X PGFREEP=3636 PGFREEP='0E34'X PGHOLE1='0000'X PGMAXID='E2'X PGNANCH=0
PGTAIL: PGIDFREE='00'X PGEND='E'
ID-MAP FOLLOWS:
01 0014 0024 0034 0044 0054 0064 0074 0084
09 0094 00A4 00B4 00C4 00D4 00E4 00F4 0104
[...]
RECORD: XOFFSET='0014'X PGSFLAGS='00'X PGSLTH=16 PGSLTH='0010'X PGSOBD='0008'X PGSBID='01'X
8006F001 92908000 01F8 ..0...
RECORD: XOFFSET='0024'X PGSFLAGS='00'X PGSLTH=16 PGSLTH='0010'X PGSOBD='0008'X PGSBID='02'X
8006F002 88238000 0384 ..0...
Reply With Quote
  #9 (permalink)  
Old 10-11-07, 14:32
pagwu pagwu is offline
Registered User
 
Join Date: Mar 2007
Posts: 70
I printed 10,10 and still did not find PGSOB string. When I printed it, I did a find on PGSOB.
Reply With Quote
  #10 (permalink)  
Old 10-12-07, 03:33
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
the parameter of PRINT is ( from page , to page ).
So, if you print(10,10) you only print page number 16. ( which is '10'x ).

Try a PRINT(1,10) instead. Did you use the Parameter FORMAT , too ?
Reply With Quote
  #11 (permalink)  
Old 10-12-07, 12:47
pagwu pagwu is offline
Registered User
 
Join Date: Mar 2007
Posts: 70
Got it!

Thanks a bunch....
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On