Database Reference
In-Depth Information
SQL> alter session set container = SWINGBENCH1;
Session altered.
SQL> select sys_context('userenv', 'con_name') from dual
2 /
SYS_CONTEXT('USERENV','CON_NAME')
----------------------------------------------------------------------------
SWINGBENCH1
There is an important implication to this command as compared to the network connection: any login trigger
defined does not fire after the alter session command has completed (there are workarounds). The container names
can be found in V$PDBS.NAME, with the exception of the root, which is referred to as CDB$ROOT.
PDB-specific initialization parameters
Initialization parameters can be set in different places in the Oracle 12c database. Most are applicable for the whole
Container Database, but some can be set specifically for a PDB. Most of the session-modifiable parameters can be
set at the PDB level, while connected to the PDB. To find out which parameters are specific to a PDB, you can query
the system:
SQL> SELECT NAME FROM V$PARAMETER WHERE ISPDB_MODIFIABLE='TRUE' ORDER BY NAME;
At the time of this writing there were 171 PDB-specific parameters that could be set. They were persistent across
lifecycle changes within the PDB. Earlier in this chapter you saw how you could transfer PDB-specific initialization
parameters as part of the unplug/plug operation.
Considerations for hosted environments
With all this information you now have in your hands, you can make a lot of practical use in your database consolidation
project. Instead of creating individual schemas in a database and live with the limitations of multi-tenancy in Oracle 11.2
and before you can now create new environments very quickly. The below example demonstrates how quickly you can
create a new PDB from the seed database residing on ASM:
SQL> set timing on time on
22:53:34 SQL> begin
22:53:35 2 for j in 10..20 loop
22:53:37 3 execute immediate 'create pluggable database pdb' || j ||
22:53:39 4 ' admin user pdbadmin identified by secret';
22:53:40 5 end loop;
22:53:42 6 end;
22:53:43 7 /
PL/SQL procedure successfully completed.
Elapsed: 00:02:20.48
 
Search WWH ::




Custom Search