数据库dbimport导入遇到的问题

danson 2003-08-19 05:37:14
我从别的数据库用dbexport导出的数据,dbimport到我的电脑的informix里,现在出现这样的问题
***excute sqlobj
625-constraint name (u100_3) already exists

这个u100_3见后面


导入的时候出现下面的状况

{ DATABASE uniondpssdb delimiter | }

grant dba to "dpssadm";



{ TABLE "dpssadm".userregistry row size = 130 number of columns = 14 index size =
117 }
{ unload file name = userr00100.unl number of rows = 1185 }

create table "dpssadm".userregistry
(
user_name char(30),
token_sn char(20) not null ,
token_key char(16) not null ,
reg_time datetime year to second,
token_status smallint
default 0,
user_level smallint
default 1,
dyn_pw_len smallint
default 10,
fix_pw_sign smallint
default 0,
fix_pw char(20)
default ' ',
last_ver_time datetime year to second
default current year to second,
event integer not null ,
fail_count integer
default 0,
time_error integer
default 0,
mac char(8),
unique (token_sn) constraint "dpssadm".u100_2,
unique (token_key) constraint "dpssadm".u100_3,
primary key (user_name)
);

***excute sqlobj
625-constraint name (u100_3) already exists



我的源数据库部分表构建如下

{ ..... DATABASE uniondpssdb }

CREATE DATABASE uniondpssdb
IN uniondpssdbs
WITH LOG MODE ANSI;
COMMIT WORK;


{ ..... GRAND DBA PERMISSION }

GRANT DBA TO "dpssadm";
COMMIT WORK;


{ ..... TABLE userregistry }

CREATE TABLE "dpssadm".userregistry (
user_name CHAR(30) PRIMARY KEY,
token_sn CHAR(20) NOT NULL UNIQUE,
token_key CHAR(16) NOT NULL UNIQUE,
reg_time DATETIME YEAR TO SECOND,
token_status SMALLINT DEFAULT 0,
user_level SMALLINT DEFAULT 1,
dyn_pw_len SMALLINT DEFAULT 10,
fix_pw_sign SMALLINT DEFAULT 0,
fix_pw CHAR(20) DEFAULT '',
last_ver_time DATETIME YEAR TO SECOND
DEFAULT CURRENT YEAR TO SECOND,
event INTEGER NOT NULL,
fail_count INTEGER DEFAULT 0,
time_error INTEGER DEFAULT 0,
mac CHAR(8)
)
LOCK MODE ROW;
COMMIT WORK;


{ ..... TABLE groupregistry }

CREATE TABLE "dpssadm".groupregistry (
group_name CHAR(20) PRIMARY KEY,
comment CHAR(128)
);
……
……



我查了一下error code
-625 Constraint name constraint-name already exists.
The constraint name already exists. Review the spelling. If it is as you intended, you must select another name, or drop and redefine the existing constraint. See the discussion of error -623 for a way to list all constraints.


-623 Unable to find CONSTRAINT constraint-name.
The constraint specified in this statement cannot be found. Review the spelling of the name shown. If it is as you intended, check the names of existing named constraints by querying the sysconstraints table as shown in the following example. If the owner name shown for the desired constraint is not yours, you need to be a Database Administrator to reference it (and, if this database is ANSI compliant, you need to qualify the name with its owner-name).

SELECT constrname, owner FROM informix.sysconstraints


这个源数据库表没有给token_sn定义一个constraint name ,这个是不是系统自动分的啊?(1)
导出的时候就定义了u100_3。
我把uniondpssdb.sql文件的u100_3改成了u100_30,数据可以导进去了
我查了一下,userregistry表 tabid是100
我select * from sysconstraints where tabid=100
得到下面结果

constrid 1 2 3 4 5 6
constrname u100_2 u100_30 u100_3 n100_4 n100_5 n100_6
owner dpssadm dpssadm informix informix informix informix
tabid 100 100 100 100 100 100
constrtype U U P N N N
idxname 100_1 100_2 100_3



这个constraint name修改了对数据库有没有什么影响啊? (2)
由于可能要对两台电脑的informix数据库进行同步,所以不可能每次都修改了再导入,那数据导入这个问题能不能解决啊?(3)

...全文
200 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
klbt 2003-08-23
  • 打赏
  • 举报
回复
超长的问题
wenlq 2003-08-20
  • 打赏
  • 举报
回复
我也碰到这个问题过,只能改了。
用shell 来实现自动删除这些东西。

1,194

社区成员

发帖
与我相关
我的任务
社区描述
其他数据库开发 Informix
社区管理员
  • Informix社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