If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Can I do a "POC" of db2inidb without a SAN?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-03-11, 10:43
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
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?
Reply With Quote
  #2 (permalink)  
Old 03-03-11, 16:25
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
  #3 (permalink)  
Old 03-04-11, 01:30
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
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.
Reply With Quote
  #4 (permalink)  
Old 03-04-11, 04:18
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
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.
Reply With Quote
  #5 (permalink)  
Old 03-04-11, 04:41
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On