Use your own templates in DBCA to create databases

Use your own templates in DBCA to create databasesAnother advice regarding database creation:
Use your own templates in DBCA to create databases.

This way you can configure not only the options and components to create but also redo log layout, your set of parameters and much more. And it is less error prone than a “create database” script.

Use your own template in DBCA

Creating your own template in DBCA (Database Configuration Assistant) is quite easy and straight forward. In DBCA select “Manage Templates”:

Use your own templates in DBCA to create databases

DBCA – Choose “Manage Templates” to create a new template

and create a new template:

Use your own templates in DBCA to create databases

DBCA – Specify a name for your new templateDBCA-Templates

from an existing database template:

Use your own templates in DBCA to create databases

DBCA – Create the new template from an existing template

Choose the “Custom Database” template as blueprint:

Use your own templates in DBCA to create databases

DBCA – Create your new template with the blueprint “Custom Database” template

Choose the components you’d like to have

Then later you can choose which options you’d like to configure:

Use your own templates in DBCA to create databases

DSBCA – Choose the options you’d like to configure

Adjust Default Parameters and Storage Locations

Very important: Adjust the default parameters as needed.

Use your own templates in DBCA to create databases

DBCA – Adjust default parameters for your future database creation

JOB_QUEUE_PROCESSES and AUDIT_TRAIL for instance will be set in DBCA always to defaults which may not meet your requirements and needs. See also the description and the potential values in the screen below when you mark a parameter:

Use your own templates in DBCA to create databases

DBCA – Adjust for instance AUDIT_TRAIL and JOB_QUEUE_PROCESSES

It is even more important to “Customize Storage Location” as this will allow you to change the default setting for redo logs and tablespaces.

Use your own templates in DBCA to create databases

DBCA – Customize Storage Locations for your future database creation

Adjust for instance the size of the redo logs, multiplex them and place them on the correct storage:

Use your own templates in DBCA to create databases

DBCA – Customize the Redo Logs, multiplex them, change size and location

And don’t forget to click “Apply” after every change as otherwise your changes will be lost without notice:

Use your own templates in DBCA to create databases

DBCA – Don’t forget to hit APPLY after every single change

Once done, the template got created:

Use your own templates in DBCA to create databases

DBCA – Template creation done

Create a database with your own template

Choose now your own template to create a new database from it:

Use your own templates in DBCA to create databases

DBCA – Chose your own template for database creation

But interestingly enough, this doesn’t give you now a one-click creation. You still have the choice to create your database as a non-CDB or CDB, to change things – but the values you have chosen get populated into the fields of DBCA.

If you desire an automatic one-command creation you will have to use the silent mode where you can pass in your own template.

Further reading

See my previous blog post about creating custom databases:

Always create databases as CUSTOM databases

–Mike

 

Leave a Reply

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