【跟我学oracle18c】第三天:Cloning a Local PDB

版权声明:所有文章禁止转载但是均可在生产中使用提高效率 https://blog.csdn.net/viviliving/article/details/83855581

7.3.1 Cloning a Local PDB Using No Clauses

The following statement clones the pdb2 PDB from the pdb1 PDB:

CREATE PLUGGABLE DATABASE pdb2 FROM pdb1;

7.3.2 Cloning a Local PDB Using DBCA: Example

The following command clones the pdb2 PDB from the pdb1 PDB:

./dbca -silent 
  -createpluggabledatabase 
  -sourcedb orcl 
  -createpdbfrom PDB 
  -pdbName pdb2 
  -sourcepdb pdb1

7.3.3 Cloning a Local PDB with the PATH_PREFIX Clause: Example

The following statement clones the pdb2 PDB from the pdb1 PDB:

CREATE PLUGGABLE DATABASE pdb2 FROM pdb1 
  PATH_PREFIX = '/disk2/oracle/pdb2/'
  FILE_NAME_CONVERT = ('/disk1/oracle/pdb1/', '/disk2/oracle/pdb2/')
  SERVICE_NAME_CONVERT = ('salesrep_ca','salesrep_or','orders_ca','orders_or')
  NOLOGGING;

7.3.4 Cloning a Local PDB Using the STORAGE Clause: Example

The following statement clones the pdb2 PDB from the pdb1 PDB:

CREATE PLUGGABLE DATABASE pdb2 FROM pdb1 
  FILE_NAME_CONVERT = ('/disk1/oracle/pdb1/', '/disk2/oracle/pdb2/')
  STORAGE (MAXSIZE 2G)
  SERVICE_NAME_CONVERT = ('salesrep_ca','salesrep_or','orders_ca','orders_or');

7.3.5 Cloning a Local PDB with the NO DATA Clause: Example

  1. With the source PDB pdb1 as the current container, query a table with a large amount of data:

    SELECT COUNT(*) FROM tpch.lineitem;
    
      COUNT(*)
    ----------
      60001215
    

    The table has over sixty million rows.

  2. Clone the source PDB with the NO DATA clause:

    CREATE PLUGGABLE DATABASE pdb2 FROM pdb1 NO DATA;
    
  3. Open the cloned PDB:

    ALTER PLUGGABLE DATABASE pdb2 OPEN;
    
  4. With the cloned PDB pdb2 as the current container, query the table that has a large amount of data in the source PDB:

    SELECT COUNT(*) FROM tpch.lineitem;
    
      COUNT(*)
    ----------
             0

7.3.6 Creating a Point-in-Time Clone of a PDB Snapshot: Example

The following statement clones the pdb1_copy PDB from the PDB snapshot named pdb1_wed_4_1201:

CREATE PLUGGABLE DATABASE pdb1_copy FROM pdb1 USING SNAPSHOT pdb1_wed_4_1201;

Given the preceding factors, the following statement clones the pdb1_snap_copy PDB from the pdb1_snap3 PDB snapshot:

CREATE PLUGGABLE DATABASE pdb1_snap_copy FROM pdb1 USING SNAPSHOT pdb1_snap3 SNAPSHOT COPY;

猜你喜欢

转载自blog.csdn.net/viviliving/article/details/83855581
pdb