Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746

    Unanswered: Can I do a "POC" of db2inidb without a SAN?

    This year we want to start making "snapshots" of our database and creating clones. We do not have a LAB/SAN environment at our disposal so I tried to emulate the procedure on my desktop PC (windows XP) with express-C v9.7.2.

    It does not work and I do not understand why. Can you take a look a my scripts please?
    at 1st I run this:
    Code:
    Rem POC clone proces
    Rem ---
    Rem --------------------- 1st database X=SOURCE
    Rem ---
    mkdir           c:\db2\CloneX\dat
    mkdir           c:\db2\CloneX\log
    db2 "drop    database  CloneX"
    del             c:\db2\CloneX\*.* /s /q
    db2 "create  database  CloneX automatic storage yes  on 'c:\db2\CloneX\dat' dbpath on 'C:\'"
    db2 "update db cfg for CloneX using NEWLOGPATH           c:\db2\CloneX\log
    db2stop force
    db2start
    db2 "connect to        CloneX
    db2 "select substr(type,1,32) , substr(path,1,64)  from sysibmadm.dbpaths"
    db2 "create table  tabelletje (tabelletje# int not null generated always as identity primary key , klom char(8) , crea_ts timestamp not null default current_timestamp , upd_ts timestamp not null generated always for each row on update as row change timestamp)"
    db2 "insert into   tabelletje (klom) values ('pim') , ('pam') , ('pet')"
    db2 "select * from tabelletje"
    db2 "connect reset"
    Rem ---
    Rem --------------------- 2nd database Y=TARGET
    Rem ---
    mkdir           c:\db2\CloneY\dat
    mkdir           c:\db2\CloneY\log
    db2 "drop    database  CloneY"
    del             c:\db2\CloneY\*.* /s /q
    db2 "create  database  CloneY automatic storage yes on 'c:\db2\CloneY\dat' dbpath on 'C:\'"
    db2 "update db cfg for CloneY using NEWLOGPATH          c:\db2\CloneY\log
    db2stop force
    db2start
    db2 "connect to        CloneY
    db2 "select substr(type,1,32) , substr(path,1,64)  from sysibmadm.dbpaths"
    db2 "connect reset"
    that goes well and I run this:
    Code:
    Rem POC ==> Clone proces
    Rem ---
    del      c:\db2\CloneY\*.* /s /q
    db2 "connect to CloneX"
    db2 "set write suspend for database"
    c:\Utils\robocopy  c:\db2\CloneX\ c:\db2\CloneY\ /E
    db2 "set write resume for database"
    db2 "connect reset"
    Rem ---
    db2inidb        CloneX as snapshot relocate using snaPOC.txt
    I use this file
    Code:
    DB_NAME=CloneX,CloneY
    DB_PATH=C:\,C:\
    INSTANCE=db2,db2 
    LOG_DIR=c:\db2\CloneX\log,\c:\db2\CloneY\log 
    CONT_PATH=c:\db2\CloneX\dat,\c:\db2\CloneY\dat
    The error I get is this
    Code:
    Relocating database...
    SQL10007N  Message "2139" could not be retrieved.  Reason code: "4".
    Unable to relocate database, cannot continue.
    db2diag does not report anything

    I am trying to emulate the SAN/snapshot as much as possible. any ideas?

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    i don't think db2inidb is a problem ... prob relocatedb

    db path and db instance - if it does not change, you do not have to repeat ...

    in contpath and logdir, why do you have a backslash before c:

    \c

    try correcting this
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    Quote Originally Posted by sathyaram_s View Post
    db path and db instance - if it does not change, you do not have to repeat ...
    Code:
    Relocating database...
    DBT1018N  "INSTANCE" is a required field in the configuration file.
    Unable to relocate database, cannot continue.
    Thanks for pointing out that typo to me.

  4. #4
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    I will answer my own question: YES you can. Sathyaram pointed out the typo for me and my scripts work. In this limited configuration the db2inidb renames the old original database, but in a real world with separate servers and genuine SAN this will not happen.
    Thank you again Sathyaram.

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Quote Originally Posted by dr_te_z View Post
    Code:
    Relocating database...
    DBT1018N  "INSTANCE" is a required field in the configuration file.
    Unable to relocate database, cannot continue.
    Thanks for pointing out that typo to me.
    To clarify, what I meant was :

    DB_NAME=CloneX,CloneY
    DB_PATH=C:\
    INSTANCE=db2

    Yes, these are mandatory fields. But, if you do not provide the second value, it is assumed they are not changing. (as above)

    HTH

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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