删除DB2数据库时出现问题 [英] Issue Removing DB2 Database

查看:63
本文介绍了删除DB2数据库时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我搞砸了.我试图释放一些磁盘空间,并意外删除了连接到数据库/启动数据库所需的日志DB2.之前我曾遇到过这种情况,所以我取消了数据库的目录并删除了磁盘上的文件,以便重新创建它.但是,当我重新创建数据库时,会得到:

So I screwed up. I was trying to free up some disk space and accidentally deleted logs DB2 needed to connect to/start my database. I'd run into this before, so I uncataloged the database and deleted the files on disk so I could recreate it. However, when I go to recreate the database, I get:

SQL1005N数据库别名"BGTRUNK"已存在于任一本地计算机中.数据库目录或系统数据库目录.

db2列表数据库目录显示该目录已消失.我看到的所有其他搜索内容都建议重新添加和删除数据库,但这显然不是现阶段的选择.

db2 list database directory shows that it's gone. Everything else I saw searching around suggests recatalogging and dropping the db, but that's obviously not an option at this stage.

如何释放此别名以供重用?

How can I free this alias up for reuse?

推荐答案

我终于能够找到解决方法.问题是我删除了包含数据库的SQL000 *文件夹,但是数据库别名仍在SQLDBDIR文件中进行了分类.我不能仅仅删除并重新开始,因为这样做会丢失其他几个数据库.通过重新编目数据库并运行

I was finally able to find a workaround. The issue was that I had deleted the SQL000* folder that contained the database, but the database alias was still cataloged in the SQLDBDIR file. I couldn't just delete and start fresh because I had several other databases that would be lost by doing so. I was able to see what it used to be called by re-cataloging the database and running

db2列出C:\上的db目录

db2 list db directory on C:\

其输出如下:

Database 3 entry:    
Database alias                       = BGTRUNK
Database name                        = BGTRUNK
Database directory                   = SQL00002
Database release level               = f.00
Comment                              =
Directory entry type                 = Home
Catalog database partition number    = 0
Database member number               = 0

SQL00002不再存在,但是我使用我拥有的一个数据库中的数据重新创建了它.足以说服db2该数据库存在,因此我可以成功删除该数据库.

SQL00002 didn't exist anymore, but I recreated it using data from one of the databases that I had. That was enough to convince db2 that the database existed so I could successfully drop.

这篇关于删除DB2数据库时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