今天碰到一个怪异的DB2的问题,创建一个表
今天碰到一个怪异的DB2的问题,创建一个表Java代码 [url=http://www.javaeye.com/topic/156960#][img]http://www.javaeye.com/images/icon_copy.gif[/img][/url]
create database lportal create database lportal
提示:在本地数据库目录或系统数据库目录中已经存在数据库别名 "LPORTAL"
但是用
Java代码 [url=http://www.javaeye.com/topic/156960#][img]http://www.javaeye.com/images/icon_copy.gif[/img][/url]
drop database lportal drop database lportal
删除的时候,又提示:
SQL1013N 找不到数据库别名或数据库名称 "LPORTAL "。 SQLSTATE=42705 [color=red][b]此回复于2008-04-10 14:32被 [url=http://bbs.51cto.com/profile-uid-320769.html]ddgff[/url] 评为最佳答案[/b][/color]
1. 首先用 db2 list database directory 命令看在系统数据库目录(System Database Directory)中有没有该数据库,如果有,应该在确定该数据库是没有用的数据库之后用 db2 drop database 数据库名将其删除。
2. 如果没有,再用 db2 list database directory on location 看在本地数据库目录(Local Database Directory)中有没有该数据库,location指定数据库的位置(如Windows下的C: ,Unix下的/home/db2inst1)。如果有,先用 db2 catalog database 数据库名 on location将数据库编目到节点上,再对其进行删除处理。
解决过程:
1.首先用db2 list database directory查看系统数据库目录,为空,说明不在系统数据库目录中。
2.在用db2 list database directory on location(这里是盘符d:,先尝试用localhost和127.0.0.1都不识别),然后发现有LPORTAL的别名。说明在本地数据库目录中。
3.catalog database LPORTAL on d:
4.drop database LPORTAL
页:
[1]