Database Reference
In-Depth Information
SQL> grant select on mytable to c##myrole container = all;
SQL> grant c##myrole to c##myuser container = all;
The common role will now propagate through all containers. You just need to use the above code once for all
PDBs to receive the grant. But how to navigate between containers?
Switching Containers
The consolidated PDBs on the CDB are likely to be administrated by a single DBA or DBA team at the CDB level.
So moving between containers is going to be a frequent task, which thankfully is easy to do.
Use this ALTER SESSION command to switch to another container:
SQL> alter session set container = mypdb;
Then to switch back to the root container:
SQL> alter session set container = cdb$root;
Cloning the Seed Database
Much of the pre-launch talk regarding 12c has been around the consolidation aspects, with companies saving money
and downsizing. More recently, with economic recovery, the opportunity to quickly provision new databases within
12c is a source of potential business advantage. Creating a new database using the seed template could not be easier.
The CREATE PLUGGABLE DATASE creates a pluggable database by copying the seed database, as follows:
$ sqlplus / as sysdba
CREATE PLUGGABLE DATABASE MYPDB
ADMIN USER MYPDBADMIN IDENTIFIED BY MYPASSWORD
FILE_NAME_CONVERT = ('/u01/app/oracle/oradata/CDB/pdbseed',
'/u01/app/oracle/oradata/CDB/mypdb');
Pluggable DB Commands
So you have created a new pluggable DB from the seed, but how do you administrate this plugged database?
Close the pluggable database:
$ sqlplus / as sysdba
SQL> alter pluggable database dkpdb close immediate;
Unplug the pluggable database:
alter pluggable database mypdb unplug into
'/orahome/oracle/mypdb.xml'
From CDB, open and close all PDBs:
SQL> alter pluggable database all open;
SQL> alter pluggable database all close immediate;
 
Search WWH ::




Custom Search