Application Containers
Lab 6: Durable Location Transparency
Overview
Lab6 demonstrates "durable location transparency".
In Lab5 we saw how Proxy PDBs can provide location transparency. The Proxy PDBs
for the Application Root Replicas (ARRs) provided local context (in the master
Application Root) for the ARRs, which are physically located in a different
CDB. This is a good example of location transparency. In this lab, we see how
these ARR Proxies can provide "durable location transparency. That is,
location transparency that survives the physical reconfiguration of the
Application Estate – specifically by relocating an Application PDB for a particular franchise from one CDB to another. Let's get
started!
Execution
- Open a terminal window
- Change directory to /u01/HOL/app_containers/
- source the environment. At command prompt execute source cdb1.env
- sqlplus /nolog
- At the SQL prompt execute SQL>@06.Durable_Location_Transparency.sql
Review of Application Container Lab5:
In this lab, we have demonstrated "Durable Location Transparency".
1. We executed some application code – in this case aggregating revenue across all franchises.
2. Then we relocated of the franchises to another CDB (without incurring any application outage – the PDB remained open read/write during this operation
3. We re-executed the same application code. It continued to work, despite the relocation of one of the Application PDBs.
In a SaaS operation we typically operate with large number of Application PDBs. On-going operations – load balancing, hardware refreshes, migrations to the Cloud – are going to involve relocation of PDBs. With this in mind, durable location transparency becomes an important capability from the perspective of high availability. Even if a database were technically available, if you can't find it (because it's moved), it might as well be offline. Durable location transparency, enabled via Proxy PDBs of Application Root Replicas (ARRs), is a very important High Availability feature.
Detailed Steps
Phase 1: Run application query: Order volume by franchise.
Lab6_Campaign_Performance.sql runs a query to retrieve order volume by franchise for a specified campaign. Let's print it out. Notice that this is a containers() query, aggregating order volume across all franchises. Of course, Walt's Malts has now expanded beyond a single CDB! Notice also the use of the pseudo-column CDB$Name. This shows from which CDB the data is retrieved. Run the script to execute the query. Now we're going to do some load balancing. We're going to relocate franchise Tahoe from CDB1 to CDB2. Specifically we're going to relocate it to ARR wmStore_West. (Perhaps we could also think of this operation in terms of moving the Application PDB to the physically nearest CDB to minimize latency.) Here we'll use the PDB relocate capability, demonstrated in other Labs.
Phase 2. Relocate PDB Tahoe from wmStore_Master to wmStore_West
Remember that PDB relocate is a "pull" operation. Therefore we need to connect to the target ARR. Initiate the online relocation of franchise Tahoe. Complete the online relocation by opening the PDB in its new location. Now, having relocated franchise Tahoe to CDB2, we're going to re-execute our application query. Pay close attention to the results of this query and compare them to the results from the first time it was run.
Phase 3: Re-run application query:
Notice that the results are identical, with the sole exception that data for franchise Tahoe is now retrieved from CDB2.
Click Here to Go to Lab 7