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?