Skip to main content
NetApp database solutions

Create the Oracle primary database on Google Cloud NetApp Volumes

Contributors netapp-jsnyder

Create the Oracle primary database on Google Cloud NetApp Volumes iSCSI storage using Oracle Database Configuration Assistant in silent mode. This procedure covers running dbca to create the container database and pluggable database on GCNV-backed ASM disk groups, configuring archive log destinations, and adding a role-based application service for transparent failover after Data Guard is enabled.

Steps

Create the Oracle container database and pluggable database on oracdb1 using dbca in silent mode, configure archive log destinations, verify Oracle Restart registration, and add a role-based application service for transparent client failover.

  1. Run dbca in silent mode to create the CDB and PDB on the ASM disk groups:

    sudo -u oracle bash -c '
    export ORACLE_HOME=/u01/app/oracle/product/26ai/db_1
    export PATH=$ORACLE_HOME/bin:$PATH
    
    dbca -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
    '
  2. Point archivelogs at +RECO and open and save the pluggable database state. The standby uses matching archivelog settings in Step 2: Standby init.ora, pfile, and NOMOUNT:

    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
    '
  3. Verify the database is running under Oracle Restart:

    sudo /u01/app/26ai/grid/bin/srvctl status database -d orcl
    # Expected: Database is running
    
    sudo -u oracle sqlplus -s / as sysdba <<<"SELECT name, open_mode, log_mode FROM v\$database;"
    # Expected: ORCL, READ WRITE, ARCHIVELOG
  4. Create a role-based application service so applications connect via orclapp and failover is transparent when Data Guard is enabled:

    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:$PATH
    
    srvctl add service \
      -db orcl \
      -service orclapp \
      -pdb orclpdb \
      -role PRIMARY \
      -policy AUTOMATIC
    
    srvctl start service -db orcl -service orclapp
    srvctl status service -db orcl -service orclapp
    '

    After the Data Guard Broker is enabled, orclapp runs only on the PRIMARY. Multiplex control files across ASM disk groups and size memory to workload.

What's next?

To establish standby protection and readiness for failover, go to Create the Oracle standby database on oracdb2.