This page describes how to create the primary database (in this case, oracdb1)
using the Oracle Database Configuration Assistant (DBCA).
To create the primary database oracdb1, complete the following steps:
Create a container database and a pluggable database on
oracdb1by using the Oracle DBCA in silent mode against the ASM disk groups.sudo -u oracle bash -c ' export ORACLE_HOME=/u01/app/oracle/product/26ai/db_1 export PATH=$ORACLE_HOME/bin:$PATHdbca -silent -createDatabase \ -templateName General_Purpose.dbc \ -gdbname orcl -sid orcl \ -characterSet AL32UTF8 -nationalCharacterSet AL16UTF16 \ -sysPassword "ChangeMe!1" -systemPassword "ChangeMe!1" \ -emConfiguration NONE \ -datafileDestination +DATA -storageType ASM \ -recoveryAreaDestination +FRA -recoveryAreaSize 25000 \ -enableArchive true -archiveLogMode AUTO \ -memoryMgmtType AUTO_SGA -totalMemory 4096 \ -databaseType MULTIPURPOSE \ -createAsContainerDatabase true -numberOfPDBs 1 \ -pdbName orclpdb -pdbAdminPassword "ChangeMe!1" \ -ignorePreReqs 'Specify the destination where the redo log files are archived as
+RECO. Open the pluggable database and save its state.sudo -u oracle bash -c ' export ORACLE_HOME=/u01/app/oracle/product/26ai/db_1 export ORACLE_SID=orcl$ORACLE_HOME/bin/sqlplus -s / as sysdba <<SQL ALTER SYSTEM SET log_archive_dest_1='\''LOCATION=+RECO VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orcl'\'' SCOPE=BOTH; ALTER PLUGGABLE DATABASE ALL OPEN; ALTER PLUGGABLE DATABASE ALL SAVE STATE; EXIT SQL'Verify that the database is up and running.
sudo /u01/app/26ai/grid/bin/srvctl status database -d orcl # Expected: Database is runningsudo -u oracle sqlplus -s / as sysdba <<<"SELECT name, open_mode, log_mode FROM v\$database;" # Expected: ORCL, READ WRITE, ARCHIVELOGCreate a role-based application service so that applications connect through
orclapp, and the failover is transparent.sudo -u oracle bash -c ' export GRID_HOME=/u01/app/26ai/grid export ORACLE_HOME=/u01/app/oracle/product/26ai/db_1 export PATH=$ORACLE_HOME/bin:$GRID_HOME/bin:$PATHsrvctl add service \ -db orcl \ -service orclapp \ -pdb orclpdb \ -role PRIMARY \ -policy AUTOMATICsrvctl start service -db orcl -service orclapp srvctl status service -db orcl -service orclapp '
After the Oracle Data Guard Broker is enabled, orclapp runs only on the Primary
database. For Multiplex control files across ASM disk groups, size memory to the workload.