Since you asked RAC, please see if you can use this non-RAC example as a starting point.
For db_name != db_unique_name != sid
- Non-RAC
- Oracle 12.1
- Custom Database (not seed)
On the command line, set ddbname == parameter db_unique_name, and also set parameter db_name
dbca \
-silent \
-createDatabase \
-templateName wailua.dbt \
-sid wailua20 \
-gdbname wailuaq \
-initParams db_unique_name=wailuaq,db_name=wailua \
where wailua.dbt is copied from New_Database.dbt
db_name and db_unique_name are not mentioned in wailua.dbt
Note that variables
SID and DB_UNIQUE_NAME expand in the template.
[oracle@waipio1 wailua20 templates]$ echo $ORACLE_SID
wailua20
[oracle@waipio1 wailua20 templates]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Wed Jun 11 00:48:22 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options
SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string wailua
SQL> show parameter db_unique_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string wailuaq
oratab:
wailua20:/app/oracle/product/12.1.0/db_1:N: # line added by Agent
ASM:
asmcmd ls data/WAILUAQ/
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfilewailua20.ora
Full crdb.wailua.ksh dbca script: http://pastebin.com/vx3k5g3U/
dbca log: http://pastebin.com/8UQDEDZn/
Why not just create luns on the new storage, with same size as on old storage and add them to the existing disk groups. Next drop the old disks from the disk group and when the re-balance is over, your system is migrated to the new storage, without any downtime.
Works like a charm. ASM is way smarter than a filesystem.
Best Answer
You can try and compare this yourself with DBCA.
When you create a new database with DBCA and choose the
Custom Database
option, that does not include datafiles, and creates a database from scratch by running scripts to build the dictionary and other objects. This may take 15-60 minutes depending on the hardware and options selected.When you choose the
General Purpose
option, that in fact performs an RMAN restore of a database that was already prepared and included in the database software. This should not take more than 5 minutes. It is indeed faster. (I do not like it though, because it contains extra cost options such as Spatial or OLAP, and I prefer to keep the database small and simple, so by default I skip all options, even Java and Text).With DBCA, you can use an existing database as source for creating a template that includes datafiles as well, so yes, you can build your initial database, create a template from it, and reuse it.