Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Default Container Target not working

User_A7RKTJun 9 2017 — edited Jun 10 2017

Hi guys,

I am testing the Default Containers Target in Oracle 12.2 CDB database (in Linux 6.764-bit)

I have two PDBs: PDB1 and PDB2

I have the LOGIN_AUDIT table owned by a common user (C##USER1) in the two PDBs and in the root as well.

I changed the default container target to PDB2:

conn / as sysdba

ALTER DATABASE CONTAINERS DEFAULT TARGET = (PDB2);

When I connect to the root as the common user that owns the table and execute an update statement on the table LOGIN_AUDIT, the update affects the table in the PDB1 (not the default container target PDB2).

UPDATE CONTAINERS(LOGIN_AUDIT) SET USER_ID='USERx';

SQL> conn C##USER1/oracle

Connected.

SQL> UPDATE CONTAINERS(LOGIN_AUDIT) SET USER_ID='USERx';

3 rows updated.


SQL> SELECT USER_ID FROM LOGIN_AUDIT;

no rows selected

-- this is pdb1:

SQL> SELECT USER_ID FROM CONTAINERS(LOGIN_AUDIT) WHERE CON_ID=3;

USER_

-----

USERx

USERx

-- this is pdb2:

SQL> SELECT USER_ID FROM CONTAINERS(LOGIN_AUDIT) WHERE CON_ID=4;

USER_

-----

USER1

USER2

USER3

Attached is the script to re-produce the issue.

Can anyone explain to me please where I have gone wrong?

This post has been answered by Franck Pachot on Jun 10 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2017
Added on Jun 9 2017
5 comments
599 views