Results 1 to 13 of 13
  1. #1
    Join Date
    Sep 2008
    Posts
    8

    Unanswered: DB21034E - script generated by db2look failed to create tables.

    Hi,

    I'm new to db2 and am having some problem in migrating databases from linux to window using the db2look and db2move utilities.

    Platform:
    Migrating from CentOS 5 to Windows 2003.

    ************************************************** *************

    DB2 on CentOS:
    [db2inst1@psgdb2 root]$ db2level
    DB21085I Instance "db2inst1" uses "32" bits and DB2 code release "SQL08020"
    with level identifier "03010106".
    Informational tokens are "DB2 v8.1.0.64", "s040812", "MI00086", and FixPak "7".

    Product Name = "DB2 Enterprise Server Edition"
    Product Identifier = "DB2ESE"
    Version Information = "8.2"

    ************************************************** *************

    DB2 on Windows:
    DB21085I Instance "DB2INST1" uses "32" bits and DB2 code release "SQL08020"
    with level identifier "03010106".
    Informational tokens are "DB2 v8.1.7.445", "s040812", "WR21342", and FixPak
    "7".

    Product Name = "DB2 Enterprise Server Edition"
    Product Identifier = "DB2ESE"
    Version Information = "8.2"

    ************************************************** *************

    Problem:
    When I ran the script generated by db2look on windows, the following errors appeared and no tables were created at all.

    Excerpt from the output upon running the script:
    .
    .
    .
    CREATE TABLE "DB2INST1"."RQREQUIREMENTHISTORY" ( "ID" DECIMAL(10,0) NOT NULL WITH DEFAULT 0 , "VERSIONNUMBER" VARCHAR(50) NOT NULL , "VERSIONLABEL" VARCHAR(255) , "VERSIONUSERID" DECIMAL(10,0) NOT NULL WITH DEFAULT 0 , "VERSIONDATETIME" TIMESTAMP NOT NULL WITH DEFAULT , "VERSIONREASON" VARCHAR(1000) , "OVERFLOWIND" DECIMAL(1,0) NOT NULL WITH DEFAULT 0 ) IN "DB2INST1_LDATA" INDEX IN "DB2INST1_INDEX"

    DB21034E The command was processed as an SQL statement because it was not a

    valid Command Line Processor command. During SQL processing it returned:

    SQL0204N "DB2INST1_LDATA" is an undefined name. SQLSTATE=42704



    ALTER TABLE "DB2INST1"."RQREQUIREMENTHISTORY" PCTFREE 10

    DB21034E The command was processed as an SQL statement because it was not a

    valid Command Line Processor command. During SQL processing it returned:

    SQL0204N "DB2INST1.RQREQUIREMENTHISTORY" is an undefined name.

    SQLSTATE=42704

    .
    .
    .

    All entries followed by the same error. I have 5 databases to be migrated altogether, and so far I have migrated 3 of them (there are some warnings listed though. I'm facing this problem with the 4th and 5th database.

    I have tried googling for solution but to no avail.

    Appreciate for any assistance offered.

    Thanks in advance.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Check your termination characters in the script. If there are any stored procedures or functions, you will need to generate the db2look with a different termination command than ";" such as "@" and use the "db2 -td@ -vf <file-name>" syntax.

    Also, if the db2look creates any tablespaces, you will have to change the path to a windows path name. If the table create statements reference a tablespace, then that tablespace must exist.

    I think you are making a big mistake by migrated to PF7, you should use FP16. FP7 was the first release of 8.2 and has a lot of bugs.
    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
    Sep 2008
    Posts
    8
    Hi,

    Thanks for your fast reply.

    I will try with your suggestion and will update on how it turns out.

    Uhmm.. after I migrate the databases from linux to windows, am planning to upgrade it to v9.5. Am I doing it with the wrong/not-recommended sequence of steps?

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,
    just to test out the script delete "IN "DB2INST1_LDATA" INDEX IN "DB2INST1_INDEX" from first command and DB2 will create table in default tablespace. Then contact the person that created tablespaces on CentOS computer to find out the reason of creation...
    Regards,
    Grofaty

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Quote Originally Posted by 60doses
    Hi,

    Thanks for your fast reply.

    I will try with your suggestion and will update on how it turns out.

    Uhmm.. after I migrate the databases from linux to windows, am planning to upgrade it to v9.5. Am I doing it with the wrong/not-recommended sequence of steps?
    Yes, since you are using db2look (and I assume db2move or export/import) then you should go straight to V9.5 FP2. Make sure the same tablespaces exist in the target database. There is a special option to get tablespace DDL in the db2look output.
    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
    Sep 2008
    Posts
    8
    Grofaty, Marcus_A,

    Thanks for all the suggestions

    Gonna generate back the script and hopefully this time it'll work.

  7. #7
    Join Date
    Sep 2008
    Posts
    8
    I don't see anything like a stored procedures nor functions in the script, but anyways, I tried the following:

    db2look -d mydb -e -a -l -td @ -o mydbout.sql

    Unfortunately the same error occured

    I came across to this link http://www-01.ibm.com/support/docvie...id=swg1LI71281 , am not sure if it's relevant, so do you think it'll be a good idea for me to upgrade it to FP16 first? But if I were to upgrade it, I'll have to do the same with the original db2 on linux, right? Or can db2look/db2move work across different db2 versions?

    TIA.

  8. #8
    Join Date
    Sep 2008
    Posts
    8
    Update: I've patched with FP16 (db2 on windows), and it's still not working.

  9. #9
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    It would help if you posted the exact command you used to run the DDL, and attached the DDL file, and attached the output of the command.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  10. #10
    Join Date
    Sep 2008
    Posts
    8
    Sorry for the late reply. I was already at home by the time I read your post last night.

    The command that I used to create the DDL is:

    db2look -d rpdb -e -a -l -td @ -o rpdblat.sql

    The command that I used to run the DDL is:

    db2 -td@ -vf rpdblat.sql

    I have attached the DDL file <rpdblatsql.txt> and the output as well <rpdbout.txt>

    Thanks a lot for your help.
    Attached Files Attached Files

  11. #11
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    The first error message (other than the ones that say the object being created already exists) is "Bad container path" when trying to create the tablespaces.

    I specifically menitoned in my post above that: "you will have to change the path to a windows path name."

    A Windows path name contains a drive letter and does not accept forward slashes (backward slashes only). If you don't understand the difference between a Linux path name and a Windows path name, then you need to get someone to help you with this.

    In the future, start looking for errors at the top of your script and work your way down. If the tablespaces don't get created, then the tables that reference the tablespaces will not get created.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  12. #12
    Join Date
    Sep 2008
    Posts
    8
    oh erms

    my bad

  13. #13
    Join Date
    Sep 2008
    Posts
    8
    Thanks. It worked

    Blame myself for not checking the error properly. Should've noticed the 'path' when you pointed it out in the first place.

    Thanks again.

Posting Permissions

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