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
SQL1013NThe database alias name or database name "SAMPLE" could not be
found.SQLSTATE=42705

$ db2sampl
SQL1005NThe database alias "sample" already exists in either the local database directory or system database directory.
SQL1013NThe 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
SQL1005NThe 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

学习学习啊。
页: [1]
查看完整版本: 请教:关于删除DB2实例下的数据库的问题?