简体   繁体   English

DB2 Sample Database无法创建

[英]DB2 Sample Database unable to create

  • I tried creating the db2 sample database using both DB2 First Steps GUI option " Create sample database " error: 我尝试使用DB2 First Steps GUI选项“ Create sample database ”错误创建db2示例数据库:

Creating database "SAMPLE" on path "C:"... Existing "SAMPLE" database found... The "-force" option was not specified... Attempt to create the database "SAMPLE" failed 'db2sampl' processing complete. 在路径“C:”上创建数据库“SAMPLE”...找到现有的“SAMPLE”数据库...未指定“-force”选项...尝试创建数据库“SAMPLE”失败'db2sampl'处理完成。


  • When I try the " db2sampl " command on the DB2 CLP, I get this error: 当我在DB2 CLP上尝试“ db2sampl ”命令时,我收到此错误:

Creating database "SAMPLE"... Existing "SAMPLE" database found... The "-force" option was not specified... Attempt to create the database "SAMPLE" failed. 创建数据库“SAMPLE”...找到现有的“SAMPLE”数据库...未指定“-force”选项...尝试创建数据库“SAMPLE”失败。

'db2sampl' processing complete. 'db2sampl'处理完成。


  • Furthermore, I have double checked that my DB2 instance was started with " db2start " which returns: 此外,我已经仔细检查过我的DB2实例是以“ db2start ”启动的,它返回:

SQL1026N The database manager is already active SQL1026N数据库管理器已处于活动状态


which indicates that the instance is indeed started. 表示实例确实已启动。

  • I verified that sample was not created with " db2 list database directory " which returned: 我验证了样本不是用“ db2 list database directory ”创建的,它返回:

SQL1057W The system database directory is empty. SQL1057W系统数据库目录为空。 SQLSTATE=01606 SQLSTATE = 01606


which shows that no databases have been created and discredits the possibility of the DB2 sample database creation failing because an existing one is present. 这表明没有创建任何数据库,并且因为存在现有数据库而导致DB2示例数据库创建失败的可能性失败。

What is causing the sample database to fail? 是什么导致示例数据库失败?

Probably the database was created but uncataloged, that is the reason you do not see the database in the database directory, but the database files and tablespaces still exist. 可能是数据库已创建但未编目,这就是您在数据库目录中看不到数据库但数据库文件和表空间仍然存在的原因。

You can try to recatalog the database and then, drop it if you want to recreate the sample database. 您可以尝试重新编目数据库,然后在要重新创建示例数据库时将其删除。

db2 catalog database sample

db2 drop database sample

db2sampl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM