Showing posts with label Multitenant. Show all posts
Showing posts with label Multitenant. Show all posts

Monday, November 18, 2019

OOW 2019 - Significant Oracle Multitenant Announcements

Background

During Oracle OpenWorld 2019, there were significant announcements related to my favorite Oracle option in recent years - the Oracle Multitenant option. In this blog post I will summarize the highlights.

Oracle 19c Exciting News

Prior to Oracle 19c (Oracle 12c through 18c), in order to use pluggable databases (usually for consolidation purposes), one had to own the multitenant option which is an extra option (=cost) on top of the oracle enterprise edition. There was also a single-tenant option which allows running the multitenant architecture but with only one pluggable database; hence, single-tenant. You can read more about that in a blog post I wrote about Oracle's deployment options (Non-CDB, Single-Tenant, Multitenant).

Starting with Oracle 19c, customers can run 3 pluggable databases with no extra cost, i.e. without the multitenant license.
























Oracle 20c - End of Era?

For years the non-cdb architecture has been defined officially by Oracle as deprecated and "may be desupported in the future". In OOW19, it was announced that the next Oracle release (20c) will be the first one that the non-cdb architecture will be officially desupported.


Sunday, December 2, 2018

Oracle Multitenant Enhancements in 18c - The Good and The Bad

Introduction
Oracle Multitenant Option is the one of the most exciting enhancements in the Oracle Database probably in the last decade. It's definitely my favorite feature since 12c due to the elegant way it simplifies database consolidation projects. For more information about Oracle Multitenant, check out my blog post: http://oracledbpro.blogspot.com/2016/10/otn-appreciation-day-oracle-multitenant.html


Oracle Multitenant 18c New Features - The Good
There are several nice Oracle Multitenant related enhancements in 18c which I believe worth mentioning in this blog post

  • Refreshable PDB Switchover - In Oracle 12c Release 2, Oracle introduced the refreshable PDB feature which allows to refresh a cloned PDB either on-demand or on a scheduled frequency. You can think of it as a poor-man standby because it's not designed for failover but more for having a cloned environment updated without having to completely clone the entire database every time (which may take a while). This could be very helpful for reporting/query offloading. Oracle 18c took this feature one step ahead and now enables to perform a switchover between the 2 PDBs which could be useful for load balancing purposes (planned switchover) as well as high availability when a PDB fails. Please note that this feature is not a replacement for data guard and should not be used as a DR solution for mission critical applications
  • Enhanced Data Guard Integration - In Oracle 12c, when Multitenant was configured in a data guard environment there were some challenges. Oracle 12cR2 introduced the hot clone feature which was a huge improvement as it allowed cloning a PDB with no downtime; however, when hot cloning a PDB, it was not performed on standby - in other words, it wasn't replicated also in the standby CDB (similar to specifying standbys=none). In Oracle 18c this challenge has been addressed by additional steps which required to be done. For more details, see: https://www.oracle.com/technetwork/database/multitenant/learn-more/multitenantwp18c-4396158.pdf
  • Snapshot Carousel - Stores historical point in time copies of pluggable databases (up to 8 in the current 18c release). This is useful for historical debugging of data related issues as well as for point-in-time recovery of a PDB (similar to flashback database feature, but without enabling flashback database)
  • CDB Fleet Management - CDB allows to manage many PDBs as one (up to 4096 PDBs in Oracle Exadata and Oracle cloud, and 252 for every other deployment) - which is the main benefit of database consolidation. Now, in Oracle 18c using this new feature it's possible to manage many CDBs as one. I personally think this could be useful for the very large enterprise companies who manage huge amount of databases)

Oracle Multitenant 18c New Features - The Bad
According to Oracle documentation, all the above features (except the enhanced data guard integration), are only available either on Oracle Exadata or Oracle cloud. Most of the Oracle customers probably don't use neither Oracle Exadata nor Oracle cloud which makes these features unavailable for most Oracle customers. I hope this will be changed in the future.

Useful Links

Wednesday, March 29, 2017

Changes in AWR behavior in versions 12cR1 and 12cR2

Introduction

AWR reports are available as part of the Diagnostics pack (extra cost option to the Enterprise Edition). AWR reports are commonly used by Oracle DBAs and they can be extremely useful when diagnosing performance issues. In this short article I will show the differences between AWR in version 12c Release 1 (12.1) and 12c Release 2 (12.2)


12c Release 1 (12.1) with Multitenant

In Oracle 12c Release 1, Oracle introduced the Multitenant architecture (I've posted a separate article to cover the great benefits of Oracle Multitenant. Read more here). However, the main challenge with Oracle 12cR1 is that AWR data is stored at the CDB$ROOT container level. This has several implications:
  • AWR reports are available only at CDB level - it is not possible to run AWR for a specific pluggable database.
  • AWR management operations (e.g. snapshots schedule, data retention, taking manual snapshots, purging snapshots) could be done only at CDB level.
  • Unplugged PDB does not contain AWR information, so when unplugging a PDB and plugging it into a different CDB all the AWR data will be lost.
Having said that, it's important to mention that even that it is only possible to generate AWR reports at CDB level, Oracle added column "PDB Name" to the tables in the AWR so it allows us to understand to which PDB the information is associated with. Here is an example:



12c Release 2 (12.2) with Multitenant

Good new is that in Oracle 12c Release 2, Oracle added AWR at PDB-Level meaning that AWR information will also be stored in each PDB (under SYSAUX tablespace). This has several implications:
  • AWR reports are available at both CDB and PDB level
  • AWR management operations (e.g. snapshots schedule, data retention, taking manual snapshots, purging snapshots) can be done at both CDB and PDB level
  • Unplugged PDB does contain AWR information, so when unplugging a PDB and plugging it into a different CDB all the AWR data will be available.
Let's see an example of how it looks like when running AWR report in 12c Release 2:


As you can see, Oracle enables us to choose whether we would like to run a CDB-level AWR report by specifying "AWR_ROOT" which is the default, or running a PDB-level AWR report by specifying "AWR_PDB". If you choose PDB-level AWR, Oracle will generate a report that displays performance data only for a particular PDB, as follows:


Pro Tip

In Oracle 12c Release 2, Oracle will automatically create AWR snapshots only at CDB-level by default. If you would like to change this default behavior and enable automatic AWR snapshots for PDBs, you would need to alter the new AWR_PDB_AUTOFLUSH_ENABLED parameter which can be set at either CDB level or PDB level.

Sunday, December 18, 2016

My favorite Oracle 12cR2 Multitenant Enhancements

Introduction

Oracle 12c Release 1 (12.1) introduced the new Multitenant architecture which is the highlight feature of Oracle 12c. The main purpose of Multitenant architecture is to simplify Database Consolidation by allowing to have multiple Pluggable Databases which are associated to the same instance or instances (in case of RAC). Each pluggable database is a self-contained, independent Database with its own schemas, data, etc. Pluggable Database is a “regular” Database from the application standpoint. This is a new paradigm compared to previous releases (i.e. pre 12c) which allowed to have only one single database associate to an Oracle instance. You can read more about Multitenant in my blog post here.

Oracle Multitenant 12c Release 1 - The Main Challenges

Even though Oracle 12c Multitenant announcement was very exciting, it still had several areas in the first release of Oracle 12c (i.e. 12cR1) which were problematic for DBAs - I've wrote a blog post this named "Where Oracle 12c Multitenant can (and should) be improved". The main items are:
  • Flashback Database - In Oracle 12cR1 there is no PDB-level flashback database. It is only possible to flash back the entire Container Database (CDB) with all its associated PDBs. This effectively means that all the PDBs lose data during a Flashback Database operation.
  • Memory Resource Management - Oracle 12c allows to ensure quality of service by defining resource plan via Oracle DBRM feature (Database Resource Manager) in order to prioritize CPU resources to pluggable databases across the container; however, in Oracle 12cR1 there is no way to limit or prioritize the memory usage by competing pluggable databases within the same CDB.
  • PDB Cloning - Oracle 12c allows fast provisioning by cloning a PDB from another PDB within the same CDB or by cloning a PDB from another PDB in a remote CDB. The only problem is that Oracle 12cR1 support "cold cloning", i.e. the source PDB must be in a READ ONLY mode which essentially means that a down time is required during the clone operation. 

My Favorite Oracle Multitenant 12c Release 2 Enhancements

Based on Oracle's "Oracle Multitenant 12cR2 New Features" white paper, all of the above challenges were addressed in the latest 12cR2:
  • Flashback Database - Flashback PDB is now fully supported with Oracle 12R2. In order to enable this feature, Oracle introduced the concept of local undo in 12cR2 which allows a PDB to have its own undo (In Oracle 12cR1 the undo was shared for the entire CDB). Please note that the shared undo mode is still supported in 12cR2.
  • Memory Resource Management - Now with Oracle 12cR2, it is possible to set the following parameters at PDB level (which were previously modifiable only at CDB level):
    • SGA_TARGET
    • SGA_MIN_SIZE (new in 12.2)
    • DB_CACHE_SIZE
    • DB_SHARED_POOL_SIZE
    • PGA_AGGREGATE_LIMIT
    • PGA_AGGREGATE_TARGET
  • PDB Cloning - "Hot Clone" is now supported with Oracle 12cR2, i.e. it is possible to clone a PDB while the source PDB is in OPEN READ WRITE mode; hence, the on-line cloning is available without interrupting operations in the source PDB. 

Additional cool 12cR2 Multitenant Enhancements 

Additional great 12c Multitenant features which I believe worth mentioning are:
  • 4K PDBs Per Container - In Oracle 12cR1, the maximum number user pluggable databases per CDB was 252. Now with Oracle 12cR2, the limit has been increased to 4,096.
  • Lockdown profiles - This feature allows to define granular control over network access, common users, common objects, and administrative features. For example, it can be used to limit developers that in a specific PDB, they can execute ALTER SYSTEM SET command only to set a specific parameter like plsql_warnings. This is done by defining a lockdown profile and apply it to the PDB. This feature could be very useful in some cases as we probably don't wont to grant the ALTER SYSTEM SET to developers as they should not have permissions to change other parameters.
  • Character Set at PDB Level - In Oracle 12cR1, character set was defined at CDB level, i.e. all PDBs within the same CDB must be defined with the same character set. Now with Oracle 12cR2, it is possible to define different character sets for different PDBs with the same CDB.
  • AWR at PDB Level - In Oracle 12cR1, all the AWR data was stored at the CDB root container (CDB$ROOT), meaning that if a DBA unplugs a PDB and plugs it into a different CDB, all the AWR data will be lost. Now with Oracle 12cR2, AWR data is available at PDB level.
  • Data Guard Broker - Now allows to perform a "PDB" level failover. The way it is implemented is by having 2 pairs of CDBs in 2 servers - one pair for the primary and another pair for the standby, with replication in opposite directions. Once a PDB fails, the standby counterpart can be moved to the other CDB within the same server. Since no physical movement of copying files is required (as this involves shared storage), this process can be done with minimum downtime. This feature effectively allows a PDB-level failover to standby without having to fail over the entire CDB.
  • Refreshebale PDB - This new feature allows to have a cloned PDB that can be refreshed from another PDB either manually (on-demand) or automatically (scheduled refresh). The way this works is by creating a full clone at first stage (which can be taken with no downtime now with the new 12cR2 hot clone feature), and then there is no need to perform a full clone again because this feature allows applying incremental redo since the last clone or the last refresh time. This could be very useful in scenarios that the source PDB is very large and we would like to avoid creating a full clone to the entire PDB from scratch every time, because this process takes a long time when the PDB is very large. By having to apply only the incremental redo since last refresh or last clone, the process of having up to date cloned PDB for dev/test purposes becomes much faster and easier.

Summary

Oracle 12cR2 introduced several significant Multitenant enhancements. In this post, I've listed my favorite Oracle 12cR2 Multitenant enhancements. Note that Oracle 12cR2 is currently available only in Oracle Cloud and not in "regular" on premise deployments.

Tuesday, October 11, 2016

OTN Appreciation Day: Oracle Multitenant

I've decided to dedicate my OTN Appreciation Day blog post to Oracle Multitenant.

Why Multitenant? 

Because Database Consolidation is a big challenge that many organizations are faced with.
Before Oracle 12c there were several approaches for implementing Database consolidation such as server consolidation - i.e. taking different databases from different servers and consolidating them into one single box (either virtual of physical). The problem with this approach is that it still leaves the DBAs with several different databases to manage (back up, upgrade, monitor, etc).
Another approach is to consolidate several databases into one single database where each database has its own schema or set of schemas - now, we need to manage only one Oracle Database.
The problem with this approach is that there are several challenges when doing database consolidation, let’s review some of them.

  • Name Collisions - Imagine that you have identical schema names or public synonyms across different databases. As you know public synonym and schema names must be unique in a Database.
  • Security - When consolidating different Database into one Database, a user with strong permissions ("SELECT ANY TABLE" system privilege, "DBA" role, etc.) can view data of all the schemas in the Database, and perhaps you don't want to DBA for one specific application will be able to access data of all the other applications.
  • Upgrades - You cannot perform schema-level upgrade. You can only upgrade the entire Database, but perhaps other applications (other schemas) are not ready for the upgrade 
  • Point In-Time Recovery - Imagine that a user truncated a table in a specific schema - in that case, we cannot use the FLASHBACK TABLE feature or FLASHBACK DROP so we may consider performing point in-time recovery, but the problem here is that we cannot use RMAN or user-managed backup to perform a point in-time recovery for a specific schema, we can only perform point in-time recovery for the entire Database.
In the past, DBAs could configure either a single instance or RAC, but in both cases there was only one database, so there was 1:1 relationship (one instance, one database) between database to instance in case of a single instance, but 1:N relationship (many instances, one database) between database to instance in case of RAC. In Oracle 12c with the multitenant option you can have many different pluggable databases in a single instance environment or a RAC environment.
In a multitenant architecture, these is one instance with many pluggable databases. Each Pluggable Database is a self-contained, independent Database with its own schemas, data, etc. Pluggable Database is a “regular” Database from the application standpoint. In addition, there is one root container which stores Oracle-metadata that is shared across all the PDBs like PL/SQL packages, for example, the DBMS_SYSTEM package resides only in the root container. All the PDBs can be plugged into the root container.

The advantage of Oracle Multitenant architecture is that from one hand, DBAs can manage all of the Pluggable Databases as one - Backup all PDBs at once, create a Data Guard for all the PDBs at once, etc. so it makes DBAs life much easier :) On the other hand, since PDBs are separate entities, this architecture offers database security and isolation. It also allow to perform granular operations such as point in-time recovery at PDB level and Flashback Database at PDB-Level (starting from version 12.2 which is currently available only as part of the Oracle Cloud service).

