DB2 Create DB 命令结果 SQL1005N 数据库目录或系统数据库目录已存在

DB2 Create DB command results in SQL1005N database directory or system database directory already exists

我全新安装了 Windows 10 和 DB2 v10.5 FP 7。

我正在尝试创建一个简单的数据库并不断收到 SQL1005N 错误。这是一个新安装,因此没有现有的数据库:

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.

如您所见,无论我选择什么数据库名称,我总是会遇到同样的错误。数据库已创建:

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:
...

但是我连接不上:

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

关于我遗漏了什么有什么想法吗?

显然我需要 运行 命令:

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

这完全创建了数据库并允许我连接到它并使用它。

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

当然要启动了:

ACTIVATE DATABASE DEMODB

db2 使用“db2 catalog db SAMPLE on <path>

对数据库进行编目
db2 terminate
db2 drop database SAMPLE

运行再次恢复命令。