Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2007
    Posts
    72

    Unanswered: 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

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  3. #3
    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

  4. #4
    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

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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

  6. #6
    Join Date
    Mar 2007
    Posts
    72
    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

  7. #7
    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"

  8. #8
    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...

  9. #9
    Join Date
    Mar 2007
    Posts
    72
    I printed 10,10 and still did not find PGSOB string. When I printed it, I did a find on PGSOB.

  10. #10
    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 ?

  11. #11
    Join Date
    Mar 2007
    Posts
    72
    Got it!

    Thanks a bunch....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •