[20131125]Partition, compress and drop column (ORA-39726).txt

[20131125]Partition, compress and drop column (ORA-39726).txt

http://www.dbaglobe.com/2013/11/partition-compress-and-drop-column-ora.html

SCOTT@test> @ver
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

1.测试1:
drop table t1_compression purge;
create table t1_compression (id number, name varchar2(30)) partition by range (id) interval (100000) (partition p1 values less than (100000) ) compress;

insert into t1_compression select object_id,object_name from dba_objects where object_id is not null ;
commit;

col partition_name for a20
select partition_name,compression,compress_for from user_tab_partitions where table_name='T1_COMPRESSION';
PARTITION_NAME       COMPRESS COMPRESS_FOR
-------------------- -------- ------------
P1                   ENABLED  BASIC
SYS_P3205            ENABLED  BASIC
SYS_P3206            ENABLED  BASIC

SCOTT@test> alter table t1_compression drop column name;
alter table t1_compression drop column name
                                       *
ERROR at line 1:
ORA-39726: unsupported add/drop column operation on compressed tables

SCOTT@test> alter table t1_compression set unused column name;
Table altered.

SCOTT@test> desc t1_compression;
Name  Null?    Type
----- -------- --------
ID             NUMBER

SCOTT@test> alter table t1_compression drop unused columns;
alter table t1_compression drop unused columns
*
ERROR at line 1:
ORA-39726: unsupported add/drop column operation on compressed tables

SCOTT@test> alter table t1_compression move partition p1 nocompress;
Table altered.

SCOTT@test> select partition_name,compression,compress_for from user_tab_partitions where table_name='T1_COMPRESSION';
PARTITION_NAME       COMPRESS COMPRESS_FOR
-------------------- -------- ------------
P1                   DISABLED
SYS_P3205            ENABLED  BASIC
SYS_P3206            ENABLED  BASIC
--仅仅P1分区取消了compress特性.

SCOTT@test> alter table t1_compression move partition SYS_P3205  nocompress;
Table altered.

SCOTT@test> select partition_name,compression,compress_for from user_tab_partitions where table_name='T1_COMPRESSION';
PARTITION_NAME       COMPRESS COMPRESS_FOR
-------------------- -------- ------------
P1                   DISABLED
SYS_P3205            DISABLED
SYS_P3206            ENABLED  BASIC

alter table t1_compression move partition SYS_P3206  nocompress;
...

SCOTT@test> select partition_name,compression,compress_for from user_tab_partitions where table_name='T1_COMPRESSION';
PARTITION_NAME       COMPRESS COMPRESS_FOR
-------------------- -------- ------------
P1                   DISABLED
SYS_P3205            DISABLED
SYS_P3206            DISABLED

SCOTT@test> alter table t1_compression drop unused columns;
alter table t1_compression drop unused columns
*
ERROR at line 1:
ORA-39726: unsupported add/drop column operation on compressed tables

--已经取消了压缩特性,依旧不能删除unused columns.

SCOTT@test> column column_name format a30
SCOTT@test> select column_id, segment_column_id, internal_column_id, column_name, hidden_column, virtual_column from user_tab_cols where table_name = 'T1_COMPRESSION';
 COLUMN_ID SEGMENT_COLUMN_ID INTERNAL_COLUMN_ID COLUMN_NAME                    HID VIR
---------- ----------------- ------------------ ------------------------------ --- ---
                           2                  2 SYS_C00002_13112515:04:52$     YES NO
         1                 1                  1 ID                             NO  NO

2.测试2:

drop table t1_compression purge;
create table t1_compression (id number, name varchar2(30)) partition by range (id) interval (100000) (partition p1 values less than (100000) ) compress for oltp;
insert into t1_compression select object_id,object_name from dba_objects where object_id is not null ;
commit;

SCOTT@test> select partition_name,compression,compress_for from user_tab_partitions where table_name='T1_COMPRESSION';
PARTITION_NAME       COMPRESS COMPRESS_FOR
-------------------- -------- ------------
P1                   ENABLED  OLTP
SYS_P3207            ENABLED  OLTP
SYS_P3208            ENABLED  OLTP