Summary

Oracle introduced a completely new paradigm with 12c Multitenant. This exciting feature solves many Database consolidation challenges that organizations (and DBAs) had to face in the past and it can definitely make the Oracle DBA's life much easier :)

Sunday, August 21, 2016

Where Oracle 12c Multitenant can (and should) be improved

Introduction

Since it was introduced in Oracle Database 12c, the new exciting Oracle Multitenant architecture makes the Oracle DBA's life much easier in terms of administration and management. It allows to manage many Oracle Databases as one and by doing so it solves many consolidation challenges.
In this post, I would like to review 3 items where I believe Oracle can (and should) improve its Multitenant capabiliities:
  • DBCA Installation
  • Flashback Database
  • Memory Resource Management
  • PDB Cloning

DBCA Installation

During an installation of Oracle 12c with a container database (A.K.A multitenant), DBCA doesn't allow deselecting database options and it basically force you to install all the optional database options. See the following screenshot for example:







































I think it would be nice if Oracle will allow deselecting database options because the current design has few disadvantages:
  • It makes the installation process much longer
  • It consumes more disk space
  • Installing unneeded database options may raise the chances to hit potential bugs.
I've raised an idea in the Oracle community to allow deselecting database options during Oracle 12c Multitenant installation. See: https://community.oracle.com/ideas/6778

