0

I have a fresh install of Windows 10 and DB2 v10.5 FP 7.

I am trying to create a simple DB and keep gettings a SQL1005N error. This is a new install and so there are no existing DBs:

db2 => list node directory

Node Directory

Number of entries in the directory = 1

Node 1 entry:

Node name                      = DEVWIN10
Comment                        =
Directory entry type           = LOCAL
Protocol                       = TCPIP
Hostname                       = 192.168.1.14
Service name                   = 50000

db2 => list db directory
SQL1057W  The system database directory is empty.  SQLSTATE=01606

db2 => attach to devwin10 user db2admin using <PASSWORD>
Instance Attachment Information

Instance server        = DB2/NT64 10.5.7
Authorization ID       = DB2ADMIN
Local instance alias   = DEVWIN10

db2 => CREATE DATABASE DEMO
SQL1005N  The database alias "DEMO" already exists in either the local database directory or system database directory.

db2 => CREATE DATABASE DEMODB
SQL1005N  The database alias "DEMODB" already exists in either the local database directory or system database directory.

db2 => CREATE DATABASE ANTHONY
SQL1005N  The database alias "ANTHONY" already exists in either the local database directory or system database directory.

db2 => CREATE DATABASE BLAH
SQL1005N  The database alias "BLAH" already exists in either the local database directory or system database directory.

As you can see it doesn't matter what DB name I choose, I always get the same error. The DB is created:

db2 => list db directory

System Database Directory

Number of entries in the directory = 4

Database 1 entry:

Database alias                       = ANTHONY
Database name                        = ANTHONY
Local database directory             = C:
Database release level               = 10.00
Comment                              =
Directory entry type                 = Indirect
Catalog database partition number    = 0
Alternate server hostname            =
Alternate server port number         =

Database 2 entry:
...
Database 3 entry:
...
Database 4 entry:
...

But I can't connect to it:

db2 => connect to BLAH user db2admin using <PASSWORD>
SQL1035N  The operation failed because the specified database cannot be connected to in the mode requested.  SQLSTATE=57019

db2 => connect to ANTHONY user db2admin using <PASSWORD>
SQL1035N  The operation failed because the specified database cannot be connected to in the mode requested.  SQLSTATE=57019

db2 => connect to DEMO user db2admin using <PASSWORD>
SQL1035N  The operation failed because the specified database cannot be connected to in the mode requested.  SQLSTATE=57019

db2 => connect to DEMODB user db2admin using <PASSWORD>
SQL1035N  The operation failed because the specified database cannot be connected to in the mode requested.  SQLSTATE=57019

Any thoughts as to what I'm missing?

2 Answers 2

1

Well apparently I need to run the command:

CREATE DATABASE DEMODB AUTOMATIC STORAGE YES ON 'C:\' DBPATH ON 'C:\' 

This fully creates the DB and allows me to connect to it and use it.

db2 => CONNECT TO DEMODB USER DB2ADMIN USING <PASSWORD>

Database Connection Information

Database server        = DB2/NT64 10.5.7
SQL authorization ID   = DB2ADMIN
Local database alias   = DEMODB

Of course it needs to be started:

ACTIVATE DATABASE DEMODB
Sign up to request clarification or add additional context in comments.

Comments

0

db2 catalog the database using "db2 catalog db SAMPLE on <path>"

db2 terminate
db2 drop database SAMPLE

Run the restore command again.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.