EXAMPLES OF PLUGGABLE DATABASE CREATION & DROP
=================================
## CREATION PLUGGABLE DATABASE ##
=================================
1) The first method uses the CREATE_FILE_DEST clause in the CREATE PLUGGABLE DATABASE statement.
CREATE PLUGGABLE DATABASE pdb2 ADMIN USER pdb_adm IDENTIFIED BY Password1
CREATE_FILE_DEST='/u01/app/oracle/oradata';
2) The second method uses the FILE_NAME_CONVERT clause in the CREATE PLUGGABLE DATABASE statement.
CONN / AS SYSDBA
CREATE PLUGGABLE DATABASE pdb2 ADMIN USER pdb_adm IDENTIFIED BY Password1
FILE_NAME_CONVERT=('/u01/app/oracle/oradata/cdb1/pdbseed/','/u01/app/oracle/oradata/cdb1/pdb2/');
3) Alternatively, we can specify the PDB_FILE_NAME_CONVERT initialization parameter before calling the command without using the FILE_NAME_CONVERT clause.
CONN / AS SYSDBA
ALTER SESSION SET PDB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/cdb1/pdbseed/','/u01/app/oracle/oradata/cdb1/pdb3/';
CREATE PLUGGABLE DATABASE pdb3 ADMIN USER pdb_adm IDENTIFIED BY Password1;
=============================
## DROP PLUGGABLE DATABASE ##
=============================
Connect as ROOT
---------------
sqlplus / as sysdba
SHOW PDBs;
ALTER PLUGGABLE DATABASE FURQAN CLOSE;
KEEP DATAFILES
--------------
The following statement drops the PDB pdb_name and it will remain its associated data files:
DROP PLUGGABLE DATABASE FURQAN KEEP DATAFILES;
INCLUDING DATAFILES
-------------------
The following statement drops the PDB pdb_name and its associated data files:
DROP PLUGGABLE DATABASE FURQAN INCLUDING DATAFILES;
No comments:
Post a Comment