Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DB2 - is it possible to create database on remote node?

Posted on 2013-01-11
10
Medium Priority
?
776 Views
Last Modified: 2013-01-22
Hi.

Our installer is run shell scripts with following commands:

DB2 CREATE DATABASE %DbName% ON %DbDisk% USING CODESET UTF-8 TERRITORY US 
DB2 CONNECT TO %DbName% USER %DbUser% USING %DbPassword% 

DB2 CREATE BUFFERPOOL BufferR2010 ALL NODES SIZE 200 PAGESIZE 8192 

DB2 CREATE REGULAR TABLESPACE REMxxx PAGESIZE 8192 MANAGED BY SYSTEM USING ('C:\db2\RemXxx\') EXTENTSIZE 256 PREFETCHSIZE 32 BUFFERPOOL BufferR2010 

Open in new window


And that works fine when DB2 Server is installed on the same compute where we installing our product.

But now we got a new life-pushed requirement - we need to create DB2 database on remote node (not on the current computer!).

Do you know - if that is possible at all?

Note: target DB2 versions are 9.x and 10.x.

Please also note: I had already tried approach described here - it does not work. It is able to catalog node, attach node - that is works ok, but the "create database xxx" command is always creating database on local node (not on the remote/attached one). :-\

Regards,
Dmitry.
0
Comment
Question by:Dmitry_Bond
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 38766878
Hi Dmitry,

You should be able to create the database as long as you create a connection to the instance first.

Using the Command Line Interface,:

db2
db2> Connect to {database on the desired server}
db2> Create database command
db2>quit

That should do the trick.


Good Luck,
Kent
0
 

Author Comment

by:Dmitry_Bond
ID: 38766902
No, for sure that will not work!
Because it is technically impossible to execute the "Connect to {database on the desired server}" if database is not exists.
0
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 38766909
Does any database on that server exist?

You don't need to actually use a database on the server, just connect to something that's on the instance.
0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 

Accepted Solution

by:
Dmitry_Bond earned 0 total points
ID: 38767047
Databases may exists but when software installed we do not know anything about such databases.

Hm... I just tried this variant:
db2 catalog tcpip node %DbNodeName% remote %DbNodeAddress% server 50000
db2 terminate
db2 list node directory 
db2 attach to %DbNodeName% user %dbUser% using %dbPassword%
db2 create database remtDb 

Open in new window


Seems it works but only with DB2 9.x or higher.
With DB2 v8.x it is reporting "SQL0901N  The SQL statement or command failed because of a database system error. (Reason "CREATE DATABASE w/ DB options requires V9.1 server or later".) SQLSTATE=58004"

Hm... need to re-test it for DB2 v8.x and v10.x.
Seems for 8.x it is not working anyway. :-\
0
 
LVL 46

Assisted Solution

by:Kent Olsen
Kent Olsen earned 1500 total points
ID: 38767258
Hi Dmitry,

The differences between version 8 and 9 are significant.  It's very believable that this doesn't work for V8, but it has been long enough that I don't remember.

V8 has been out of support for nearly 4 years.  Are there plans to upgrade that server to a newer release of DB2?


Kent
0
 
LVL 8

Expert Comment

by:mustaccio
ID: 38767615
The CREATE DB syntax is different for DB2 8 and 9.x
0
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 38787554
Hi Dmitry,

Can you post what you found?  It could be helpful to others.


Thanks,
Kent
0
 

Author Comment

by:Dmitry_Bond
ID: 38787597
It is already posted in one of messages:
db2 catalog tcpip node %DbNodeName% remote %DbNodeAddress% server 50000
db2 terminate
db2 list node directory 
db2 attach to %DbNodeName% user %dbUser% using %dbPassword%
db2 create database remtDb 

Open in new window


And - for DB2 v8 it does not work. It works only for DB2 v9 or higher.
One of databases I was tried to do was DB2 v8.x, so that is why this question appears at all.
0
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 38787618
Cool.  Thanks.

I wasn't sure that that was your final solution.


Kent
0
 

Author Closing Comment

by:Dmitry_Bond
ID: 38804756
Actually I found solution by myself. But guys a bit helped me with comments.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question