Dmitry_Bond
asked on
DB2 - is it possible to create database on remote node?
Hi.
Our installer is run shell scripts with following commands:
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.
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
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.
ASKER
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.
Because it is technically impossible to execute the "Connect to {database on the desired server}" if database is not exists.
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.
You don't need to actually use a database on the server, just connect to something that's on the instance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The CREATE DB syntax is different for DB2 8 and 9.x
Hi Dmitry,
Can you post what you found? It could be helpful to others.
Thanks,
Kent
Can you post what you found? It could be helpful to others.
Thanks,
Kent
ASKER
It is already posted in one of messages:
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.
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
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.
Cool. Thanks.
I wasn't sure that that was your final solution.
Kent
I wasn't sure that that was your final solution.
Kent
ASKER
Actually I found solution by myself. But guys a bit helped me with comments.
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