Oracle,Pluggable Different ortypes of creating Pluggable Database manually
There are multiple ways to create a pluggable database, in this article we would go through the process of creating PDB manually as in certain cases where GUI model is not feasible as
creating a PDB using DBCA needs GUI to be invoked.
“CREATE PLUGGABLE DATABASE” is the command line which will help us to create a PDB inside a CDB.
I’m taking this oppurtunity to use ASM diskgroup as the PDB file system, the same is applicable to file system with minimal changes.
1) Directlty use CREATE_FILE_DEST clause with CREATE PLUGGABLE DATABASE STATEMENT
CREATE PLUGGABLE DATABASE pdb_cfd ADMIN USER pdb_cfd_admin IDENTIFIED BY pdb_pw_cfd CREATE_FILE_DEST=’+NEW_PDB_LOC’;
2) By enabling Oracle Managed File parameter at the CDB level
ALTER SYSTEM SET db_create_file_dest = ‘+NEW_PDB_LOC’;
CREATE PLUGGABLE DATABASE pdbmanual ADMIN USER pdb_manual_admin IDENTIFIED BY pdb_pwdadmin;
3) Use FILE_NAME_CONVERT clause with CREATE PLUGGABLE DATABASE STATEMENT
CREATE PLUGGABLE DATABASE pdb_fnc ADMIN USER pdb_fnc_admin IDENTIFIED BY pdb_fnc_passw FILE_NAME_CONVERT=(‘+OLD_PDB_LOC’,’+NEW_PDB_LOC’);
4) Use PDB_FILE_NAME_CONVERT clause with CREATE PLUGGABLE DATABASE STATEMEN
ALTER SESSION SET PDB_FILE_NAME_CONVERT=’+OLD_PDB_LOC’,’+NEW_PDB_LOC”;
CREATE PLUGGABLE DATABASE pdb_sfnc ADMIN USER pdb_sfnc_admin IDENTIFIED BY passsfnc;
‘+OLD_PDB_LOC’ is ASM diskgroup location of PDB$SEED.
‘+NEW_PDB_LOC’ is ASM diskgroup location of New pdb.
Here is a sample example of above PDB manual creations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
SQL> CREATE PLUGGABLE DATABASE pdb_fnc ADMIN USER pdb_fnc_admin IDENTIFIED BY pdb_fnc_passw FILE_NAME_CONVERT=('+DATA','+RECO'); Pluggable database created. SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 ORCLPDB MOUNTED 4 SECUREPDB MOUNTED 5 PDBMANUAL READ WRITE NO 6 PDB_CFD READ WRITE NO 7 PDB_FNC MOUNTED SQL> select name from v$datafile where con_id=7; NAME ------------------------------ +RECO/ORCLCDB/ED02C98BB5B62D35E0535900000ACF49/DATAFILE/system.293.1120248467 +RECO/ORCLCDB/ED02C98BB5B62D35E0535900000ACF49/DATAFILE/sysaux.294.1120248467 +RECO/ORCLCDB/ED02C98BB5B62D35E0535900000ACF49/DATAFILE/undotbs1.292.1120248467 SQL> ALTER SESSION SET PDB_FILE_NAME_CONVERT='+DATA',’+RECO'; Session altered SQL> CREATE PLUGGABLE DATABASE pdb_sfnc ADMIN USER pdb_sfnc_admin IDENTIFIED BY passsfnc; Pluggable database created. SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ----------------------- ---------- ---------- 2 PDB$SEED READ ONLY NO 3 ORCLPDB MOUNTED 4 SECUREPDB MOUNTED 5 PDBMANUAL READ WRITE NO 6 PDB_CFD READ WRITE NO 7 PDB_FNC MOUNTED 8 PDB_SFNC MOUNTED SQL> select name from v$datafile where con_id=8; NAME ------------------------------------------------------------------------------------------ +DATA/ORCLCDB/ED02C98BB5B82D35E0535900000ACF49/DATAFILE/system.312.1120248799 +DATA/ORCLCDB/ED02C98BB5B82D35E0535900000ACF49/DATAFILE/sysaux.313.1120248799 +DATA/ORCLCDB/ED02C98BB5B82D35E0535900000ACF49/DATAFILE/undotbs1.311.1120248799 |
Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates
KTExperts is always active on social media platforms.
Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts
Instagram : https://www.instagram.com/knowledgesharingplatform