Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
FROM cdb_pdbs
To find the default permanent tablespace in Oracle, you can run the following SELECT statement:
ALTER SESSION SET CONTAINER = PDBORCL;
SELECT PROPERTY_VALUE
FROM DATABASE_PROPERTIES
To find the default temporary tablespace in Oracle, you can run the following query:
SELECT PROPERTY_VALUE
FROM DATABASE_PROPERTIES
C:\app\Administrator\diag\rdbms\orcl\orcl\trace
CREATE PLUGGABLE DATABASE PDB1 ADMIN USER SYSDBA IDENTIFIED BY "system" DEFAULT
TABLESPACE TEMP DATAFILE'C:\app\Administrator\oradata\PDB1.dbf' SIZE 10M AUTOEXTEND ON
FILE_NAME_CONVERT=('C:\app\Administrator\oradata\orcl\pdbseed\','C:\app\Administrator\oradata\P
DB1\');
FILE_NAME_CONVERT=('pdbseed','apex_approot1');
ALTER PLUGGABLE DATABASE apex_approot1 open;
show pdbs;
Using DBCA(Database Configuration Assistance)By using this command Display a graphical Windows for
Create Pluggabldatabase;
desc v@pdbs;
sho pdbs;
1. Pluggable Database
* Oracle 12c introduces a new feature called 'Pluggable Database'. Here Oracle Metadata and user data
are totally separated into two sections. One is Container DB (or CDB) which will hold Oracle Metadata.
The other is Pluggable DB (or PDB) which will hold user data.
In the regular database, Oracle's metadata and user's application data are integrated. For beginners,
Oracle Metadata is the data that is present when you install a new Oracle Database (without any sample
schemas). Even though it can be called as an empty database, it still has data provided by Oracle. This
data is needed by the database to function. For example, the objects owned by SYS, SYSTEM are mostly
metadata.
Then user data is entered into that database. They will go under multiple user schemas. Now the
database is being used by the users.
Now a situation arises so that we need to create another database on the same server. Why? Let us say
that you need to provide data to two clients. And you don't want one client to other's data. And your
data is contained in an extensive set of application schemas.
In this case, making a copy of those applications schemas into a different set of names and making them
reside in the same database is very difficult.
So, you provide two separate databases. This also ensures that there is no security violation.
So, we install another new database, which comes with Oracle Metadata. Then we load the user data. In
this method, which is currently being used (Year 2013), there will be a need for more memory for both
the database instances. There will be two SGAs, two sets of smon, pmon and other background
processes running.
Then if we need to copy one database to another, we need to rely on extensive procedures which
includes exporting the data from the source database first, then removing the data at the target and
then finally loading the data in there. After that, we need to take care of the user security and object
privileges etc.
So, if you want to provide data for multiple tenants, that is multiple clients, then with the current set of
features (till Oracle 11g), we have to create multiple databases. That is, one database for one client. In
otherwords, there is no multi-tenancy.
Multi-Tenancy is becoming an important requirement in cloud infrastructure, these days. You would like
to have the ability of providing data to multiple clients from the same database system with full
confidence in security.
In a Pluggable Database, Oracle basically separates its metadata entirely from the user data. Metadata is
stored in a section called Container DB. Then the user data are stored in Pluggable DBs. It also stores
user metadata in the Pluggable DB.
By the way, what is user metadata? For example, earlier, the list of user accounts that exist in a
database is tightly inegrated with Oracle Metadata. Now, with the separation of Container DB and
Pluggable DB, the user accounts must exist in the Pluggable DB. So, the Pluggable DB not only contains
user data, but also some user metadata.
* Multi-Tenancy - We can bring in two Pluggable DBs under one Container DB. Both will be totally
segregated, but yet controlled by one instance. This is an important feature for SaaS (Software as a
Service) platforms, Cloud, On-Demand and Vendor Managed Application solutions.
* Easy cloning/copying. Now the cloning and copying the databases across servers would be much
easier. Just clone a Pluggable DB and plug-it-in in a different server.
* Very easy upgrades and patching.
Create pluggable database pdbsdb admin user sysdba identified by system file_name_convert =
('C:\app\Administrator\oradata\orcl\pdb$seed\','C:\app\Administrator\oradata\orcl\ pdbsdb \');
Create pluggable database pdbsdb admin user system identified by “system” DEFAULT TABLESPACE
USER DATAFILE 'C:\app\Administrator\oradata\ pdbsdb\user02.dbf \' file_name_convert =
('C:\app\Administrator\oradata\orcl\pdbseed\','C:\app\Administrator\oradata\orcl\ pdbsdb \');
Seed Database (pdb$seed) - Read Write OR Read Only Mode in Oracle Database 12c
(12.1.0.1.0)
CON_NAME
------------------------------
CDB$ROOT
OPEN_MODE
--------------------
READ WRITE
OPEN_MODE
--------------------
READ WRITE
CON_NAME
------------------------------
CDB$ROOT
CON_NAME
------------------------------
CDB$ROOT
CON_NAME
------------------------------
PDB$SEED
OPEN_MODE
--------------------
READ WRITE
OPEN_MODE
--------------------
READ ONLY
SQL> create pluggable database cdb1_pdb4 admin user user1 identified by oracle;
Pluggable database created.
Conclusion: pdb$seed is template database for new pluggable databases in container database (cdb).
1 comment: