Managing a Multitenant Database

Startup and Shutdown
Startup and Shutdown of a multitenant database function the same as on a regular database, however, if connected to pluggable database, only the pluggable database shuts down. If connected to the root container database then the entire instance shuts down. Pluggable databases also have their own commands that can be run from the root container or other pluggable db.

ALTER PLUGGABLE DATABASE <name>OPEN READ WRITE{RESTRICTED}{FORCE};

ALTER PLUGGABLE DATABASE <name> OPEN READ ONLY {RESTRICTED}{FORCE};

ALTER PLUGGABLE DATABASE <name> OPEN UPGRADE {RESTRICTED};

ALTER PLUGGABLE DATABASE <name> CLOSE {IMMEDIATE};

To retain state as startup state of container...
ALTER PLUGGABLE DATABASE <name> SAVE STATE;


Roles and Users
Common Users and Roles must be created in the root container and prefixed by the characters
c##

Local Users and Roles must be created in pdb

Granting Roles and Privileges
GRANT <privelege/role> TO <user> CONTAINER=<PDB name or ALL>;

If local only, grant from pdb and omit container argument.
Comments