Informix 刪除主索引或主鍵

2021-08-25 20:50:50 字數 1040 閱讀 4651

informix 刪除索引或主鍵

1、根據網上的做法,發現在systables 中找不到有主鍵的表

select constrname from sysconstraints where tabid in (select tabid from systables where tabname='sys_comminfo001');

2、找到sys_comminfo001表的索引為297_665,索引是一串數字,如果直接刪除索引,也刪除不掉

alter table sys_comminfo001 drop constraint 297_665;

使用drop也不可以

drop index 297_665

3、經過試驗,可行的方法是在索引數字前加字母u,然後就可以drop掉了,知道原因的朋友可以做個解釋

alter table sys_comminfo001 drop constraint u297_665;

4、建立主鍵/索引

alter table sys_comminfo001 add constraint primary key(txtid,txtno)

5、建立一般索引

create index sys_com001_kv on sys_comminfo001 (keyvalue)

檢視資料表鎖模式:

在命令列下執行:

dbschema -d 資料庫名 -t 表名 -ss

看到lock mode 的值就知道是行級鎖還是頁級鎖;

lock mode page;

改變鎖模式(在dbaccess下執行):

頁級鎖變為行級鎖:

alter table tdh lock mode (row);

增加列:

alter table parasrv add (release_flag char(10) default 'yes')

Informix 刪除主索引或主鍵

informix 刪除索引或主鍵 1 根據網上的做法,發現在systables 中找不到有主鍵的表 select constrname from sysconstraints where tabid in select tabid from systables where tabname sys c...

git刪除主分支

最近在整理專案的時候,需要把主分支清空掉,但是好像沒有直接刪除重建比較快,但是執行命令時出現以下情況 git push origin master to remote rejected master refusing to delete the current branch refs heads m...

sphinx主索引,增量索引建立

相關命令及步驟 建立主索引 usr local coreseek bin indexer c usr local coreseek etc csft.conf all 建立增量索引 1.建立測試資料表以及資料 2.修改配置檔案 主索引源 sql query pre 增量索引源 sql query p...