We have already covered many administration tasks for CDBs and PDBs. The PDBs are considered application databases or configured for user objects and data.
You still have administrative tasks that need to be performed while connected directly to the PDB.
You can open/close a PDB, check its status, show currently connected users, and so on.
You can administer a PDB as a privileged connection to the root container, or you can perform tasks while connected as a privileged user directly to the PDB itself.
Keep in mind that when you connect as SYS to a PDB within the CDB, you can only perform SYS-privileged operations for the PDB to which you are connected.
You cannot start/stop the container instance or view data dictionary information related to other PDBs within the CDB.
The multitenant environment provides separation of duties for an administrator and application administrators.
A PDB can be secured to just be specific administrators.
You can administer one or more PDBs and another team or DBAs would be taking care of the CDB administration or the PDB administration of other PDBs.
Connecting to a PDB
You can connect to a PDB as SYS either locally or over the network. To make a local connection, first connect to the root container as a common user with privileges on the PDB, and then use the SET CONTAINER command to connect to the desired PDB:
SQL> alter session set container = salespdb;
The prior connection does not require a listener or password file; a connection over the network requires both. This next example makes a network connection via SQL*Plus and specifies the host, listener port, and service name of the PDB when connecting via SQL*Plus:
$ sqlplus pdbsys/Cr4zyPa$$word1@mm23c:1521/salespdb as sysdba
If you are unsure how to set up a listener and a password file, see Chapter 2. If you use the DBCA utility to create the PDB, the listener for the PDB will be set up.
For instructions on how to register a PDB service name with the listener, see the next section.