我试图执行以下查询:
1.
CREATE TABLE "PUB"."REGISTRATION"
(
"LOGIN_ID" NUMBER(5,0) NOT NULL ENABLE,
"LOGIN" VARCHAR2(120 BYTE) NOT NULL ENABLE,
"PASSWORD" VARCHAR2(70 BYTE) NOT NULL ENABLE,
"FNAME" VARCHAR2(40 BYTE) NOT NULL ENABLE,
"MNAME" VARCHAR2(20 BYTE),
"LNAME" VARCHAR2(20 BYTE) NOT NULL ENABLE,
"GENERATEDTIME" DATE NOT NULL ENABLE,
"LASTUPDATE" DATE,
"EMAIL" VARCHAR2(70 BYTE) NOT NULL ENABLE,
"EMAIL_STATUS" VARCHAR2(20 BYTE),
"EMAIL_CODE" VARCHAR2(40 BYTE),
"DATE_OF_BIRTH" DATE,
"GENDER" VARCHAR2(20 BYTE),
CONSTRAINT "USERS_REG_PK" PRIMARY KEY ("LOGIN_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "MYDATA" ENABLE,
CONSTRAINT "USERS_REG_UK" UNIQUE ("LOGIN") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "MYDATA" ENABLE
)
SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
(
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
)
TABLESPACE "MYDATA" ;
2.
CREATE UNIQUE INDEX "PUB"."USERS_REG_PK" ON "PUB"."REGISTRATION"
(
"LOGIN_ID"
)
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
(
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
)
TABLESPACE "MYDATA" ;
3.
CREATE UNIQUE INDEX "PUB"."USERS_REG_UK" ON "PUB"."REGISTRATION"
(
"LOGIN"
)
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
(
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
)
TABLESPACE "MYDATA" ;
表 "PUB"."REGISTRATION" 创建。
运行第二个时出现以下错误:
Error starting at line 29 in command:
CREATE UNIQUE INDEX "PUB"."USERS_REG_PK" ON "PUB"."REGISTRATION"
(
"LOGIN_ID"
)
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
(
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT
)
TABLESPACE "MYDATA"
Error at Command Line:29 Column:26
Error report:
SQL Error: ORA-00955: name is already used by an existing object
00955. 00000 - "name is already used by an existing object"