Re: Curious question - naming CDBs and PDBs

From: Hans Forbrich <fuzzy.graybeard_at_gmail.com>
Date: Sat, 16 Jul 2016 08:38:09 -0600
Message-ID: <578A46D1.5020704_at_gmail.com>



On 15/07/2016 12:22 PM, Chris Taylor wrote: > Out of curiosity, how do you guys name your CDBs and PDBs in relation > to each other?

There are a number of things to keep in mind with CDBs. For me, the following are some of the most relevant to this discussion:

  • Normal users never connect to the CDB
  • From the DBA's perspective, the CDB is the core unit of administration
  • Ideally there is only 1 CDB on a machine, with many PDBs plugged in
  • In practice there many be many CDBs on a machine
  • Users connect to the PDB via Service
  • The PDB Service can move to any CDB, even in a '1 to 1' situation.
  • OEM Cloud Control identifies the host-CDB and CDB-PDB relationships at no added license cost
  • Most CDB access and admin will likely be using a machine-local account

Therefore, for naming, some of the ideas I use are:

  • there is NO relation between PDB and CDB, other than what the DBA happens to impose, and that may be fleeting. Do not make a link between CDB name and PDB name, but use tools such as OEM Cloud Control and lsnrctl status to determine which instance is hosting that PDB at this time. For this, the free components of OEM Cloud Control are quite satisfactory.
  • in general, get into the habit of using the PDB Admin account rather than the SYSDBA, access the PDB directly when doing PDB admin. Avoid SYSDBA unless really doing SYSDBA stuff. Indeed, get out of the habit of using SYSDBA at all as http://docs.oracle.com/database/121/DBSEG/authorization.htm#DBSEG578 states that it is only for backward compatibility. (Which implies that it may become deprecated.)
  • name the CDBs to highlight they are CDBs. This is for the DBA's purpose, and the DBAs will be the only ones accessing them anyway. Perhaps something like "CDB || nn || host". Personally I've started just naming them 'CDB || nnn" (with or without leading zeros) and using the OWM Cloud Control (still free) to tell me which host they are on - especially since I use Oracle VM eliminating a real connection between physical and OS host, and besides, the CDBs can move between hosts easily.
  • name the PDBs to reflect the purpose of the PDB. Users (and PDB admins) will connect to the PDB, so make it easy to identify hy they are connecting to it. In many cases, a PDB will match up to an application, so naming the PDB to reflect the applcation name and possibly application situation (Test, Prod, etc.) Again, even with 1-to-1, the PDB can migrate to other CDBs (create CDB with no PDB, the unplug/plug) so defining a relationship is going to bite at some time. So I have PDBs named like APEXTEST, SAMPPROD, and similar.
  • I've been known to use a lot of the 30 characters permitted in a PDB name, which is OK since I do also tend to create entries in TNSNAMES.ora or in the LDAP names resolution.

This is based on my personal experience and is what I do in my personal (paid and supported) environments. It is NOT an official Oracle recommendation, and Oracle Corp may or may not agree with what I have written here

/Hans

--
http://www.freelists.org/webpage/oracle-l
Received on Sat Jul 16 2016 - 16:38:09 CEST

Original text of this message