set unused的用法(ORACLE删除字段)】的更多相关文章

set unused的用法(ORACLE删除字段) 一.问题 现场有一张大数据量的分区表,数据量在10G以上.因某种原因需要删除其中的某些字段.如果直接用alter table1 drop (column1,column2);或者alter table1 drop column column1;和alter table1 drop column column2; 的话,需要执行很长时间,这期间该表被锁,会影响到其它应用. 二.解决方法 使用set unused,等系统空闲时再drop unuse…
一.问题 现场有一张大数据量的分区表,数据量在10G以上.因某种原因需要删除其中的某些字段.如果直接用 alter table1 drop (column1,column2); 或者alter table1 drop column column1;和alter table1 drop column column2;  的话,需要执行很长时间,这期间该表被锁,会影响到其它应用. 二.解决方法 使用set unused,等系统空闲时再drop unused. 1. alter table table…
create or replace procedure PROC_test is --Description:删除字段中的指定字符(回车chr(13).换行chr(10)) --By LiChao --Date:2016-03-01 colname ); --列名 cnt number; --包含换行符的列的行数 v_sql ); --动态SQL变量 begin --读取表中的列 for col in (select column_name from user_tab_columns where…
declare v_count number; begin ) into v_count from all_tab_columns a where a.TABLE_NAME = 'XXX1' and a.COLUMN_NAME = 'TEST1'; ) THEN EXECUTE immediate 'ALTER TABLE XXX1 DROP COLUMN TEST1'; END IF; end; 字段名是保存在sys.col$中,但是一般开发人员没权限,但是会有一个视图,一般情况下视图名为al…
update  sales_report set region =  REGEXP_REPLACE(region,  '( ){1,}', '')…
Oracle 增加修改删除字段 添加字段的语法:alter table tablename add (column datatype [default value][null/not null],….); 修改字段的语法:alter table tablename modify (column datatype [default value][null/not null],….); 删除字段的语法:alter table tablename drop (column); 添加.修改.删除多列的话…
这篇文章主要介绍了oracle表增加字段.删除表字段修改表字段的使用方法,大家参考使用吧   添加字段的语法:alter table tablename add (column datatype [default value][null/not null],….); 修改字段的语法:alter table tablename modify (column datatype [default value][null/not null],….); 删除字段的语法:alter table tablen…
SET UNUSED的用法 原理:清楚掉字典信息(撤消存储空间),不可恢复.    可以使用 SET UNUSED选项标记一列或者多列不可用.    使用DROP SET UNUSED选项删除被被标记为不可用的列. 语法:    ALTER TABLE table SET UNUSED (COLlist多个)或者 ALTER TABLE table SET UNUSED COLUMN col单个;    ALTER TABLE table DROP UNUSED COLUMNS; set unu…
Oracle 增加修改删除字段 添加字段的语法:alter table tablename add (column datatype [default value][null/not null],….); 修改字段的语法:alter table tablename modify (column datatype [default value][null/not null],….); 删除字段的语法:alter table tablename drop (column); 添加.修改.删除多列的话…
添加字段的语法:alter table tablename add (column datatype [default value][null/not null],….); 修改字段的语法:alter table tablename modify (column datatype [default value][null/not null],….); 删除字段的语法:alter table tablename drop (column); 添加.修改.删除多列的话,用逗号隔开. 使用alter…