Flashback Database

The "Flashback Database" feature is supported only at the CDB-level, and it does not allow a "granular flashback" at the PDB-level. In many cases, the requirement is to rewind one specific application (i.e. PDB), and not the entire CDB. RMAN, for example, allows a PDB point-in-time-recovery, so the same granularity should also be available in the FLASHBACK DATABASE feature. 
I've raised an idea in the Oracle community to allow using the Flashback Database feature at the PDB-level. See: https://community.oracle.com/ideas/12367

Memory Resource Management

In Oracle 12c, Oracle Resource Manager has been enhanced to support Multitenant by allowing to limit and prioritize CPU resources among competing PDBs. Currently it is not possible to prioritize memory resources; For example, today we cannot specify which PDBs will have higher priority for SGA areas than other PDBs. The outcome of this is that potentially a low-priority PDB can consume most of the SGA buffers. 
I've raised an idea in the Oracle community to enhance Oracle Resource Manager to be able also to limit and prioritize memory resources among competing PDBs.


Online PDB Cloning
Cloning a PDB is a great feature which allows fast provisioning by creating a copy of a PDB either from another PDB within the same CDB, or from another PDB in a remote CDB. The problem with this feature is that cloning a PDB requires the source PDB to be in OPEN READ ONLY mode which essentially requires a down time as no DML/DDL operations are allowed on PDB when it's in a READ ONLY mode.


Summary

Generally speaking, Oracle multitenant is a full-featured product with many advantages. I would definitely recommend every Oracle DBA to upgrade to Oracle 12c Multitenant. Yet, I believe that there are some areas where Oracle can and should improve regarding its Multitenant feature and I hope we will see some Multitenant enhancements in the upcoming Oracle release (12cR2). 

Monday, July 4, 2016

My Upcoming Webinar for DBTA (Database Trend and Applications)

I'm happy to update that I will be presenting a webinar on How Oracle 12c Multitenant Architecture Can Simplify Database Consolidation. The webcast is organized by DBTA (Database Trends and Applications).

Thursday, June 23, 2016

Oracle Database 12c Deployment Options

Introduction

Oracle Database 12c Multitenant Architecture is definitely the highlight feature of Oracle 12c. In this article we will review the Deployment Options for Oracle Database 12: Multitenant, Single Tenant, and Non-CDB.

Multitenant

Multitenant is the new paradigm in Oracle 12c which allows managing multiple Pluggable Databases in a single instance (i.e. Single Instance configuration) or multiple Pluggable Databases with multiple instances (i.e. RAC configuration). This is an extra cost option which is available only for Enterprise Edition Databases. In order to choose the Multitenant Option, check the "Create As Container Database" option in DBCA, as follows:


























Single Tenant

Single Tenant is similar to the Multitenant in terms of the architecture and pluggable databases capabilities such as unplug/plug and PDB cloning options; however, it allows having only one single Pluggable database. This option does not require the extra cost license, as opposed to the Multitenant option. 

Non-CDB

Non-CDB basically means the old pre-12c architecture. In this option there is only one single Database with one single instance (i.e. Single Instance configuration), or one single Database with multiple instances (i.e. RAC configuration). In either case, Single Instance or RAC, there is only one single Database. The concept of Pluggable Databases is irrelevant and the 12c PDB options such as unplug/plug and clone are not available. In order to use the Non-CDB option, uncheck the "Create As Container Database" option in DBCA, as follows:






























Single Tenant vs. Non-CDB

