Oracle之索引的创建方式
来源:互联网 发布:普通话数字发音软件 编辑:程序博客网 时间:2024/06/04 01:15
Oracle 的索引可分为5种,它们包括唯一索引、组合索引、反向键索引、位图索引和基于函数的索引。
1、创建索引的标准语法
以下为引用内容: CREATE INDEX 索引名 ON 表名 (列名)TABLESPACE 表空间名;
例如:
以下为引用内容: CREATE INDEX idx_of_imsi ON uim_auth_file(imsi) TABLESPACE users;
2、创建唯一索引
以下为引用内容: CREATE unique INDEX 索引名 ON 表名 (列名)TABLESPACE 表空间名;
例如:
以下为引用内容: CREATE UNIQUE INDEX idx_of_imsi ON uim_auth_file(imsi) TABLESPACE users;
3、创建组合索引
以下为引用内容: CREATE INDEX 索引名 ON 表名 (列名1,列名2)TABLESPACE 表空间名;
例如:
以下为引用内容: CREATE INDEX idx_of_imsi ON uim_auth_file(iccid,imsi) TABLESPACE users;
4、创建反向键索引
以下为引用内容: CREATE INDEX 索引名 ON 表名 (列名) reverseTABLESPACE 表空间名;
例如:
以下为引用内容: CREATE INDEX idx_of_imsi ON uim_auth_file(imsi) reverse TABLESPACE users;
eg:
alter table base_family modify IDENTITY_CARD varchar2(30);alter table office_repaire add equipment_type char(1);--请假类型表/*==============================================================*//* Table: office_leave_type *//*==============================================================*/create table office_leave_type ( id char(32) not null, name varchar2(20) not null, unit_id char(32) not null, state number(1) not null, is_deleted number(1) not null, constraint PK_OFFICE_LEAVE_TYPE primary key (id) using index tablespace tbs_office)tablespace tbs_office;comment on column office_leave_type.state is'1:学生,2:老师';--教师请假表/*==============================================================*//* Table: office_teacher_leave_nh *//*==============================================================*/create table office_teacher_leave_nh ( id char(32) not null, unit_id char(32), apply_user_id char(32) not null, begin_time date, end_time date, days number(5,1), leave_type_id char(32), morning_change varchar2(100), night_change varchar2(100), week_change varchar2(100), act_charge_teacher varchar2(100), remark varchar2(200), state number(1), is_deleted number(1), create_user_id char(32), create_time date, flow_id char(32), constraint PK_OFFICE_TEACHER_LEAVE_NH primary key (id) using index tablespace tbs_office_idx)tablespace tbs_office;--学生请假表/*==============================================================*//* Table: office_student_leave *//*==============================================================*/create table office_student_leave ( id char(32) not null, student_id char(32) not null, start_time date, end_time date, days number(5,1), leave_type_id char(32), class_id char(32), acadyear varchar2(10), semester number(1), create_user_id char(32), create_time date, remark varchar2(200), audit_user_id char(32), state number(1), audit_time date, audit_remark varchar2(200), is_deleted number(1), unit_id char(32), back_state number(1) default 0, constraint PK_OFFICE_STUDENT_LEAVE primary key (id) using index tablespace tbs_office_idx)tablespace tbs_office;comment on column office_student_leave.state is'1:未提交,2:已提交,3:通过,4:未通过';comment on column office_student_leave.back_state is'0:未判断,1:已回校,2:未回校已发短信通知';--任务管理/*==============================================================*//* Table: office_task_manage *//*==============================================================*/create table office_task_manage ( id char(32) not null, unit_id char(32) not null, task_name varchar2(100), deal_user_id char(32), complete_time date, has_attach number(1), remark varchar2(500), state number(1), create_user_id char(32), create_time date, first_remind_time date, second_remind_time date, remind_number number(1), actual_finish_time date, has_submit_attach number(1), finish_remark varchar2(500), is_deleted number(1) not null, constraint PK_OFFICE_TASK_MANAGE primary key (id) using index tablespace tbs_office_idx)tablespace tbs_office;comment on column office_task_manage.state is'1:未发布,2:已发布,3:已完成';
0 0
- Oracle之索引的创建方式
- lucene学习之创建索引的方式
- oracle索引的创建
- Oracle索引的创建
- Oracle空间索引的创建
- Oracle创建索引的准则
- Oracle全文索引之二 创建
- Oracle 创建索引、重建索引、删除索引的语法
- Oracle 创建索引、重建索引、删除索引的语法
- 创建索引的两种方式(重点)
- 创建索引的另一种方式(index)
- 创建oracle的函数式的索引
- oracle创建dblink的方式
- Oracle创建序列的方式
- Oracle聚簇索引的使用方式
- oracle全文索引的创建和使用
- oracle全文索引的创建和使用
- 创建Oracle数据库索引的三个标准
- Github上iOS开源项目分类及
- ARM7 低级错误
- HDU 3277 Marriage Match III 二分+网络流拆点
- linux:SUID、SGID详解
- 理解JavaScript的作用域链
- Oracle之索引的创建方式
- 在一般处理程序页面使用Session
- hive 创建外表操作
- iOS - 音乐 AVFoundation.framwork
- Android Studio常用快捷键-mac版
- 3D效果
- AlertDialog的使用
- win7中将文件拷贝到虚拟机linux下的方法
- NSURLCache 在 iOS 8 的 UIWebView 中不执行bug