Skip to Main Content

Update activity on a Application container , partitioning table

Arturo GutierrezOct 24 2017 — edited Oct 26 2017

Hello,

Testing the ability to define a PDB partitioning using the container map, I see that work fine for select statements, but not for Updates.

Let me show:

I've the emp table partitioned across 3 PDBS:

SQL> select empno, deptno , con_id from emp;

EMPNO DEPTNO CON_ID
----- ------ ------
7782     10     16
7839     10     16
7934     10     16
7369     20     17
7566     20     17
7788     20     17
7876     20     17
7902     20     17
7499     30     15
7521     30     15
7654     30     15
7698     30     15
7844     30     15
7900     30     15

14 rows selected.

Now, If I use the partitiong key to filter:

SQL>  select empno, deptno , con_id from emp where deptno=10;

EMPNO DEPTNO CON_ID
----- ------ ------
7782     10     16
7839     10     16
7934     10     16

This work fine.

However If I try :

SQL> update emp set sal=sal*10 where deptno=10;

0 rows updated. ---> No Rows updated,

To do this, I need indicate CONTAINERS CLAUSE:

SQL> update containers(emp) set sal=sal*1.10 where con_id = 16;

3 rows updated.

Same, happen with delete.

Also, I try to update the partitioning key to see if the rows move to another PDB.

update  containers(emp) set deptno=10 where  con_id=17

*

ERROR at line 1:

ORA-02291: integrity constraint (SCOTT.FK_DEPTNO) violated - parent key not found

ORA-02063: preceding line from RESEARCH

Is this a restricction of this reléase, or I need set any parameter to allow update operations?

Thanks

Arturo

Comments
Post Details
Added on Oct 24 2017
6 comments
334 views