Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
oracle_multitenant_application_container [2021/11/14 18:47] – [Create Application Container & PDBs] andonovjoracle_multitenant_application_container [2021/11/14 20:45] (current) – [Create & Set the container MAP] andonovj
Line 527: Line 527:
 SQL> CREATE TABLE c##andonovj.containermap ( SQL> CREATE TABLE c##andonovj.containermap (
 country VARCHAR2(30) NOT NULL) country VARCHAR2(30) NOT NULL)
-PARTITION BY LIST (region) (+PARTITION BY LIST (country) (
 PARTITION north VALUES ('CANADA','USA'), PARTITION north VALUES ('CANADA','USA'),
 PARTITION central VALUES ('GUATEMALA','NICARAGUA'), PARTITION central VALUES ('GUATEMALA','NICARAGUA'),
Line 579: Line 579:
  
 <Code:bash> <Code:bash>
-SQL> alter session set container=appcdb;+SQL> alter session set container=north;
 Session altered. Session altered.
 SQL> insert into c##andonovj.revenue values ('CANADA',1000); SQL> insert into c##andonovj.revenue values ('CANADA',1000);
 SQL> insert into c##andonovj.revenue values ('USA',2000); SQL> insert into c##andonovj.revenue values ('USA',2000);
 +SQL> commit;
 +SQL> alter session set container=central;
 +Session altered.
 +SQL> commit;
 SQL> insert into c##andonovj.revenue values ('GUATEMALA',3000); SQL> insert into c##andonovj.revenue values ('GUATEMALA',3000);
 SQL> insert into c##andonovj.revenue values ('NICARAGUA',4000); SQL> insert into c##andonovj.revenue values ('NICARAGUA',4000);
 +SQL> alter session set container=south;
 +Session altered.
 +SQL> commit;
 SQL> insert into c##andonovj.revenue values ('ARGENTINA',5000); SQL> insert into c##andonovj.revenue values ('ARGENTINA',5000);
 SQL> insert into c##andonovj.revenue values ('BRAZIL',6000); SQL> insert into c##andonovj.revenue values ('BRAZIL',6000);
 SQL> commit; SQL> commit;
-SQL> ALTER PLUGGABLE DATABASE APPLICATION Application_JULIEN ALL SYNC; 
 </Code> </Code>
  
 +After that you can end the upgrade or installation and sync every application PDB
  
 Now, when you select from that table, the query will be redirect to all PDBs and thus the data will be sharded across the PDBs. If the PDBs are proxy PDBs, it can be even distributed in different continents. Now, when you select from that table, the query will be redirect to all PDBs and thus the data will be sharded across the PDBs. If the PDBs are proxy PDBs, it can be even distributed in different continents.
  • oracle_multitenant_application_container.1636915660.txt.gz
  • Last modified: 2021/11/14 18:47
  • by andonovj