zoukankan      html  css  js  c++  java
  • oracle 自增列 & 创建表空间

    一 建序列
    create sequence squence_name
      increment by 1 --按1增长
      start with 1 --从1开始
      nomaxvalue --不设最大值
      nocycle  --不循环
      cache 10;  --缓冲

    create sequence seq_fxc_tsxx_vio_xh increment by 1--按1增长 
    start with 1--从1开始
    nomaxvalue nocycle cache 10;

    二 相应表上建触发器应用序列
    create or replace trigger trigger_name
    before insert on tableName
    for each row
    begin
    select squence_name.nextval into :new.id from dual; --:new.id  id 为需要自增的列
    end;

    -------------------------------------------------------------创建表空间

    create tablespace tsName  datafile 'd:??.dbf'
    size 10M autoextend
    on next 10M maxsize
    unlimited 

    -------------------------------------------------------------查看当前用户表空间
    select username,default_tablespace from user_users;

    -------------------------------------------------------------查看当前用户表空间路径

    select * from dba_data_files where tablespace_name = '表空间名区分大小写' 

  • 相关阅读:
    剑指offer-二进制中1的个数
    [SHOI 2017] 分手是祝愿
    [SCOI 2010] 字符串
    [BZOJ 2653] middle
    [APIO 2015] 雅加达的摩天楼
    [NOI 2015] 品酒大会
    [SDOI 2015] 星际战争
    [Codeforces 715C] Digit Tree
    [TJOI 2018] 智力竞赛
    [CTSC 2018] 混合果汁
  • 原文地址:https://www.cnblogs.com/leonkobe/p/3184296.html
Copyright © 2011-2022 走看看