Oracle d/b Create Index error
I am getting missing expression on the below sql when running in sql developer (though i believe it has nothing to do with oracle开发者_高级运维 client) though everything seems to be all right.
CREATE UNIQUE INDEX "CRIS2"."SYS_IL0000296692C00014$$" ON "CRIS2"."AOITARGETPOINT" (
PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "BIOSIRTDATA"
PARALLEL (DEGREE 0 INSTANCES 0) ;
--------------------------------------------------
Error starting at line 1 in command:
CREATE UNIQUE INDEX "CRIS2"."SYS_IL0000296692C00014$$" ON "CRIS2"."AOITARGETPOINT" (
PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "BIOSIRTDATA"
PARALLEL (DEGREE 0 INSTANCES 0)
Error at Command Line:2 Column:2
Error report:
SQL Error: ORA-00936: missing expression
00936. 00000 - "missing expression"
*Cause:
*Action:
Any help pls?
You are missing column list in CREATE INDEX statement
CREATE UNIQUE INDEX "CRIS2"."SYS_IL0000296692C00014$$" ON "CRIS2"."AOITARGETPOINT"
(-->Field List<--)
PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "BIOSIRTDATA"
PARALLEL (DEGREE 0 INSTANCES 0) ;
As Michael Pakhantsov mentioned, the missing field list is obviously the biggest problem. But there are some other issues with this statement.
You may want to give the index a real name instead of using the system generated name. It's probably just a style issue, but it can be confusing if you create objects that start with SYS. (Or is there a possibility of another object name colliding with this? I'm not sure how Oracle comes up with its names.)
PARALLEL (DEGREE 0 INSTANCES 0);
is the parallel clause syntax from Oracle 7. The documentation warns "The syntax of the parallel_clause supersedes syntax appearing in earlier releases of Oracle. Superseded syntax is still supported for backward compatibility but may result in slightly different behavior from that documented." In my testing I haven't found any issues with this syntax, but you should still probably avoid it if possible.
精彩评论