In case that you are interested in upgrading to Oracle Database 12c, but you are not interested in using the Multitenant option, you may ask yourself whether you should use Single Tenant or Non-CDB. Personally, I highly recommend on adopting  the Single Tenant due to the following reasons:
  • Unplug/Plug - With Single Tenant you could unplug your PDB and plug it into a different CDB which could simplify upgrades and migrations in many cases.
  • Fast Cloning - With Single Tenant you could fast clone your PDB to a different CDB which could simplify data migrations in many cases.
  • Deprecation of Non-CDB Architecture - As per Oracle official documentation "The non-CDB architecture is deprecated in Oracle Database 12c, and may be desupported and unavailable in a release after Oracle Database 12c Release 2. Oracle recommends use of the CDB architecture.". This means that in the future we will all have to use either Single Tenant or Multitenant, so I believe it is better to get the knowledge and skills for managing Pluggable Databases as soon as possible.

Summary

I've created the following diagram which covers the 3 deployment options in Oracle Database 12c.
























Additional Resources


Tuesday, January 5, 2016

How to view the history of your Pluggable Databases?

Introduction

Let's say you have a 12c container database with multiple pluggable databases. Some of the PDBs were created during the initial container database installation, some were cloned later and some were unplugged/plugged over the time.
A question that can be raised is how to track the history of the PDBs?

Solution

Using CDB_PDB_HISTORY dictionary view, you can easily query the history of the PDBs and for each PDB you can see when it was created/cloned/plugged/unplugged and from which other PDB it was cloned from.

Demonstration

Following is a demonstration of the CDB_PDB_HISTORY from one of our Oracle 12c environments:
SQL> select pdb_name, operation, op_timestamp, cloned_from_pdb_name from cdb_pdb_history order by 3;

PDB_NAME   OPERATION        OP_TIMESTAMP         CLONED_FROM_PDB_NAME
---------- ---------------- -------------------- -------------------------
PDBTEST    CREATE           12-MAR-2015 14:58:52 PDB$SEED
PINIDB     CLONE            15-MAR-2015 15:00:07 PDBTEST
PDBTEST    UNPLUG           05-JAN-2016 15:01:39
PDBTEST    PLUG             05-JAN-2016 15:09:59 PDBTEST


Following is an explanation for the this example:

  • The first PDB named PDBTEST was created in 12-MAR-2015 14:58:52 from the PDB$SEED (a system-supplied template PDB).
  • The second PDB named PINIDB was cloned  in 15-MAR-2015 15:00:07 from PDBTEST.
  • On 05-JAN-2016 15:01:39 PDBTEST has been unplugged.
  • On 05-JAN-2016 15:09:59 PDBTEST has been plugged into the container database.

Summary

The CDB_PDB_HISTORY view can be useful for investigating the history of your PDBs. 
I hope you can find it useful in your Oracle 12c environments.

Monday, October 12, 2015

12.1.0.2 New Feature - PDB State Management Across CDB Restart

Introduction

In this post I'd like to review a very useful feature that was introduced in version 12.1.0.2 - PDB State Management Across CDB Restart. In version 12.1.0.1, after instance restart you will notice that the Pluggable Databases (PDBs) are MOUNTED, i.e. they are not accesible to the users. It doesn't matter if before the restart the PDB was MOUNTED or OPEN, in any case after the restart it will be MOUNTED. let's see a demonstartion for that:

























This means that after every restart of the instance DBA need to manually start the Pluggable Databases in order to make it accessible to the users.

12.1.0.2 solution - "Save State" clause

The solution for this behaviour was introduced with version 12.1.0.2 which provides an option to execute a command that will set the state of a PDB so in the next time that the instance will be started, the open mode of that PDB will be remains the same as it was when we executed the ALTER PLUGGABLE DATABASE ... SAVE STATE command. Let's see a demonstration

























As you can see, after I exectued "ALTER PLUGGABLE DATABASE ... SAVE STATE" command, the PDB open mode remains the same (OPEN) after I restarted the instance.

Few Notes:

  • You can query DBA_PDB_SAVED_STATES dictinoary view which shows information about the current saved PDB states in the CDB.
  • You can discard the state of a PDB in order to make the open mode mounted again in the next instance reboot. Below is a demonstartion of this:






































