Plugable (CDB) database support was added beginning with the 5.6.7.2 Oracle cartridge. However, due to a known Oracle issue on version 12C pluggable, the Datafile Fragmentation and Tablespace Fragmentation collections retrieve data for cdb$root only. This has been logged as Defect ID ODB-10750 and is listed in the release notes.
Oracle 12c and higher is only supported if the user is both a common user and can log into the CDB$ROOT container. This is a known limitation of monitoring.
Enhancement Request FOG-10585 has been logged to enable agent installation and monitoring on PDB-only environments.
1) User should be a common user, in that the database user identity and password is known in the root and in every existing and future pluggable database (PDB).
Here is additional information from
Oracle.
2) The user needs to confirm that the user account can log into the CDB$ROOT (root) container.
The error "ORA-65096: invalid common user or role name when running the script on the container" may appear if the common user name is not valid.
By default in Oracle the name of every user-created common user must begin with the characters c## or C##. (Oracle-supplied common user names do not have this restriction.) Further details here.
To create a Common user like 'foglight' without the prefix, before creating the user run:
alter session set "_ORACLE_SCRIPT"=true;
See in this webpage.
3) The user can search for Oracle 12 via Google based on "About Creating a CDB and Enable
Pluggable database". This falls under the Oracle side, not Foglight.
Here is another helpful
link
4) In reference to this link, please try
this from the FGLAM agent manager host:
The user can use the following commands from the FGLAM agent manager host.
--Connecting to a Pluggable Database (PDB)
Direct connections to pluggable databases must be made using a service. Each pluggable database automatically registers a service with the listener. This is how any application will connect to a pluggable database, as well as administrative connections.
SQL> -- EZCONNECT
SQL> CONN system/password@//localhost:1521/pdb1
Connected.
SQL>
SQL> -- tnsnames.ora
SQL> CONN system/password@pdb1
Connected.
SQL>
The connection using a TNS alias requires an entry in the "$ORACLE_HOME/network/admin/tnsnames.ora" file, such as the one shown below.
PDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ol6-121.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdb1)
)
)
PDB users with the SYSDBA, SYSOPER, SYSBACKUP, or SYSDG privilege can connect to a closed PDB. All other PDB users can only connect when the PDB is open. As with regular databases, the PDB users require the CREATE SESSION privilege to enable connections.
---Displaying the Current Container
The SHOW CON_NAME and SHOW CON_ID commands in SQL*Plus display the current container name and ID respectively.
SQL> SHOW CON_NAME
CON_NAME
------------------------------
CDB$ROOT
SQL>
SQL> SHOW CON_ID
CON_ID
------------------------------
1
SQL>
Once all the requirements are set, adding Pluggable Database is like adding any other Oracle database via Monitor wizard from the Database dashboard within the Foglight Console. Please, ensure the user account is correct to link to the PDB. The user can use the above connection string to test PDB connection.