All we need is an easy explanation of the problem, so here it is.
I’ve followed this simple guide and I was able to install DB2 on Docker.
I now would like to import a sample database to play with.
So I open IBM Data Studio, I right click on the instance > New database… , I fill up with my user name and password but then an error appears:
The system cannot verify the instance that you specified. Either enter
a valid instance name or click on the button next to the Instance name
field and select one from the list.
com.ibm.datatools.adm.explorer.ui.model.InstanceException: An internal
error occurred during: "Verifying instance db2inst1 in system
192.168.1.44.".
If I expand the error for more details I see:
‘Verifying instance db2inst1 in system 192.168.1.44.’ has encountered
a problem.An internal error occurred during: "Verifying instance db2inst1 in
system 192.168.1.44.".An internal error occurred during: "Verifying instance db2inst1 in
system 192.168.1.44.".com.ibm.db2.das.core.DasMessageIdentifier (initialization failure)
A dive in the official documentation brings me to this solution but I don’t think that could be the problem.
What intrigues me is the ‘dot’ (.
) after the IP address. Could this be the error?
Or is there any other way to import a sample database from IBM Data Studio?
How to solve :
I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.
Method 1
The easiest way to create a sample database is to login to the container:
~]$ docker exec -ti mydb2 bash -c "su - db2inst1"
Once inside the container:
[[email protected] ~]$ db2sampl
Creating database "SAMPLE"...
Connecting to database "SAMPLE"...
Creating tables and data in schema "DB2INST1"...
Creating tables with XML columns and XML data in schema "DB2INST1"...
'db2sampl' processing complete.
[[email protected] ~]$ db2 list db directory
System Database Directory
Number of entries in the directory = 1
Database 1 entry:
Database alias = SAMPLE
Database name = SAMPLE
Local database directory = /database/data
Database release level = 15.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
If you don’t want to use the sample database provided via db2sampl, you can create a database as part of the start of the container via -e DBNAME=MYSAMPLE
:
docker run -itd --name mydb2 --privileged=true -p 50000:50000 -e LICENSE=accept -e DB2INST1_PASSWORD=whatever ibmcom/db2 -e DBNAME=MYSAMPLE
Now you can try to connect to that database from data studio, setup your tables and inserting data.
Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0