Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.

Rasul Allah (sal Allahu alaihi wa sallam) said: "Restore the trusts of those who trust you, and deal not falsely with him who deals falsely with you." [Abu Dawud, Tirmidhi]

Search This Blog

Thursday, September 3, 2015

Creating database using dbca -silent

How to create a database using dbca -silent ..

The bare minimum configuration is :

[oracle@collabn1 oracle]$ dbca -silent -gdbname SHAIKDB.shaiksameer -sid SHAIKDB -datafileDestination /u01/app/oracle/SHAIKDB -createdatabase -templatename General_Purpose.dbc
Enter SYS user password:

Enter SYSTEM user password:

Copying database files
1% complete
3% complete
35% complete
Creating and starting Oracle instance
37% complete
42% complete
47% complete
52% complete
53% complete
56% complete
58% complete
Registering database with Oracle Restart
64% complete
Completing Database Creation
68% complete
71% complete
75% complete
85% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/SHAIKDB/SHAIKDB0.log" for further details

or you can provide more info as below:

[oracle@collabn1 ~]$ dbca -silent -createdatabase -templatename General_Purpose.dbc -gdbname SHAIKDB.shaiksameer  -sid SHAIKDB -syspassword test123 -systempassword test123 -emconfiguration none   -datafiledestination /u01/app/oracle/SHAIKDB -recoveryAreaDestination /u01/app/oracle/SHAIKDB/fra  -memorypercentage 30 -redologfilesize 100


Copying database files
1% complete
3% complete
35% complete
Creating and starting Oracle instance
Creating and starting Oracle instance
37% complete
42% complete
47% complete
52% complete
53% complete
56% complete
58% complete
Registering database with Oracle Restart
64% complete
Completing Database Creation
68% complete
71% complete
75% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/SHAIKDB/SHAIKDB.log" for further details.


[oracle@collabn1 ~]$ env | grep ORA
ORACLE_SID=SHAIKDB
ORACLE_BASE=/u01/app/oracle
ORAENV_ASK=NO
ORACLE_HOME=/u01/app/oracle/product/11.2.0.2/SHAIKPROD

SHAIKDB>select banner from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0    Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production


select comp_name,version,status from dba_registry;

COMP_NAME                 VERSION            STATUS
---------------------------------------- ------------------------------ -----------
OWB                     11.2.0.1.0            VALID
Oracle Application Express         3.2.1.00.10            VALID
Oracle Enterprise Manager         11.2.0.1.0            VALID
OLAP Catalog                 11.2.0.1.0            VALID
Spatial                  11.2.0.1.0            VALID
Oracle Multimedia             11.2.0.1.0            VALID
Oracle XML Database             11.2.0.1.0            VALID
Oracle Text                 11.2.0.1.0            VALID
Oracle Expression Filter         11.2.0.1.0            VALID
Oracle Rules Manager             11.2.0.1.0            VALID
Oracle Workspace Manager         11.2.0.1.0            VALID
Oracle Database Catalog Views         11.2.0.1.0            VALID
Oracle Database Packages and Types     11.2.0.1.0            VALID
JServer JAVA Virtual Machine         11.2.0.1.0            VALID
Oracle XDK                 11.2.0.1.0            VALID
Oracle Database Java Packages         11.2.0.1.0            VALID
OLAP Analytic Workspace          11.2.0.1.0            VALID
Oracle OLAP API              11.2.0.1.0            VALID

18 rows selected.

dbca -h will give you all the available options:

dbca -h
dbca  [-silent | -progressOnly | -customCreate] {<command> <options> }  | { [<command> [options] ] -responseFile  <response file > } [-continueOnNonFatalErrors <true | false>]
Please refer to the manual for details.
You can enter one of the following command:

Create a database by specifying the following parameters:
    -createDatabase
        -templateName <name of an existing  template>
        [-cloneTemplate]
        -gdbName <global database name>
        [-policyManaged | -adminManaged <Policy managed or Admin managed Database, default is Admin managed database>]
            [-createServerPool <To create ServerPool which will be used by the database to be created>]
            [-force <To create serverpool by force when adequate free servers are not available. This may affect already running database>]
            -serverPoolName <One serverPool Name in case of create server pool and comma separated list of serverPool name in case of use serverpool>
            -[cardinality <Specify cardinality for new serverPool to be created, default is the number of qualified nodes>]
        [-sid <database system identifier prefix>]
        [-sysPassword <SYS user password>]
        [-systemPassword <SYSTEM user password>]
        [-emConfiguration <CENTRAL|LOCAL|ALL|NOBACKUP|NOEMAIL|NONE>
            -dbsnmpPassword <DBSNMP user password>
            -sysmanPassword <SYSMAN user password>
            [-hostUserName <Host user name for EM backup job>
             -hostUserPassword <Host user password for EM backup job>
             -backupSchedule <Daily backup schedule in the form of hh:mm>]
            [-smtpServer <Outgoing mail (SMTP) server for email notifications>
             -emailAddress <Email address for email notifications>]
            [-centralAgent <Enterprise Manager central agent home>]]
        [-disableSecurityConfiguration <ALL|AUDIT|PASSWORD_PROFILE|NONE>
        [-datafileDestination <destination directory for all database files> |  -datafileNames <a text file containing database objects such as controlfiles, tablespaces, redo log files and spfile to their corresponding raw device file names mappings in name=value format.>]
        [-redoLogFileSize <size of each redo log file in megabytes>]
        [-recoveryAreaDestination <destination directory for all recovery files>]
        [-datafileJarLocation  <location of the data file jar, used only for clone database creation>]
        [-storageType < CFS | ASM >
            [-asmsnmpPassword     <ASMSNMP password for ASM monitoring>]
             -diskGroupName   <database area disk group name>
             -recoveryGroupName       <recovery area disk group name>
        [-nodelist <node names separated by comma for the database>]
        [-characterSet <character set for the database>]
        [-nationalCharacterSet  <national character set for the database>]
        [-registerWithDirService <true | false>
            -dirServiceUserName    <user name for directory service>
            -dirServicePassword    <password for directory service >
            -walletPassword    <password for database wallet >]
        [-listeners  <list of listeners to configure the database with>]
        [-variablesFile   <file name for the variable-value pair for variables in the template>]]
        [-variables  <comma seperated list of name=value pairs>]
        [-initParams <comma seperated list of name=value pairs>]
        [-memoryPercentage <percentage of physical memory for Oracle>]
        [-automaticMemoryManagement ]
        [-totalMemory <memory allocated for Oracle in MB>]
        [-databaseType <MULTIPURPOSE|DATA_WAREHOUSING|OLTP>]]


No comments: