How to create a multi-tenant PDB (container) Database: The method of cloning local PDB 6 DBCA

Based on version: 19C (12.2.0.3)  AskScuti

Creation Method: DBCA Silent local clone PDB. The  CDB1  in  PDB1  cloned  CDB1  in PDB_CLONE

Corresponding path: Creating the PDB A -> Cloning -> no corresponding path (the DBCA)

How to create a container inside the PDB database CDB, the official document gives an option to create a PDB technical drawing , picture is as follows:

Note: DBCA silent clone building a database, there is no method in this picture shows, this article will DBCA method recorded in Cloning below .

Further: the DBCA cloning or repositioning PDB, do not support the opening of OMF the CDB,  CDB1 and CDB2 must both archiving mode.

 

Content Overview

1 Overview

2. CDB1: PDB1 confirm users and data

3. CDB1 for local clone DBCA

4. CDB1 Verify

 

1 Overview

Silent DBCA local cloning tool according CDB1 in PDB1 cloned PDB_CLONE .

CDB1 ( PDB1 ) is to have a user SCOTT , tables below the EMP .

The CDB1 following PDB1 muting create cloned PDB_CLONE , and verify PDB_CLONE whether presence SCOTT user and EMP table.

 

2. CDB1: PDB1 confirm users and data

[oracle@erp ~]$ rlwrap sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Aug 29 21:55:59 2019
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> show pdbs

    CON_ID CON_NAME  OPEN MODE  RESTRICTED
---------- --------- ---------- ----------
     2 PDB$SEED      READ ONLY  NO
     3 PDB1          READ WRITE NO
SQL> alter session set container=pdb1;

Session altered.

SQL> select count(1) from scott.emp;

  COUNT(1)
----------
    14

 

3. CDB1 for local clone DBCA

dbca -silent -createPluggableDatabase -sourceDB cdb1 -createPDBFrom PDB -pdbName pdb_clone -sourcePDB pdb1

process

[oracle@erp ~]$ dbca -silent -createPluggableDatabase -sourceDB cdb1 -createPDBFrom PDB -pdbName pdb_clone -sourcePDB pdb1
Prepare for db operation
13% complete
Creating Pluggable Database
15% complete
19% complete
23% complete
31% complete
53% complete
Completing Pluggable Database Creation
60% complete
Executing Post Configuration Actions
100% complete
Pluggable database "pdb_clone" plugged successfully.
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb1/pdb_clone/cdb1.log" for further details.

 

4. CDB1 Verify

[oracle@erp ~]$ rlwrap sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Aug 29 22:20:11 2019
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> show pdbs

    CON_ID CON_NAME  OPEN MODE  RESTRICTED
---------- --------- ---------- ----------
     2 PDB$SEED      READ ONLY  NO
     3 PDB1          READ WRITE NO
     4 PDB_CLONE     READ WRITE NO
SQL> alter session set container=pdb_clone;

Session altered.

SQL> select count(*) from scott.emp;

  COUNT(*)
----------
    14

Guess you like

Origin www.cnblogs.com/askscuti/p/11432406.html