From oracle 19c onward, we can create a database using dbca utility in silent mode with help of response file.
Default response file location:
export
ORACLE_HOME=/oracle/app/oracle/product/19.9.0.0/dbhome_1
cd $ORACLE_HOME/assistants/dbca
By using the default response files, you can create a new
response file, as per your requirement.
Below is the response file i have created.
cat
/export/home/oracle/db_create.rsp
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0
gdbName=ONEDBA
sid=ONEDBA
databaseConfigType=SI
policyManaged=false
createServerPool=false
createAsContainerDatabase=false
templateName=/oracle/app/oracle/product/19.9.0.0/dbhome_1/assistants/dbca/templates/New_Database.dbt
sysPassword=oracle#123
systemPassword=oracle#123
runCVUChecks=FALSE
dvConfiguration=false
olsConfiguration=false
datafileJarLocation=
datafileDestination=/oradata/{DB_UNIQUE_NAME}/
storageType=FS
characterSet=AL32UTF8
nationalCharacterSet=UTF8
listeners=LISTENER_B2COM
variables=ORACLE_BASE_HOME=/oracle/app/oracle/product/19.9.0.0/dbhome_1,DB_UNIQUE_NAME=ONEDBA,ORACLE_BASE=/oracle/app/oracle,PDB_NAME=,DB_NAME=ONEDBA,ORACLE_HOME=/oracle/app/oracle/product/19.9.0.0/dbhome_1,SID=ONEDBA
initParams=undo_tablespace=UNDOTBS1,sga_target=10093MB,db_block_size=8192BYTES,log_archive_dest_1='LOCATION=/archive/ONEDBA',nls_language=AMERICAN,dispatchers=(PROTOCOL=TCP)
(SERVICE=DBACLASS9XDB),diagnostic_dest={ORACLE_BASE},control_files=("/oradata/{DB_UNIQUE_NAME}/control01.ctl",
"/oradata/{DB_UNIQUE_NAME}/control02.ctl"),remote_login_passwordfile=EXCLUSIVE,audit_file_dest={ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump,processes=1400,pga_aggregate_target=3365MB,nls_territory=AMERICA,local_listener=LISTENER_DBACLASS9,open_cursors=300,log_archive_format=%t_%s_%r.dbf,compatible=19.0.0,db_name=ONEDBA,audit_trail=db
sampleSchema=false
memoryPercentage=40
databaseType=MULTIPURPOSE
automaticMemoryManagement=false
totalMemory=0
1.
Oracle binary/home is already installed
2.
Requirement directory structure is already created
Now run DBCA in silent mode:
oracle@b2bdev:~$ dbca -silent -createDatabase -responseFile /export/home/oracle/db_create.rsp[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards. CAUSE:a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].b.The password entered is a keyword that Oracle does not recommend to be used as password ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards. CAUSE:a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].b.The password entered is a keyword that Oracle does not recommend to be used as password ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.Prepare for db operation5% completeCreating and starting Oracle instance6% complete9% completeCreating database files10% complete14% completeCreating data dictionary views15% complete18% complete19% complete22% complete23% complete25% complete27% completeOracle JVM34% complete41% complete48% complete50% completeOracle Text51% complete54% complete55% completeOracle Multimedia68% completeOracle OLAP69% complete70% complete71% complete72% complete73% completeOracle Spatial74% complete82% completeCompleting Database Creation85% complete86% completeExecuting Post Configuration Actions100% completeDatabase creation complete. For details check the logfiles at: /oracle/app/oracle/cfgtoollogs/dbca/ONEDBA.Database Information:Global Database Name:ONEDBASystem Identifier(SID):ONEDBALook at the log file "/oracle/app/oracle/cfgtoollogs/dbca/ONEDBA/ONEDBA.log" for further details.DB has been created successfully
post check:
SQL> select name,open_mode from v$database; NAME OPEN_MODE--------- --------------------ONEDBA READ WRITE SQL> select comp_id,status from dba_registry; COMP_ID STATUS------------------------------ --------------------------------------------CATALOG VALIDCATPROC VALIDRAC OPTION OFFJAVAVM VALIDXML VALIDCATJAVA VALIDAPS VALIDXDB VALIDOWM VALIDCONTEXT VALIDORDIM VALID COMP_ID STATUS------------------------------ --------------------------------------------SDO VALIDXOQ VALID