Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2013
    Posts
    31

    Unanswered: Unable to move database to a different Instance

    I have a database setup in DB2 but I need to move it to an instance DB2TEST. This is on DB2 LUW 9.5.3a Win 2003, and I'm wondering if I didn't setup the DB2TEST Instance correctly.

    Here is my config file:
    DB_NAME=TestDB1
    DB_PATH=E:\TestDB1_Data
    INSTANCE=DB2,DB2TEST

    And I verified this DB_Path is correct from running 'db2 list databasedirectory' plus db2ilist shows both DB2 and DB2TEST instances exist.

    So I change my DB2INSTANCE variable to DB2TEST, run db2cmd, then run this:

    DB2RELOCATEDB -f dbmove.cfg

    And it returns this:

    DBT1006N The file/device "E:\TestDB1_DATA\DB2TEST\NODE0000\SQLDBDIR\SQLDBDI R"
    could not be opened.

    There is no directory called E:\TestDB1_DATA\DB2TEST instead it's E:\TestDB1_DATA\DB2 which maked sence given the current schema is DB2, but do I need to create E:\TestDB1_DATA\DB2TEST? I assumed it would do it for me, but maybe not.

    Also I'm thinking something isn't setup correctly with the Instance because when I open DB2TEST in Control Center I get this error:

    SQL1032N No start database manager command was issued.
    SQLSTATE=57019

    DBA0102W Unable to detect nodetype for instance - "DB2TEST".
    Reason Code: "-1".

    Explanation:

    The start database manager command has not been processed. It must be
    processed before a stop database manager, any SQL statement, or utility
    can be issued.

    The command cannot be processed.

    User response:

    Issue a start database manager command and resubmit the current command.

    If using multiple logical nodes, ensure the DB2NODE environment variable
    is set correctly. The DB2NODE environment variable indicates the node
    the application will attempt to connect to. DB2NODE must be set to the
    node number of one of the nodes defined on the same host as the
    application.

    sqlcode: -1032

    sqlstate: 57019

    Any thoughts? When I run this the DB2INSTANCE env variable is DB2TEST and DB2NODE is 0000. If I remember correctly I just used 'db2icrt DB2TEST' to create the instance, so was something missed?

    Thanks in advance for any suggestions.

  2. #2
    Join Date
    Apr 2012
    Posts
    156
    Couple of questions, are you just interested in changing the instance or are you trying to change the names of the file systems as well? I ask because if you just want to change the instance your database is cataloged on you could just uncatalog the database from instance DB2 and catalog it on instance DB2TEST.

    If for some reason you need/want to use the db2relocatedb, did you try adding the NODENUM=0 to your config? Also, did you try to issue a db2start on instance DB2TEST? What message did you get?

    So your config would be as follows:
    DB_NAME=TestDB1
    DB_PATH=E:\TestDB1_Data
    INSTANCE=DB2,DB2TEST
    NODENUM=0

  3. #3
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,368
    Quote Originally Posted by azready View Post
    if you just want to change the instance your database is cataloged on you could just uncatalog the database from instance DB2 and catalog it on instance DB2TEST.
    Are you sure you can connect to the db after making this change?

Posting Permissions

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