Chinaunix

标题: 请教:关于删除DB2实例下的数据库的问题? [打印本页]

作者: dont_move    时间: 2005-01-19 17:06
标题: 请教:关于删除DB2实例下的数据库的问题?
本人在Linux安装DB2,因要使用sample数据库,发现无法连上sample,打算删除后再用db2sampl重建这个库,但无法重建,操作如下,向高手请教。

拜谢

这个库好像被同事非正常地删除过。

$ db2 list database directory

System Database Directory

Number of entries in the directory = 8

Database 1 entry:

Database alias                       = SETTLE
Database name                        = SETTLE
Local database directory             = /home/db2inst1
Database release level               = a.00
Comment                              =
Directory entry type                 = Indirect
Catalog database partition number    = 0

Database 2 entry:

Database alias                       = TMP
Database name                        = TMP
Local database directory             = /home/db2inst1
Database release level               = a.00
Comment                              =
Directory entry type                 = Indirect
Catalog database partition number    = 0

Database 3 entry:

Database alias                       = ALLWEB
Database name                        = ALLWEB
Local database directory             = /home/db2inst1
Database release level               = a.00
Comment                              =
Directory entry type                 = Indirect
Catalog database partition number    = 0

Database 4 entry:

Database alias                       = TRADE
Database name                        = TRADE
Local database directory             = /home/db2inst1
Database release level               = a.00
Comment                              =
Directory entry type                 = Indirect
Catalog database partition number    = 0

Database 5 entry:

Database alias                       = SINGLEE
Database name                        = SINGLEE
Local database directory             = /home/db2inst1
Database release level               = a.00
Comment                              =
Directory entry type                 = Indirect
Catalog database partition number    = 0

Database 6 entry:

Database alias                       = DBTMP
Database name                        = DBTMP
Local database directory             = /home/db2inst1
Database release level               = a.00
Comment                              =
Directory entry type                 = Indirect
Catalog database partition number    = 0

Database 7 entry:

Database alias                       = SAMPLE
Database name                        = SAMPLE
Local database directory             = /home/db2inst1
Database release level               = a.00
Comment                              =
Directory entry type                 = Indirect
Catalog database partition number    = 0

Database 8 entry:

Database alias                       = KSDBS
Database name                        = KSDBS
Local database directory             = /home/db2inst1
Database release level               = a.00
Comment                              =
Directory entry type                 = Indirect
Catalog database partition number    = 0

$ db2 drop db sample
SQL1013N  The database alias name or database name "SAMPLE  " could not be
found.  SQLSTATE=42705

$ db2sampl
SQL1005N  The database alias "sample" already exists in either the local database directory or system database directory.
SQL1013N  The database alias name or database name "SAMPLE" could not be found.  SQLSTATE=42705
作者: huyuhui001    时间: 2005-01-20 08:59
标题: 请教:关于删除DB2实例下的数据库的问题?
把sample先 CATEGORY上,应该是没有被删除,只是把category信息删除了
作者: dont_move    时间: 2005-01-20 10:31
标题: 请教:关于删除DB2实例下的数据库的问题?
谢huyuhui001了,做以下尝试,不成功:

$ db2 catalog db sample
SQL1005N  The database alias "sample" already exists in either the local database directory or system database directory.
作者: huyuhui001    时间: 2005-01-20 13:12
标题: 请教:关于删除DB2实例下的数据库的问题?
Database 7 entry:

Database alias = SAMPLE
Database name = SAMPLE
Local database directory = /home/db2inst1
Database release level = a.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0

不是已经有了么?直接用db2 connect to sample不行么?
作者: mymm    时间: 2005-01-23 19:45
标题: 请教:关于删除DB2实例下的数据库的问题?
不是有sample吗?
不能用吗?

先drop后再重建!
作者: marspan0000    时间: 2012-01-11 14:52
db2 uncatalog db sample
作者: sychangchun    时间: 2012-01-26 19:09
学习学习啊。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2