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!

Table in app container with share=metadata shares data with PDB

vibha shrivastava-OracleMay 13 2019 — edited May 14 2019

I am trying to see different sharing mode with application container. Working on Oracle 18c. I am working on a small test case where I created a table with share=metadata and inserted a record in this. When I sync this application with PDB and select from this table - I expect to see no data.  But I can see the record inserted in the app container. I can even update it, then how is this mode different from extended data sharing mode ? Also all the document suggest that only the meta data should be shared ? then why app container data should be shared with pdb ? Here is my testcase.

CREATE PLUGGABLE DATABASE appcon2 AS APPLICATION CONTAINER ADMIN USER app_admin IDENTIFIED BY Password1;

ALTER PLUGGABLE DATABASE appcon2 OPEN;

ALTER SESSION SET container = appcon2

CREATE PLUGGABLE DATABASE apppdb2 ADMIN USER pdb_admin IDENTIFIED BY Password1;

ALTER PLUGGABLE DATABASE apppdb2 OPEN;

----      Create an application tst_app in application container app_root

ALTER PLUGGABLE DATABASE APPLICATION tst_app BEGIN INSTALL '1.0';

--- Create common application user tst_app_user1

CREATE USER tst_app_user1 IDENTIFIED BY oracle;

GRANT CREATE SESSION, create procedure, CREATE TABLE,unlimited tablespace TO tst_app_user1;

CREATE TABLE tst_app_user1.customers SHARING=METADATA

( cust_id    NUMBER constraint cust_pk primary key,

     cust_name  varchar2(30),

     cust_add   varchar2(30)

);

insert into tst_app_user1.customers  values ('0', 'Root Customer0', 'Chicago');

commit;

ALTER PLUGGABLE DATABASE APPLICATION tst_app END INSTALL '1.0';

Usecase 1

=================

ALTER SESSION SET container = apppdb2;

alter pluggable database application tst_app sync

select * from tst_app_user1.customers;

----I do not expect anything but following record appears

   CUST_ID CUST_NAME                  CUST_ADD          

---------- ------------------------------ --------------

  0         Root Customer0             Chicago

insert into tst_app_user1.customers  values ('1', 'pdB1 Customer0', 'California');

commit;

SELECT * FROM tst_app_user1.customers

0 Root Customer0 Chicago

1 pdB1 Customer0 California

Can someone please explain what am I missing

Comments
Post Details
Added on May 13 2019
4 comments
1,596 views