Академический Документы
Профессиональный Документы
Культура Документы
Pluggable Databases
ADO and Heat Map and Automatic Data Optimization Online Datafile Move
Storage
In-Database Archiving and Temporal Validity Temporal History
HA RMAN
3-2 Copyright 2013, Oracle and/or its affiliates. All rights reserved.
Objectives
3-3 Copyright 2013, Oracle and/or its affiliates. All rights reserved.
Goals
3-4 Copyright 2013, Oracle and/or its affiliates. All rights reserved.
Tools
EM
SQL
SQL*Plus OUI DBCA Cloud DBUA
Developer
Control
Create a new Yes Yes
Yes Yes Yes
CDB or PDB (PDB only) (PDB only)
Explore CDB
instance,
Yes Yes Yes
architecture,
PDBs
Upgrade a
12.1 CDB to Yes Yes Yes
12.x CDB
3-5 Copyright 2013, Oracle and/or its affiliates. All rights reserved.
Steps to Create a Multitenant Container Database
initCDB1.ora
2 Instance
1 Instance SGA
Process Structures
3 Multitenant
Container Multitenant Container Database CDB1
Database root container
CDB1
SYSTEM UNDO
4
SYSAUX TEMP
Execute from root Control Redo Log
Datafiles files
catalog.sql files
SYSTEM
SYSAUX TEMP1
3-6 Copyright 2013, Oracle and/or its affiliates. All rights reserved.
Creating a Multitenant Container Database:
Using SQL*Plus
1. Instance startup:
a. Set ORACLE_SID=CDB1
b. Set in initCDB1.ora:
Set CONTROL_FILES to CDB control file names
Set DB_NAME to CDB name
Set ENABLE_PLUGGABLE_DATABASE to TRUE
CDB$ROOT container
PDB$SEED pluggable database
3. Close/open the seed PDB and run post-creation scripts.
3-7 Copyright 2013, Oracle and/or its affiliates. All rights reserved.
Creating a Multitenant Container Database:
Using DBCA
3-9 Copyright 2013, Oracle and/or its affiliates. All rights reserved.
New Clause: SEED FILE_NAME_CONVERT
CREATE DATABASE new clauses:
NAME OPEN_MODE
---------------- ----------
PDB$SEED READ ONLY
PDB1 READ WRITE
PDB2 READ WRITE
STATUS CON_ID
------------ ------
cr 1 root
free 1
xcur 1
xcur 2 seed PDB
cr 3 PDB1 PDB
xcur 3
$ORACLE_HOME/log
ADR Base
diag
rdbms
CDB Name
ADR Home metadata
SID
incdir_1 incdir_n
ADRCI
log.xml alert_SID.log
Four methods:
Create a new PDB from the seed PDB.
Plug a non-CDB in a CDB.
Clone a PDB from another PDB:
Into the same CDB
Plug an unplugged PDB into another CDB.
USERS
TEMP Creates a full catalog including
root metadata pointing to Oracle-
supplied objects
Data files
SYSTEM Creates common users:
SYSAUX
Superuser SYS
PDB$SEED
Create SYSTEM
PDB1
Data files
from Creates a local user (PDBA)
PDB$SEED
SYSTEM
granted local PDB_DBA role
SYSAUX
Creates a new default service
PDB1
Or
New parameter: PDB_FILE_NAME_CONVERT =
'/u01/app/oradata/CDB1/seed','/u01/app/oradata/CDB1/pdb1'
ORCL 12.1
XML file
Plug PDB1 in to CDB2:
Plug PDB1 1. Connect to CDB2 as a common user.
Multitenant Container Database CDB2 2. Use DBMS_PDB package to check the
compatibility of PDB1 with CDB2.
root
3. SQL> CREATE PLUGGABLE DATABASE
PDB$SEED
2 pdb1 USING 'xmlfile1.xml'
Data files SYSTEM
SYSAUX USERS 3 NOCOPY;
PDB1
4. Open PDB1 in read-write mode.
4
Plug a new PDB with
Sample Schemas
using a PDB File Set
impdp
2
Dump file Replication XML file
Or expdp
Data files Control Redo Log
files files
Which of the following are true about cloning a PDB into the
same CDB? Select all that apply.
a. It is not possible. You can only clone a PDB into another
CDB.
b. You can clone only one PDB into the same CDB.
c. Cloning a PDB can use the source files copy method to the
target PDB files.
d. Cloning a PDB can use the clause NOCOPY if the target
PDB files will use the source files.