高手看下下面是咋回事?? create table course(cno number(6) primary key,cname char(20) uniqueusing index tablespace indx storge(initial 64k next 64k))运行时报错:create table course( *ERROR 位于第 1 行:ORA-00922:缺少或无效选项 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的脚本写法有问题吧,给你看个脚本CREATE TABLE POST --建表( SEQ_NO CHAR(6 BYTE), AREA_GB VARCHAR2(2 BYTE), CITY_NAME VARCHAR2(30 BYTE), CITY CHAR(4 BYTE), GU_NAME VARCHAR2(30 BYTE), COUNTRY CHAR(6 BYTE), DONG_NAME VARCHAR2(30 BYTE), POST_NO VARCHAR2(6 BYTE), POST_SEQ CHAR(3 BYTE) DEFAULT '001')TABLESPACE ORDER_DAT --表空间PCTUSED 0PCTFREE 10INITRANS 1MAXTRANS 255STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0 BUFFER_POOL DEFAULT )LOGGING NOCOMPRESS NOCACHENOPARALLELMONITORING;CREATE UNIQUE INDEX POST_PK ON POST --建立UNIQUE(POST_SEQ, POST_NO)LOGGINGTABLESPACE ORDER_DATPCTFREE 10INITRANS 2MAXTRANS 255STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0 BUFFER_POOL DEFAULT )NOPARALLEL;ALTER TABLE POST ADD ( --建PK CONSTRAINT POST_PK PRIMARY KEY (POST_SEQ, POST_NO) USING INDEX TABLESPACE ORDER_DAT PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE ( INITIAL 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0 )); SQL> help create table CREATE TABLE ------------ Use this command to create a table, the basic structure to hold user data, specifying the following information: * column definitions * table organization definition * column definitions using objects * integrity constraints * the table's tablespace * storage characteristics * an optional cluster * data from an arbitrary query * degree of parallelism used to create the table and the default degree of parallelism for queries on the table * partitioning definitions Use CREATE TABLE to create an object table or a table that uses an object type for a column definition. An object table is a table explicitly defined to hold object instances of a particular type. You can also create an object type and then use it in a column when creating a relational table. Relational table definition CREATE TABLE [schema.]table [ ( { column datatype [DEFAULT expr] [WITH ROWID] [SCOPE IS [schema.]scope_table_name] [column_constraint] ... | table_constraint | REF (ref_column_name) WITH ROWID | SCOPE FOR (ref_column_name) IS [schema.]scope_table_name } [, { column datatype [DEFAULT expr] [WITH ROWID] [SCOPE IS [schema.]scope_table_name] [column_constraint] ... | table_constraint | REF (ref_column_name) WITH ROWID | SCOPE FOR (ref_column_name) IS [schema.]scope_table_name} ] ...) ] [ { [ ORGANIZATION {HEAP | INDEX} | PCTTHRESHOLD [INCLUDING column_name] [ OVERFLOW [physical_attributes_clause | TABLESPACE tablespace] ...] | physical_attributes_clause | TABLESPACE tablespace | LOB (lob_item [, lob_item ...] ) STORE AS [lob_segname] [ ( TABLESPACE tablespace | STORAGE storage_clause | CHUNK integer | PCTVERSION integer | CACHE | NOCACHE LOGGING | NOCACHE NOLOGGING | INDEX [lob_index_name] [ ( TABLESPACE tablespace | STORAGE storage_clause | INITRANS integer | MAXTRANS integer ) ...] ) ] | NESTED TABLE nested_item STORE AS storage_table | {LOGGING | NOLOGGING} ] ... | CLUSTER cluster (column [, column] ...) } ] [ PARALLEL parallel_clause] [ PARTITION BY RANGE (column_list) ( PARTITION [partition_name] VALUES LESS THAN (value_list) [ physical_attributes_clause | TABLESPACE tablespace | {LOGGING | NOLOGGING} ] ) ...] [ ENABLE enable_clause | DISABLE disable_clause] ... [AS subquery] [CACHE | NOCACHE] physical_attributes_clause [ PCTFREE integer | PCTUSED integer | INITRANS integer | MAXTRANS integer | STORAGE storage_clause ] Object table definition CREATE TABLE [schema.]table OF [schema.]object_type [ ( [ column | attribute [DEFAULT expr] [WITH ROWID] [ SCOPE IS [schema.]scope_table_name] [column_constraint] ...] | table_constraint | REF (ref_column_name) WITH ROWID | SCOPE FOR (ref_column_name) IS [schema.]scope_table_name [, { column | attribute [DEFAULT expr] [WITH ROWID] [ SCOPE IS [schema.]scope_table_name] [column_constraint] ... | table_constraint | REF (ref_column_name) WITH ROWID | SCOPE FOR (ref_column_name) IS [schema.]scope_table_name} ] ...) ] [ OIDINDEX [index] [( physical_attributes_clause | TABLESPACE tablespace) ...] [ { [ physical_attributes_clause | TABLESPACE tablespace | LOB (lob_item [, lob_item ...]) STORE AS [ lob_segname] [ ( TABLESPACE tablespace | STORAGE storage_clause | CHUNK integer | PCTVERSION integer | CACHE | NOCACHE LOGGING | NOCACHE NOLOGGING | INDEX [lob_index_name] [ ( TABLESPACE tablespace | STORAGE storage_clause | INITRANS integer | MAXTRANS integer ) ] ) ] | NESTED TABLE nested_item STORE AS storage_table | {LOGGING | NOLOGGING} ] ... | CLUSTER cluster (column [, column] ...) } ] [ PARALLEL parallel_clause] [ ENABLE enable_clause | DISABLE disable_clause] ... [ AS subquery] [ CACHE | NOCACHE] For detailed information on this command, see the Oracle8 Server SQL Reference. CREATE TABLESPACE ----------------- Use this command to create a tablespace. A tablespace is an allocation of space in the database that can contain schema objects. CREATE TABLESPACE tablespace DATAFILE filespec [ AUTOEXTEND { OFF | ON [ NEXT integer [K | M] ] [ MAXSIZE { UNLIMITED | integer [K | M] } ] } ] [ LOGGING | NOLOGGING] [, filespec [ AUTOEXTEND { OFF | ON [ NEXT integer [K | M] ] [ MAXSIZE { UNLIMITED | integer [K | M] } ] } ] ] [LOGGING | NOLOGGING] ... [ MINIMUM EXTENT integer [K | M] ] [ DEFAULT STORAGE storage_clause | {ONLINE | OFFLINE} | {PERMANENT | TEMPORARY} ] ... For detailed information on this command, see the Oracle8 Server SQL Reference.SQL> 主键创建的位置问题吧?你那不是ORACLE的建表语句吧?CREATE TABLE HYX0X.BOOKS( CATALOG_NUMBER NUMBER(4,0) NOT NULL, TITLE VARCHAR2(40), AUTHOR1 VARCHAR2(40), AUTHOR2 VARCHAR2(40), AUTHOR3 VARCHAR2(40), AUTHOR4 VARCHAR2(40), CONSTRAINT SYS_C002181 PRIMARY KEY (CATALOG_NUMBER) USING INDEX --主键创建的位置 PCTFREE 10 INITRANS 2 MAXTRANS 255 TABLESPACE USERS STORAGE(INITIAL 64K MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) LOGGING) 1.storage写错了;2.tablespace 应该写在后面;SQL> create table course( 2 cno number(6) primary key using index storage(initial 64k next 64k) tablespace indx, 3 cname char(20) unique 4 ) 5 /Table created hql case when 无法执行 为什么 求sql语句,为新添加的列更新数据! 分组查询 存储过程怎样从参数传入表名?? 用c#程序时时从oacle倒到sqlserver2000里的数据为和出现乱码? 高分,在线等,现结.在Oracle里对两个64位的整数求与,怎么办? TNS-03505:未能分解名称? BLOB数据的存取(急送50分) 请教一个数据库表设计、查询的问题:关于树状结构的表设计『急,在线等』 求大神指导ORA-00905: 缺失关键字,哪里错了呀? 书上说定义全局数据库名时, 要按照数据库.域名称,请问这里的域名称是指网络的域名称还是可以自己随便定义的. 求网络设计方案
CREATE TABLE POST --建表
(
SEQ_NO CHAR(6 BYTE),
AREA_GB VARCHAR2(2 BYTE),
CITY_NAME VARCHAR2(30 BYTE),
CITY CHAR(4 BYTE),
GU_NAME VARCHAR2(30 BYTE),
COUNTRY CHAR(6 BYTE),
DONG_NAME VARCHAR2(30 BYTE),
POST_NO VARCHAR2(6 BYTE),
POST_SEQ CHAR(3 BYTE) DEFAULT '001'
)
TABLESPACE ORDER_DAT --表空间
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
CREATE UNIQUE INDEX POST_PK ON POST --建立UNIQUE
(POST_SEQ, POST_NO)
LOGGING
TABLESPACE ORDER_DAT
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
)
NOPARALLEL;
ALTER TABLE POST ADD ( --建PK
CONSTRAINT POST_PK
PRIMARY KEY
(POST_SEQ, POST_NO)
USING INDEX
TABLESPACE ORDER_DAT
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 64K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
));
------------ Use this command to create a table, the basic structure to hold user
data, specifying the following information: * column definitions
* table organization definition
* column definitions using objects
* integrity constraints
* the table's tablespace
* storage characteristics
* an optional cluster
* data from an arbitrary query
* degree of parallelism used to create the table and the default
degree of parallelism for queries on the table
* partitioning definitions Use CREATE TABLE to create an object table or a table that uses an
object type for a column definition. An object table is a table
explicitly defined to hold object instances of a particular type. You can also create an object type and then use it in a column when
creating a relational table. Relational table definition
CREATE TABLE [schema.]table
[ ( { column datatype [DEFAULT expr] [WITH ROWID]
[SCOPE IS [schema.]scope_table_name]
[column_constraint] ...
| table_constraint | REF (ref_column_name) WITH ROWID
| SCOPE FOR (ref_column_name) IS [schema.]scope_table_name }
[, { column datatype [DEFAULT expr] [WITH ROWID]
[SCOPE IS [schema.]scope_table_name]
[column_constraint] ...
| table_constraint | REF (ref_column_name) WITH ROWID
| SCOPE FOR (ref_column_name) IS
[schema.]scope_table_name} ] ...) ]
[ { [ ORGANIZATION {HEAP | INDEX}
| PCTTHRESHOLD [INCLUDING column_name]
[ OVERFLOW [physical_attributes_clause |
TABLESPACE tablespace] ...]
| physical_attributes_clause
| TABLESPACE tablespace
| LOB (lob_item [, lob_item ...] ) STORE AS
[lob_segname]
[ ( TABLESPACE tablespace
| STORAGE storage_clause
| CHUNK integer
| PCTVERSION integer
| CACHE
| NOCACHE LOGGING | NOCACHE NOLOGGING
| INDEX [lob_index_name]
[ ( TABLESPACE tablespace
| STORAGE storage_clause
| INITRANS integer
| MAXTRANS integer ) ...] ) ]
| NESTED TABLE nested_item STORE AS storage_table
| {LOGGING | NOLOGGING} ] ...
| CLUSTER cluster (column [, column] ...) } ]
[ PARALLEL parallel_clause]
[ PARTITION BY RANGE (column_list)
( PARTITION [partition_name] VALUES LESS THAN (value_list)
[ physical_attributes_clause
| TABLESPACE tablespace
| {LOGGING | NOLOGGING} ] ) ...]
[ ENABLE enable_clause | DISABLE disable_clause] ...
[AS subquery]
[CACHE | NOCACHE] physical_attributes_clause
[ PCTFREE integer
| PCTUSED integer
| INITRANS integer
| MAXTRANS integer
| STORAGE storage_clause ] Object table definition
CREATE TABLE [schema.]table OF [schema.]object_type
[ ( [ column | attribute [DEFAULT expr] [WITH ROWID]
[ SCOPE IS [schema.]scope_table_name]
[column_constraint] ...]
| table_constraint | REF (ref_column_name) WITH ROWID
| SCOPE FOR (ref_column_name) IS [schema.]scope_table_name
[, { column | attribute [DEFAULT expr] [WITH ROWID]
[ SCOPE IS [schema.]scope_table_name]
[column_constraint] ...
| table_constraint | REF (ref_column_name) WITH ROWID
| SCOPE FOR (ref_column_name) IS
[schema.]scope_table_name} ] ...) ]
[ OIDINDEX [index] [( physical_attributes_clause |
TABLESPACE tablespace) ...]
[ { [ physical_attributes_clause
| TABLESPACE tablespace
| LOB (lob_item [, lob_item ...]) STORE AS
[ lob_segname]
[ ( TABLESPACE tablespace
| STORAGE storage_clause
| CHUNK integer
| PCTVERSION integer
| CACHE
| NOCACHE LOGGING | NOCACHE NOLOGGING
| INDEX [lob_index_name]
[ ( TABLESPACE tablespace
| STORAGE storage_clause
| INITRANS integer
| MAXTRANS integer ) ] ) ]
| NESTED TABLE nested_item STORE AS storage_table
| {LOGGING | NOLOGGING} ] ...
| CLUSTER cluster (column [, column] ...) } ]
[ PARALLEL parallel_clause]
[ ENABLE enable_clause | DISABLE disable_clause] ...
[ AS subquery]
[ CACHE | NOCACHE] For detailed information on this command, see the Oracle8 Server SQL
Reference.
CREATE TABLESPACE
----------------- Use this command to create a tablespace. A tablespace is an
allocation of space in the database that can contain schema objects. CREATE TABLESPACE tablespace
DATAFILE filespec
[ AUTOEXTEND
{ OFF | ON
[ NEXT integer [K | M] ]
[ MAXSIZE
{ UNLIMITED | integer [K | M] } ] } ]
[ LOGGING | NOLOGGING]
[, filespec
[ AUTOEXTEND
{ OFF | ON
[ NEXT integer [K | M] ]
[ MAXSIZE
{ UNLIMITED | integer [K | M] } ] } ] ]
[LOGGING | NOLOGGING] ...
[ MINIMUM EXTENT integer [K | M] ]
[ DEFAULT STORAGE storage_clause
| {ONLINE | OFFLINE}
| {PERMANENT | TEMPORARY} ] ... For detailed information on this command, see the Oracle8 Server SQL
Reference.
SQL>
(
CATALOG_NUMBER NUMBER(4,0) NOT NULL,
TITLE VARCHAR2(40),
AUTHOR1 VARCHAR2(40),
AUTHOR2 VARCHAR2(40),
AUTHOR3 VARCHAR2(40),
AUTHOR4 VARCHAR2(40),
CONSTRAINT SYS_C002181 PRIMARY KEY (CATALOG_NUMBER) USING INDEX --主键创建的位置
PCTFREE 10
INITRANS 2
MAXTRANS 255
TABLESPACE USERS
STORAGE(INITIAL 64K MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
LOGGING
)
2.tablespace 应该写在后面;
SQL> create table course(
2 cno number(6) primary key using index storage(initial 64k next 64k) tablespace indx,
3 cname char(20) unique
4 )
5 /Table created