GotoDBA Features,Infrastructure Using DBCA in Silent Mode (19c)

Using DBCA in Silent Mode (19c)

I have struggled a lot with DBCA in silent mode. Its documentation lacks quite a bit, the error messages are not great, and the tool has quite a few issues.

In this post I’ll cover some things I encountered and how to fix them. My examples are not using a response file, but I am using dbca with -“silent” and a database template file.

Before I start I just want to say that the template issues I mention here are relevant if you edit the file yourself (which I had to do in some cases). If you use dbca, configure everything correctly and then let dbca create the template for you, the template is good and will not have some of the issues below.

Multitenant

It seems that the template file doesn’t have the multitenant option, so if you want to create a multitenant (or not) database, you’ll have to configure it in the command line. The parameter is “createAsContainerDatabase” and the values are “true” or “false”. The documentation doesn’t say what the default is, but I checked and it’s “false”. If you want a multitenant database you should specifically have the “createAsContainerDatabase true” clause in your dbca command.

DBT-12509

This might be an obvious thing, but it took me a few minutes to figure out what I’m doing wrong. I didn’t want any of the options in the database (e.g. Jserver, Spatial, etc.), so in the template I just changed them to ‘value=”false”‘ (as I said at the top, I did that manually by editing the file), like this:

   <option name="OMS" value="false" includeInPDBs="false"/>
   <option name="JSERVER" value="false" includeInPDBs="true"/>
   <option name="SPATIAL" value="false" includeInPDBs="true"/>
   <option name="IMEDIA" value="false" includeInPDBs="true"/>

But then I got:

[FATAL] [DBT-12509] Option IMEDIA is enabled in the PDBs but not in the CDB.
   CAUSE: This option must be enabled in the CDB in order to be included in the PDBs.
   ACTION: Enable the option IMEDIA in the CDB.

This error doesn’t make sense, especially because I’m installing a non-CDB database. But then I realized the mistake. In each option in the template there is also the “includeInPDBs” clause, and I left it as “true”. I don’t know why Oracle even cares about that when I’m creating a non-CDB database, but in any case, if you don’t want to option, you have to set it to “false” as well, like this:

   <option name="OMS" value="false" includeInPDBs="false"/>
   <option name="JSERVER" value="false" includeInPDBs="false"/>
   <option name="SPATIAL" value="false" includeInPDBs="false"/>
   <option name="IMEDIA" value="false" includeInPDBs="false"/>

SGA Parameters

If you edit the template file manually and would like to set memory parameters, be aware that under the “<MiscParams>” tag you can will find “percentageMemTOSGA” with a value. This value is used to configure AMM. If you’d like to disable AMM you will have to have the “customSGA” tag with the value “true”:

      <MiscParams>
         ...
         <percentageMemTOSGA>40</percentageMemTOSGA>
         <customSGA>true</customSGA>
         ...
      </MiscParams>

Datafile Location

Datafile location can be configured in a two different places. One is in the template file (there is a section for every file and tablespace and the path can be configured there). The other option (which also overwrite the template) is in the dbca command using the “-datafileDestination <path>” flag.

There is also another flag called “-storageType” that accepts the values “FS” or “ASM”. I don’t really know why they need this as destination that started with “/” is filesystem and with “+” is ASM, but it is there and available.

Variables

You can specify any variable in the template file with the curly brackets and then pass its value in the dbca command line using the “-variables” parameter. For example, in my template I can have:

 <DatafileAttributes id="{SYS_LOCATION}/system01.dbf">

And then, I run the dbca with:

$ dbca ..... -variables SYS_LOCATION=/tmp

You can pass as many variables as you’d like, they should be separated with commas and without any spaces between then, e.g.

-variables VAR1=v1,VAR2=v2,VAR3=v3

However, note that I quite often have issues with that (for example bug 25353173 in 12.2). I also seem to have an issue with 19.5 (even though in a simple test it works), I’m checking this now and will update.

Initialization Parameters

If you add initialization parameters to your template, when you first create a database from this template you should verify that all the parameters are there.

Many years ago, with 11.2, some of the parameters were ignored (I specifically remember recyclebin=off). I checked that now with 19.5 and it works fine, but it’s better to just make sure that everything is there before you trust that the database will have all the parameters set.

Tags: ,

1 thought on “Using DBCA in Silent Mode (19c)”

  1. Thanks for sharing your experience. Looks that many settings can do in command line parameters, but for some multitenant settings need a custom-modified template *.dbt

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post