Home > Archives > Oracle 常用脚本

Oracle 常用脚本

Publish:

udpate varchar2 to clob

1
2
3
4
5
6
7
8
9
10
11
12
13
alter table [TABLE_NAME] add temp varchar2(4000);
update [TABLE_NAME] set temp = [VARCHAR2_NAME];
update [TABLE_NAME] set [VARCHAR2_NAME] = null;
commit;

alter table [TABLE_NAME] modify [VARCHAR2_NAME] long;
alter table [TABLE_NAME] modify [VARCHAR2_NAME] clob;
update [TABLE_NAME] set [VARCHAR2_NAME] = temp;
alter table [TABLE_NAME] drop column temp;
commit;

//----某些情况下,是需要对已有索引更新
alter index [INDEX_NAME] rebuild;

声明: 本文采用 BY-NC-SA 授权。转载请注明转自: Ding Bao Guo