Home » Infrastructure » Linux » DB creation with dbca command line (Oracle 10gR2, CentOS 5.3)
DB creation with dbca command line [message #424202] Wed, 30 September 2009 12:30 Go to next message
maumercado
Messages: 5
Registered: August 2009
Location: Colombia
Junior Member
Hello all,

Ive been trying to set a script to automatize the creation of our databases, and I have been having some issues specially when it comes to using dbca from command line...

Heres the script
#!/bin/bash
mkdir -p ${ORACLE_BASE}/admin/TRAN/bdump
mkdir -p ${ORACLE_BASE}/admin/TRAN/cdump
mkdir -p ${ORACLE_BASE}/admin/TRAN/create
mkdir -p ${ORACLE_BASE}/admin/TRAN/pfile
mkdir -p ${ORACLE_BASE}/admin/TRAN/udump
mkdir -p ${ORACLE_BASE}/flash_recovery_area
mkdir -p ${ORACLE_BASE}/oradata/TRAN
mkdir -p ${ORACLE_HOME}/cfgtoollogs/dbca/TRAN
mkdir -p ${ORACLE_HOME}/dbs
export ORACLE_SID=TRAN
cp -p * ${ORACLE_BASE}/admin/TRAN/scripts/
${ORACLE_HOME}/bin/dbca -createDatabase -templatename General_purpose.dbc -sid TRAN
${ORACLE_HOME}/bin/dbca -edit -sid TRAN -startmode a
${ORACLE_HOME}/bin/orapwd file=${ORACLE_HOME}/dbs/PWDTRAN.ora password=change_on_install
${ORACLE_HOME}/bin/sqlplus /nolog @${ORACLE_BASE}/admin/TRAN/scripts/CreateDB.sql
${ORACLE_HOME}/bin/sqlplus /nolog @${ORACLE_BASE}/admin/TRAN/scripts/CreateDBFiles.sql
${ORACLE_HOME}/bin/sqlplus /nolog @${ORACLE_BASE}/admin/TRAN/scripts/CreateDBCatalog.sql
${ORACLE_HOME}/bin/sqlplus /nolog @${ORACLE_BASE}/admin/TRAN/scripts/CreateUserRoles.sql
${ORACLE_HOME}/bin/sqlplus /nolog @${ORACLE_BASE}/admin/TRAN/scripts/postDBCreation.sql
echo You should Add this entry in the /etc/oratab: TRAN:/u01/app/oracle/product/10.2.0/db_1:Y
/u01/app/oracle/product/10.2.0/db_1/bin/sqlplus /nolog @/u01/app/oracle/admin/TRAN/scripts/TRAN.sql



it gives a dbca insufficient commands problem... likes theres something lacking.. dont know what to do now

Thank you...
Re: DB creation with dbca command line [message #424216 is a reply to message #424202] Wed, 30 September 2009 14:51 Go to previous messageGo to next message
BlackSwan
Messages: 24905
Registered: January 2009
Senior Member
>it gives a dbca insufficient commands problem... likes theres something lacking.. dont know what to do now


dbca -help


It appears you are missing a required parameter
Re: DB creation with dbca command line [message #424308 is a reply to message #424202] Thu, 01 October 2009 08:54 Go to previous messageGo to next message
maumercado
Messages: 5
Registered: August 2009
Location: Colombia
Junior Member
Hello,

First of all, yes of course Im missing a required parameter the question I was trying to ask is which one... so I spent more time googling and reading the output of dcba -help and came up with this:
${ORACLE_HOME}/bin/dbca -createDatabase -templatename General_purpose.dbc -gdbName TRAN.quipux.local -sid TRAN


and it opens the dbca window which I dont want it to do, cuz as I said I wanted to be fully automatic, the good news is that it does fill the spaces when informations such as SID and global name is needed because Im telling it to do so from command, as for now this will do... but all suggestions and ideas are welcome to make my database creation more optimal.

Thank you Blackswan, and thank you all.. (sincerely) Smile
Re: DB creation with dbca command line [message #424384 is a reply to message #424308] Thu, 01 October 2009 23:03 Go to previous messageGo to next message
BlackSwan
Messages: 24905
Registered: January 2009
Senior Member
dbca is a GUI utility.
The way Oracle creates new databases is by using RMAN to restore a previously backed DB.
Re: DB creation with dbca command line [message #524808 is a reply to message #424384] Mon, 26 September 2011 23:26 Go to previous message
biddi87
Messages: 1
Registered: September 2011
Location: Adelaide
Junior Member
add the -silent parameter to stop the GUI launching
Previous Topic: Data Pump expdp to root directory
Next Topic: Trying to sort out uniq tables from Gather stat job trace
Goto Forum:
  


Current Time: Mon Sep 26 04:19:48 CDT 2016

Total time taken to generate the page: 0.09560 seconds