Clone PDB
Cloning of pluggable database from another pluggable database is very simple.
create pluggable database <target pdb> from <source pdb>;
examples:
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DX12P READ WRITE NO
SQL> create pluggable database dx12p1 from dx12p;
create pluggable database dx12p1 from dx12p
*
ERROR at line 1:
ORA-65081: database or pluggable database is not open in read only mode
Source database should be in read only mode.
SQL> alter pluggable database dx12p close immediate;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DX12P MOUNTED
SQL> alter pluggable database dx12p open read only;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DX12P READ ONLY NO
SQL> create pluggable database dx12p1 from dx12p;
Pluggable database created.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DX12P READ ONLY NO
4 DX12P1 MOUNTED
SQL> alter pluggable database dx12p1 open;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DX12P READ ONLY NO
4 DX12P1 READ WRITE NO
Cloning of pluggable database from another pluggable database is very simple.
create pluggable database <target pdb> from <source pdb>;
examples:
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DX12P READ WRITE NO
SQL> create pluggable database dx12p1 from dx12p;
create pluggable database dx12p1 from dx12p
*
ERROR at line 1:
ORA-65081: database or pluggable database is not open in read only mode
Source database should be in read only mode.
SQL> alter pluggable database dx12p close immediate;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DX12P MOUNTED
SQL> alter pluggable database dx12p open read only;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DX12P READ ONLY NO
SQL> create pluggable database dx12p1 from dx12p;
Pluggable database created.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DX12P READ ONLY NO
4 DX12P1 MOUNTED
SQL> alter pluggable database dx12p1 open;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 DX12P READ ONLY NO
4 DX12P1 READ WRITE NO
No comments:
Post a Comment