频道栏目
首页 > 资讯 > 其他综合 > 正文

数据库相关的DDL语句使用记录

18-07-25        来源:[db:作者]  
收藏   我要投稿

DDL语句:

1.删除索引:DROP INDEX I_CERT_NO;

create index IU_SYJ_LOAN_OPER_NO on T_INFO_LOAN_ORDER (OPERATION_NO) tablespace TBS_ORDER_IDX_01 online;

2.变更字段长度

alter table table_name modify (col_name varchar2(150));

3.建表语句:

create table ZXLOAN.T_BLACK_NAME_LIST_MANAGER
(
  ID                         VARCHAR2(50) not null,
  customer_no                VARCHAR2(50),
  check_flag                 CHAR(1) default '0' not null,
  created_at                 DATE not null,
  created_by                 VARCHAR2(32) not null,
  updated_at                 DATE,
  updated_by                 VARCHAR2(32),
  archived_by                 VARCHAR2(32),
  archived_at                 DATE,
  archived_flag                 CHAR(1) default '0' not null
)
tablespace TBS_ORDER_01
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  );

-- Add comments to the table 
comment on table ZXLOAN.T_BLACK_NAME_LIST_MANAGER
  is '黑名单管理';
-- Add comments to the columns 
comment on column ZXLOAN.T_BLACK_NAME_LIST_MANAGER.id
  is '主键';
comment on column ZXLOAN.T_BLACK_NAME_LIST_MANAGER.customer_no
  is '客户号';
comment on column ZXLOAN.T_BLACK_NAME_LIST_MANAGER.check_flag
  is '审核标志';
comment on column ZXLOAN.T_BLACK_NAME_LIST_MANAGER.created_at
  is '创建时间';
comment on column ZXLOAN.T_BLACK_NAME_LIST_MANAGER.created_by
  is '创建人';
comment on column ZXLOAN.T_BLACK_NAME_LIST_MANAGER.updated_at
  is '更新时间';
comment on column ZXLOAN.T_BLACK_NAME_LIST_MANAGER.updated_by
  is '更新人';
comment on column ZXLOAN.T_BLACK_NAME_LIST_MANAGER.archived_by
  is '归档人';
comment on column ZXLOAN.T_BLACK_NAME_LIST_MANAGER.archived_at
  is '归档日期';
comment on column ZXLOAN.T_BLACK_NAME_LIST_MANAGER.archived_flag
  is '归档标识[0:未归档,1:已归档]';

-- Create/Recreate primary, unique and foreign key constraints 
alter table ZXLOAN.T_BLACK_NAME_LIST_MANAGER
  add constraint PK_BLACK_NAME_LIST_MANAGER primary key (ID)
  using index 
  tablespace TBS_ORDER_IDX_01
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    next 1M
    minextents 1
    maxextents unlimited
  );
  
--增加操作员编号索引
create index IU_SYJ_BLACK_OPER_NO on T_BLACK_NAME_LIST_MANAGER (operation_no) tablespace TBS_ORDER_IDX_01;

CREATE SEQUENCE SEQ_BLACK_NAME_LIST_MANAGER
minvalue 1000000000
maxvalue 9999999999
start with 1000000000
increment by 1
cycle
cache 200;
相关TAG标签
上一篇:mysql数据库的主从复制原理介绍
下一篇:抓取oracle建表语句的代码实例教程
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站