Oracle创建表和索引

树叶云

Oracle创建表和索引的语句写法是比较基础的知识,下面就为您详细介绍Oracle创建表和索引的方法,希望对您学习Oracle创建表方面能有所帮助。

Oracle创建表

  1. create table tablename  
  2. (  
  3. f1 NUMBER(10) not null,  
  4. f2 NUMBER(10) null ,  
  5. f3 NUMBER(3) defalut 0,  
  6. pt number(3) not null ,  
  7. constraint PK_tablename primary key (f1)  
  8. using index  
  9. tablespace ts_name  
  10. storage  
  11. (  
  12. initial 1m  
  13. next 1m  
  14. pctincrease 0  
  15. )  
  16. )  
  17. pctfree 10  
  18. tablespace ts_name  
  19. storage  
  20. (  
  21. initial 1m  
  22. next 1m  
  23. pctincrease 0  
  24. )  
  25. partition by range(pt)  
  26. (partition part000 values less than (1) tablespace ts_name,  
  27. partition part001 values less than (2) tablespace ts_name,  
  28. )  

创建索引

  1. create index i_tablename1 on tablename(f2)  
  2. tablespace ts_name  
  3. storage  
  4. (  
  5. initial 500k  
  6. next 500k  
  7. pctincrease 0  

 

 

 

 

【编辑推荐】

教您如何实现Oracle重建索引

Oracle COMMIT语句的处理顺序介绍

全面解析Oracle文件系统

当前Oracle系统时间的查询方法

ORACLE系统表和数据字典视图

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/253345.html<

(0)
运维的头像运维
上一篇2025-04-29 20:52
下一篇 2025-04-29 20:53

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注