sábado, 30 de abril de 2022

How to create a CDB with 2 PDBs with dbca in silent mode in Oracle 21c

 In the following example I am creating a new database as Container (it's mandatory starting in 21c) with 2 Pluggable Databases using the prefix "pdb1" for the name of the PDBs. I have highlighted the 2 most important parameters where we specify the prefix and the amount of PDBs to create.

Creating a CDB:

[oracle@localhost ~]$ dbca -silent -createDatabase  -templateName General_Purpose.dbc -gdbname orcl -sid orcl -responseFile NO_VALUE -characterSet AL32UTF8 -nationalCharacterSet AL16UTF16  -sysPassword **** -systemPassword ****  -numberOfPDBs 2 -pdbName pdb1 -pdbAdminPassword **** -databaseType MULTIPURPOSE -memoryMgmtType auto_sga -memoryPercentage 45 -storageType FS -datafileDestination /u01/app/oracle/oradata -databaseConfigType single  -redoLogFileSize 1024 -enableArchive false -emConfiguration NONE -dbOptions IMEDIA:false,CWMLITE:false,SAMPLE_SCHEMA:false,ORACLE_TEXT:false,APEX:false,OMS:false,DV:false,JSERVER:false,SPATIAL:false -ignorePreReqs

Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
53% complete
54% complete
Creating Pluggable Databases
58% complete
63% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/product/19.0.0/db_base/cfgtoollogs/dbca/orcl.
Database Information:
Global Database Name:orcl
System Identifier(SID):orcl
Look at the log file "/u01/app/oracle/product/19.0.0/db_base/cfgtoollogs/dbca/orcl/orcl3.log" for further details.
[oracle@localhost ~]$

 

 Verifying the new CDB and the PDBs:

[oracle@localhost ~]$ export ORACLE_SID=orcl
[oracle@localhost ~]$ sqlplus / as sysdba
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB11                          READ WRITE NO
         4 PDB12                          READ WRITE NO

 

As you can see 2 PDBs were created, each with the prefix "pdb1" for the name. 

 

No hay comentarios:

Publicar un comentario

Oracle ACE Director Award - Deiby Gómez

Thanks #OracleACE Program for this awesome certificate recognizing the work I have done in the community for the last year. Looking forwa...