When we create a database using dbca silent option, by default the database is created in noarchivelog mode. So to enable archiving, one will have to shutdown, mount, enable archivelog and then open the database.
Normally we’ll use following command line to create a database using dbca
$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName ORCL -sid ORCL -SysPassword oracle -SystemPassword oracle -emConfiguration NONE -storageType ASM -asmSysPassword oracle -diskGroupName DG8
Here we use a readymade template General_Purpose.dbc, which is shipped by oracle along with it’s install binaries. So the trick is to create a new template using existing one, but enable the archiving.
Following are the steps, one need to follow to create a new template
Select Manage Template option
Select Create a Database Template, from an existing template
Select General Purpose Template
Specify new template name (Here I’ve entered mytemplate)
Select Use database File Locations from template
This is the most important screen, in creating the template. Here we’ll specify to enable archiving and Flash Recovery Area
Specify the memory parameters
Verify the file locations and click next
Check the parameters, options and click next
Template Creation is in progress (dbca will create files in $ORACLE_HOME/assistants/dbca/templates)
$ cd $ORACLE_HOME/assistants/dbca/templates
$ ls -al | grep my
-rw-r—– 1 ora11 oinstall 5405 May 7 18:24 mytemplate.dbc (database configuration XML)
-rw-r—– 1 ora11 oinstall 187441152 May 7 18:24 mytemplate.dfb (data file backup)
Template creation finished.
Now create the database using new template
$ dbca -silent -createDatabase -templateName mytemplate.dbc -gdbName ORCL -sid ORCL -SysPassword oracle -SystemPassword oracle -emConfiguration NONE -storageType ASM -asmSysPassword oracle -diskGroupName DG8 -recoveryGroupName DG1
Copying database files
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 3%
DBCA_PROGRESS : 37%
Creating and starting Oracle instance
DBCA_PROGRESS : 40%
DBCA_PROGRESS : 45%
DBCA_PROGRESS : 50%
DBCA_PROGRESS : 55%
DBCA_PROGRESS : 56%
DBCA_PROGRESS : 60%
DBCA_PROGRESS : 62%
Completing Database Creation
DBCA_PROGRESS : 66%
DBCA_PROGRESS : 70%
DBCA_PROGRESS : 73%
DBCA_PROGRESS : 77%
DBCA_PROGRESS : 88%
DBCA_PROGRESS : 100%
Database creation complete. For details check the logfiles at:
/oracle/cfgtoollogs/dbca/ORCL.
Database Information:
Global Database Name:ORCL
System Identifier(SID):ORCL
Verify if the database is placed in archivelog.
Database is now in archivelog mode.
But what in the template sets the archivelog to be on? You don’t show what actually turns it on?
Check the .dbc, which is database configuration XML. XML tag <archiveLogMode> false/true </archiveLogMode> will control the archivelog mode.
Found it. Thanks!