Creating a database using DBCA can be done in both ways, 1) either INTERACTIVE which provides GUI window to configure your options just like any other software you would install OR 2) SILENT method where you can achieve the same with a single command.
Even in the SILENT mode, you have 2 ways, 1) to use RESPONSE file 2) to exclude response file and put all the configuration options in DBCA command as shown in this post. I'll cover the SILENT installation using RSP file in another post.
So before creating a database in silent mode, you just need to ensure that your Environment variables are set. Then you can proceed with a command like below to create your database.
Note: I have not used all the configurable options, rather used the minimum of what's needed for my instance. Please refer Oracle documentation on Silent Installation to get idea on full parameter options that can be used with DBCA SILENT command.
Here I am creating a database named CDB2, as a container DB, with 1 PDB (PDB1) attached.
[oracle@oravm19c ~]$ dbca -silent -createDatabase \ > -templateName General_Purpose.dbc \ > -gdbname cdb2 -sid cdb2 -responseFile NO_VALUE \ > -characterSet AL32UTF8 \ > -sysPassword CdbP$#wd2 \ > -systemPassword CdbP$#wd2 \ > -createAsContainerDatabase true \ > -numberOfPDBs 1 \ > -pdbName pdb1 \ > -pdbAdminPassword PdbP$#wd1 \ > -databaseType MULTIPURPOSE \ > -memoryMgmtType auto_sga \ > -totalMemory 1400 \ > -storageType FS \ > -datafileDestination "/u01/app/oracle/oradata/" \ > -redoLogFileSize 50 \ > -emConfiguration NONE \ > -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 77% complete Executing Post Configuration Actions 100% complete Database creation complete. For details check the logfiles at: /u01/app/oracle/cfgtoollogs/dbca/cdb2. Database Information: Global Database Name:cdb2 System Identifier(SID):cdb2 Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb2/cdb2.log" for further details. [oracle@oravm19c ~]$
[oracle@oravm19c ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 13 11:39:12 2025 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> select name, open_mode from V$database; NAME OPEN_MODE --------- -------------------- CDB2 READ WRITE SQL> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB1 READ WRITE NO SQL>
No comments:
Post a Comment