Db2 – creating 2 database at the same time in db2

db2linux

Do you know whether it is safe to have in one shell user db2inst1 creating a database A and having another shell the same user creating at the same time database B?

create database A # shell 1
create database B # shell 2

I am using Linux/ Cent os with DB2 V 9.7 installed.

Best Answer

I'm also not quite sure why you are posting this without just attempting it, but yes, this will work without problem.

The only issues you might have are:

  1. If the NUMDB database manager configuration parameter is small enough that you can't activate both databases at the same time (in addition to whatever other databases are activated within the DB2 instance).

  2. If you use the AUTOCONFIGURE option for CREATE DATABASE with some silly default values so you exhaust system memory

  3. System resource contention (disk, CPU) slowing the process down.

This is really an odd question – it's hard to image a scenario where you would need to create multiple databases simultaneously. Are you coming from a different DBMS (like MySQL or SQL Server), where the concept of a database is more like a schema in DB2?