Wednesday, September 16, 2015

Wondering why you can't view data with a COMMON USER in Oracle 12c? You probably didn't use the CONTAINER_DATA clause

Introduction
Let's say you've created a common user in your Oracle 12c instance and you granted the user permissions to connect and select some specific dynamic views (e.g. V$PDBS, V$CONTAINERS).
Afterwards, you connect with that common user to the root container (CDB$ROOT), you query V$PDBS but no rows are returned.
This issue was raised in the OTN forum by a user and my answer to that user was  very simple - use the CONTAINER_DATA clause (See: https://community.oracle.com/message/13301017#13301017).

Basically, when a common user is connected to the ROOT and it executes a query on a container data object (As per Oracle Doc, container data objects include: V$, GV$, CDB_, and some Automatic Worklaod Repository DBA_HIST* view), then that query will only dispay data for the PDBs which are visible for that common user, and this is what you can set using the CONTAINER_DATA clause.

Demonstration
In the first step I'll create a common user, grant him permissions to connect and query V$PDBS and then I'll connect with that user and try to query V$PDBS.
SQL> select name,open_mode from v$pdbs;
NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDBTEST                        MOUNTED
PINIDB                         READ WRITE

SQL> create user C##TEST identified by test;
User created.

SQL> grant connect to C##TEST;
Grant succeeded.

SQL> grant select on sys.v_$pdbs to C##TEST;
Grant succeeded.

SQL> connect C##TEST/test@isrvmrh541-cdb.world
Connected.

SQL> select * from v$pdbs;
no rows selected
As you can see, no rows are returned from the query.
Let's connect again with SYS and verify which PDBs are visible for user C##TEST using the CDB_CONTAINER_DATA dictionary view which displays information about the user-level and object-level CONTAINER_DATA attributes specific in the CDB:
SQL> connect sys@isrvmrh541-cdb.world as sysdba
Enter password:
Connected.

SQL> SELECT username,
  2         owner,
  3         object_name,
  4         all_containers container_name
  5    FROM CDB_CONTAINER_DATA
  6   WHERE username = 'C##TEST';
no rows selected
As you can see, user C##TEST has no container data attributes.
Let's specify that user C##TEST can see the data of V$PDBS from all the containers:
SQL> alter user C##TEST set container_data=all for sys.v_$pdbs container = current;
User altered.

SQL> SELECT username,
  2         owner,
  3         object_name,
  4         all_containers,
  5         container_name
  6    FROM CDB_CONTAINER_DATA
  7   WHERE username = 'C##TEST'
  8   ;

USERNAME           OWNER     OBJECT_NAME   ALL_CONTAINERS CONTAINER_NAME
--------------- ---------- --------------- ------------- --------------------
C##TEST            SYS      V_$PDBS           Y
As you can see, the CONTAINER_NAME is NULL because I sepcific in the aler command that the container_data will be visible for all containers.
If we would like to specify that the data of every container data object that the user has SELECT permissions to access, you can remove the "for" clause and execute the following command:
SQL> alter user C##TEST set container_data=all container = current;
User altered.

SQL> SELECT username,
  2         owner,
  3         object_name,
  4         all_containers,
  5         container_name
  6    FROM CDB_CONTAINER_DATA
  7   WHERE username = 'C##TEST';

USERNAME           OWNER    OBJECT_NAME    ALL_CONTAINERS CONTAINER_NAME
--------------- ---------- --------------- ------------- --------------------
C##TEST            SYS      V_$PDBS            Y
C##TEST                                        Y
As you can see, now user C##TEST has an access for all the objects which he will granted permissions to SELECT from. 

Summary
  • Once you create a COMMON USER, you should also specify which PDBs data are visible to that common user for which objects using the CONTAINER_DATA clause
  • You can specify the object-level CONTAINER_DATA attributes for a user using the ALTER USER command
  • You can view the information about the user-level and object-level CONTAINER_DATA attributes via CDB_CONTAINER_DATA dictionary view

Useful Links: