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/
This means that the listener (the software that listens on the network for database connection attempts) doesn't know that your DB exists.
Normally, when you start up an Oracle 11g DB, it'll automatically "register" with the listener within 60 seconds or so (I believe it's background process PMON responsible for this). You can force a listener registration by connecting as sysdba on the local machine - e.g.:
SHELL> sqlplus / as sysdba
Then typing:
SQL> ALTER DATABASE REGISTER;
This will tell the database to register with the listener.
However - this relies on the database knowing how to talk to the listener! Because your listener is listening on port 1522, so you'll need to explicitly tell your database where to find it:
See http://docs.oracle.com/cd/E11882_01/network.112/e41945/listenercfg.htm#NETAG1154 ("Registering Information with a Local Listener")
For a real-world example, see:
http://edstevensdba.wordpress.com/2011/07/30/exploring-the-local_listener-parameter/
As to whether you should use DBCA or the query... it's up to you. DBCA is by far the simpler, however it also hides the details away. My preference is to use DBCA to generate a set of scripts which I then peruse and alter as appropriate.
Best Answer
First of all, you could check the newly created init/spfile (under; linux: $OB/dbs - or - win: $OB\database) if everything is set correctly (SID and Service Name, Datafile location...)
I also would advise you to check all your env. vars, the error says “Database already mounted” - it seems it’s trying to create a .ctl for your already-running database.
You can try this to start fresh;
Linux
./profile new
env
Windows
set ORACLE_SID=[your new SID]
set ORACLE_HOME=[your new $OH]
Last thing, i would take a look at the oraInventory/oraInst.lok file, to check if there’s the old $OH set - if yes, move the file away (just to backup it) and restart the dbca.
Hope one of this solutions helps.