SCOTT@test> alter table t1_compression drop column name;
Table altered.

时间: 2024-10-23 20:17:03

[20131125]Partition, compress and drop column (ORA-39726).txt的相关文章

[20131125]Partition, compress and drop column (ORA-39726)之2.txt

[20131125]Partition, compress and drop column (ORA-39726)之2.txt http://www.dbaglobe.com/2013/11/partition-compress-and-drop-column-ora.html 在12c下测试看看,结果如何? SCOTT@ztest> @ver

OCP1z0-047 :drop column

如下实验: gyj@OCM> Create table emp(  2    Empno     number(4)    not null,  3    First_name  varchar2(20),  4    Last_name  varchar2(20),  5    Salary      number(10,2),  6    Deptno     number(2)  7  ); Table created. gyj@OCM> insertinto emp values(10

oracle中unused column 和 drop column操作实质

unused column和drop column的操作从本质上讲是不一样的,unused是通过变更数据字典的信息让sql无法访问到column,而drop是直接在物理数据层做了变动.这里的操作后台跟踪可以用event 10046去验证,这里不做描述. 下面通过实验的方式验证unused和drop column的操作对比情况: 1.创建测试表 SQL> grant dba to luda; Grant succeeded. SQL> conn luda/luda Connected. SQL&

[20160414]分析drop column.txt

[20160414]分析drop column.txt --昨天看了惜分飞关于删除字段的测试,自己也重复测试看看. --原链接:http://www.xifenfei.com/2016/04/%E5%88%86%E6%9E%90drop-col%E5%AF%B9%E4%BA%8E%E6%95%B0%E6%8D%AE%E5%AD%98%E5%82%A8%E5%9D%97%E5%81%9A%E4%BA%86%E4%BB%80%E4%B9%88.html 1.环境: SCOTT@book> @ &

[20160512]tnsnames.ora配置文件.txt

[20160512]tnsnames.ora配置文件.txt --今天再次解决1个tnsnames.ora配置文件.看来这个文件最好不要手工修改!! --通过例子来说明: 78 =   (DESCRIPTION =     (ADDRESS_LIST =       (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.78)(PORT = 1521))     )     (SDU = 32768)     (CONNECT_DATA =       (

[20111227]Alter database datafile offline drop后的恢复.txt

1.准备测试: CREATE TABLESPACE tools DATAFILE   '/u01/app/oracle11g/oradata/test/tools01.dbf' SIZE 64M AUTOEXTEND ON NEXT 1M MAXSIZE UNLIMITED LOGGING PERMANENT EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON;

[20120705]sqlplus 的column xxx noprint.txt

sqlplus中有时候某列很长,不想显示,一般使用column xxx format a10,限制输出的长度.实际上column 还可以加入参数noprint,使该行不显示,例子如下: SQL> help column  COLUMN  ------  Specifies display attributes for a given column, such as:      - text for the column heading      - alignment for the colum

Oracle 错误总结及问题解决 ORA

参考地址 ORA-00001: 违反唯一约束条件 (.)错误说明:当在唯一索引所对应的列上键入重复值时,会触发此异常.ORA-00017: 请求会话以设置跟踪事件ORA-00018: 超出最大会话数ORA-00019: 超出最大会话许可数ORA-00020: 超出最大进程数 ()ORA-00021: 会话附属于其它某些进程:无法转换会话ORA-00022: 无效的会话 ID:访问被拒绝ORA-00023: 会话引用进程私用内存:无法分离会话ORA-00024: 单一进程模式下不允许从多个进程注册

MySQL 4.1.0 中文参考手册 --- 6.5 数据定义: CREATE、DROP、ALTER

mysql|参考|参考手册|数据|中文 MySQL 4.1.0 中文参考手册 --- 犬犬(心帆)翻译 MySQL Reference Manual for version 4.1.0-alpha. 6.5 数据定义: CREATE.DROP.ALTER6.5.1 CREATE DATABASE 句法 CREATE DATABASE [IF NOT EXISTS] db_name CREATE DATABASE 以给定名字创建一个数据库.允许的数据库名规则在章节 6.1.2 数据库.表.索引.列