Row movement not working in partitioned table based on virtual columns (Doc ID 953159.1)

Last updated on FEBRUARY 02, 2017

Applies to:

Oracle Server - Enterprise Edition - Version: 11.1.0.7 and later   [Release: 11.1 and later ]
Information in this document applies to any platform.

Symptoms

New 11g feature partitioning on virtual columns is not working properly.

The row movement when data is changed is not being performed.

This is only being reported on partitions based on virtual columns, causing row movement to not be moved and, as per partition pruning, returning wrong results

Problem reproduces consistently, despite depending on the number of columns and position of virtual one, it may report correct results.

As it can be seen on this test:
SQL> CREATE TABLE t (
d1 NUMBER,
2 3 d2 NUMBER,
4 d3 NUMBER,
5 d4 NUMBER,
6 d5 NUMBER,
7 d6 NUMBER,
8 d7 NUMBER,
9 -- d8 NUMBER,
10 n1 NUMBER,
11 n2 AS (CASE n1 WHEN 1 THEN 1 WHEN 2 THEN 2 ELSE 0 END) VIRTUAL
12 )
13 PARTITION BY LIST (n2) (
14 PARTITION zero VALUES (0),
15 PARTITION one VALUES (1),
16 PARTITION two VALUES (2)
17 )
18 ENABLE ROW MOVEMENT;
Table created.

SQL> INSERT INTO t (n1) VALUES (1);
1 row created.

SQL> COMMIT;
Commit complete.

SQL> SELECT rowid, n1, n2 FROM t;
ROWID N1 N2
------------------ ---------- ----------
AAAVEXAABAAARHxAAA 1 1

SQL> SELECT rowid, n1, n2 FROM t PARTITION (zero);
no rows selected

SQL> SELECT rowid, n1, n2 FROM t PARTITION (one);
ROWID N1 N2
------------------ ---------- ----------
AAAVEXAABAAARHxAAA 1 1

SQL> SELECT rowid, n1, n2 FROM t WHERE n2 = 0;
no rows selected

SQL> SELECT rowid, n1, n2 FROM t WHERE n2 = 1;
ROWID N1 N2
------------------ ---------- ----------
AAAVEXAABAAARHxAAA 1 1

SQL> UPDATE t SET n1 = 0;
1 row updated.

SQL> COMMIT;
Commit complete.

SQL> SELECT rowid, n1, n2 FROM t;
ROWID N1 N2
------------------ ---------- ----------
AAAVEXAABAAARHxAAA 0 0

SQL> SELECT rowid, n1, n2 FROM t PARTITION (zero);
no rows selected

SQL> SELECT rowid, n1, n2 FROM t PARTITION (one);
ROWID N1 N2
------------------ ---------- ----------
AAAVEXAABAAARHxAAA 0 0

SQL> SELECT rowid, n1, n2 FROM t WHERE n2 = 0;
no rows selected

SQL> SELECT rowid, n1, n2 FROM t WHERE n2 = 1;
ROWID N1 N2
------------------ ---------- ----------
AAAVEXAABAAARHxAAA 0 0


ROWID hasn't change (so no row movement happened) and, even more critical,
selecting from virtual column (n2) is returning wrong data.

Changes

This behavior is not reproducing for partitions based on "real" columns, only on virtual ones (which is a new feature in Oracle 11g)

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms