Databases Reference
In-Depth Information
When you make initialization parameter changes while connected directly to a pluggable database, these
changes only affect the currently connected pluggable database. The parameter changes do not affect the root
container or other pluggable databases. For example, say you wanted to change the value of
OPEN_CURSORS
. First,
connect directly to the pluggable database as a privileged user, and issue the
ALTER SYSTEM
statement:
$ sqlplus sys/foo@speed2:1521/salespdb as sysdba
SQL> alter system set open_cursors=100;
The prior change modifies the value of
OPEN_CURSORS
only for the
SALESPDB
pluggable database. Furthermore,
the setting of
OPEN_CURSORS
for
SALESPDB
will persist across database restarts.
Renaming a Pluggable Database
Occasionally, you may be required to rename a pluggable database. For instance, the database may have been
originally misnamed, or you may no longer be using the database and want to append an
_OLD
to its name. To rename
a pluggable database, first connect to it as a
SYSDBA
-privileged account:
$ sqlplus sys/foo@invpdb as sysdba
Next, stop the pluggable database, and restart it in restricted mode:
SQL> shutdown immediate;
SQL> startup restrict;
Now, the pluggable database can be renamed:
SQL> alter pluggable database INVPDB rename global_name to INVPDB_OLD;
Limiting the Amount of Space Consumed by a Pluggable Database
You can place an overall limit on the amount of disk space a pluggable database can consume. I would recommend
placing some reasonable limit on the overall size of each pluggable database, especially if you work in an environment
in which there are different DBAs or groups managing separate pluggable databases within the same CDB, and each
DBA/group is unaware of the space that the other databases are consuming.
In this example an overall limit of 20GB is placed on a pluggable database. First, connect to the pluggable
database as
SYS
:
$ sqlplus sys/foo@speed2:1521/salespdb as sysdba
Then, alter the pluggable databases' maximum size limit. This command limits the size of the pluggable database
to a maximum of 2GB:
SQL> alter pluggable database salespdb storage(maxsize 20G);
Viewing Pluggable Database History
If you need to view when a pluggable database was created, you can query the
CDB_PDB_HISTORY
view, as shown:
COL db_name FORM A10
COL con_id FORM 999
COL pdb_name FORM A15