In silent mode, you have to profile the database in advance by two ways:
- With response file: you must edit a response file before issuing the dbca command. You can find a template of the dbca response file under $ORACLE_HOME/assistants/dbca.
- Without response file: you must add the key attributes in the dbca command, which's the way we demonstrate the creation.
- Check dbca all attributes first.
- Compse and issue dbca command.
- Check status of the new database after creation.
- Test the connection from an external machine.
- Check Oracle Restart on the database server.
- Check the status of smalldb by the service control.
[oracle@primary01 ~]$ dbca -help
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>]]
...
[oracle@primary01 ~]$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname smalldb -sid smalldb -responseFile NO_VALUE -characterSet AL32UTF8 -memoryPercentage 10 -emConfiguration LOCAL -datafiledestination /u01/app/oracle/oradata -sysPassword pwd1 -systemPassword pwd2 -dbsnmpPassword pwd3 -sysmanPassword pwd4
Copying database files
1% complete
3% complete
10% complete
17% complete
24% 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
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/smalldb/smalldb.log" for further details.
[oracle@primary01 ~]$ echo $ORACLE_SID
primdb1
[oracle@primary01 ~]$ export ORACLE_SID=smalldb
[oracle@primary01 ~]$ echo $ORACLE_SID
smalldb
[oracle@primary01 ~]$ sqlplus / as sysdba
...
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
SQL> set pagesize 500;
SQL> show parameter;
NAME TYPE VALUE
------------------------------------ ----------- ---------------------------
O7_DICTIONARY_ACCESSIBILITY boolean FALSE
active_instance_count integer
aq_tm_processes integer 0
archive_lag_target integer 0
asm_diskgroups string
asm_diskstring string
asm_power_limit integer 1
asm_preferred_read_failure_groups string
audit_file_dest string /u01/app/oracle/admin/smalldb/
adump
audit_sys_operations boolean FALSE
audit_syslog_level string
audit_trail string DB
background_core_dump string partial
background_dump_dest string /u01/app/oracle/diag/rdbms/sma
lldb/smalldb/trace
backup_tape_io_slaves boolean FALSE
bitmap_merge_area_size integer 1048576
blank_trimming boolean FALSE
buffer_pool_keep string
buffer_pool_recycle string
cell_offload_compaction string ADAPTIVE
cell_offload_decryption boolean TRUE
cell_offload_parameters string
cell_offload_plan_display string AUTO
cell_offload_processing boolean TRUE
cell_partition_large_extents string DEFAULT
circuits integer
client_result_cache_lag big integer 3000
client_result_cache_size big integer 0
cluster_database boolean FALSE
cluster_database_instances integer 1
cluster_interconnects string
commit_logging string
commit_point_strength integer 1
commit_wait string
commit_write string
compatible string 11.2.0.0.0
control_file_record_keep_time integer 7
control_files string /u01/app/oracle/oradata/smalld
b/control01.ctl, /u01/app/orac
le/flash_recovery_area/smalldb
/control02.ctl
control_management_pack_access string DIAGNOSTIC+TUNING
core_dump_dest string /u01/app/oracle/diag/rdbms/sma
lldb/smalldb/cdump
cpu_count integer 1
create_bitmap_area_size integer 8388608
create_stored_outlines string
cursor_sharing string EXACT
cursor_space_for_time boolean FALSE
db_16k_cache_size big integer 0
db_2k_cache_size big integer 0
db_32k_cache_size big integer 0
db_4k_cache_size big integer 0
db_8k_cache_size big integer 0
db_block_buffers integer 0
db_block_checking string FALSE
db_block_checksum string TYPICAL
db_block_size integer 8192
db_cache_advice string ON
db_cache_size big integer 0
db_create_file_dest string
db_create_online_log_dest_1 string
db_create_online_log_dest_2 string
db_create_online_log_dest_3 string
db_create_online_log_dest_4 string
db_create_online_log_dest_5 string
db_domain string
db_file_multiblock_read_count integer 73
db_file_name_convert string
db_files integer 200
db_flash_cache_file string
db_flash_cache_size big integer 0
db_flashback_retention_target integer 1440
db_keep_cache_size big integer 0
db_lost_write_protect string NONE
db_name string smalldb
db_recovery_file_dest string /u01/app/oracle/flash_recovery
_area
db_recovery_file_dest_size big integer 3882M
db_recycle_cache_size big integer 0
db_securefile string PERMITTED
db_ultra_safe string OFF
db_unique_name string smalldb
db_writer_processes integer 1
dbwr_io_slaves integer 0
ddl_lock_timeout integer 0
deferred_segment_creation boolean TRUE
dg_broker_config_file1 string /u01/app/oracle/product/11.2.0
/db_1/dbs/dr1smalldb.dat
dg_broker_config_file2 string /u01/app/oracle/product/11.2.0
/db_1/dbs/dr2smalldb.dat
dg_broker_start boolean FALSE
diagnostic_dest string /u01/app/oracle
disk_asynch_io boolean TRUE
dispatchers string (PROTOCOL=TCP) (SERVICE=smalld
bXDB)
distributed_lock_timeout integer 60
dml_locks integer 1084
dst_upgrade_insert_conv boolean TRUE
enable_ddl_logging boolean FALSE
event string
fal_client string
fal_server string
fast_start_io_target integer 0
fast_start_mttr_target integer 0
fast_start_parallel_rollback string LOW
file_mapping boolean FALSE
fileio_network_adapters string
filesystemio_options string none
fixed_date string
gcs_server_processes integer 0
global_context_pool_size string
global_names boolean FALSE
global_txn_processes integer 1
hash_area_size integer 131072
hi_shared_memory_address integer 0
hs_autoregister boolean TRUE
ifile file
instance_groups string
instance_name string smalldb
instance_number integer 0
instance_type string RDBMS
java_jit_enabled boolean TRUE
java_max_sessionspace_size integer 0
java_pool_size big integer 0
java_soft_sessionspace_limit integer 0
job_queue_processes integer 1000
large_pool_size big integer 0
ldap_directory_access string NONE
ldap_directory_sysauth string no
license_max_sessions integer 0
license_max_users integer 0
license_sessions_warning integer 0
listener_networks string
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=prim
ary01-vip)(PORT=1521))))
lock_name_space string
lock_sga boolean FALSE
log_archive_config string
log_archive_dest string
log_archive_dest_1 string
log_archive_dest_10 string
log_archive_dest_11 string
log_archive_dest_12 string
log_archive_dest_13 string
log_archive_dest_14 string
log_archive_dest_15 string
log_archive_dest_16 string
log_archive_dest_17 string
log_archive_dest_18 string
log_archive_dest_19 string
log_archive_dest_2 string
log_archive_dest_20 string
log_archive_dest_21 string
log_archive_dest_22 string
log_archive_dest_23 string
log_archive_dest_24 string
log_archive_dest_25 string
log_archive_dest_26 string
log_archive_dest_27 string
log_archive_dest_28 string
log_archive_dest_29 string
log_archive_dest_3 string
log_archive_dest_30 string
log_archive_dest_31 string
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string enable
log_archive_dest_state_10 string enable
log_archive_dest_state_11 string enable
log_archive_dest_state_12 string enable
log_archive_dest_state_13 string enable
log_archive_dest_state_14 string enable
log_archive_dest_state_15 string enable
log_archive_dest_state_16 string enable
log_archive_dest_state_17 string enable
log_archive_dest_state_18 string enable
log_archive_dest_state_19 string enable
log_archive_dest_state_2 string enable
log_archive_dest_state_20 string enable
log_archive_dest_state_21 string enable
log_archive_dest_state_22 string enable
log_archive_dest_state_23 string enable
log_archive_dest_state_24 string enable
log_archive_dest_state_25 string enable
log_archive_dest_state_26 string enable
log_archive_dest_state_27 string enable
log_archive_dest_state_28 string enable
log_archive_dest_state_29 string enable
log_archive_dest_state_3 string enable
log_archive_dest_state_30 string enable
log_archive_dest_state_31 string enable
log_archive_dest_state_4 string enable
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
log_archive_dest_state_8 string enable
log_archive_dest_state_9 string enable
log_archive_duplex_dest string
log_archive_format string %t_%s_%r.dbf
log_archive_local_first boolean TRUE
log_archive_max_processes integer 4
log_archive_min_succeed_dest integer 1
log_archive_start boolean FALSE
log_archive_trace integer 0
log_buffer integer 4091904
log_checkpoint_interval integer 0
log_checkpoint_timeout integer 1800
log_checkpoints_to_alert boolean FALSE
log_file_name_convert string
max_dispatchers integer
max_dump_file_size string unlimited
max_enabled_roles integer 150
max_shared_servers integer
memory_max_target big integer 392M
memory_target big integer 392M
nls_calendar string
nls_comp string BINARY
nls_currency string
nls_date_format string
nls_date_language string
nls_dual_currency string
nls_iso_currency string
nls_language string AMERICAN
nls_length_semantics string BYTE
nls_nchar_conv_excp string FALSE
nls_numeric_characters string
nls_sort string
nls_territory string AMERICA
nls_time_format string
nls_time_tz_format string
nls_timestamp_format string
nls_timestamp_tz_format string
object_cache_max_size_percent integer 10
object_cache_optimal_size integer 102400
olap_page_pool_size big integer 0
open_cursors integer 300
open_links integer 4
open_links_per_instance integer 4
optimizer_capture_sql_plan_baselines boolean FALSE
optimizer_dynamic_sampling integer 2
optimizer_features_enable string 11.2.0.1
optimizer_index_caching integer 0
optimizer_index_cost_adj integer 100
optimizer_mode string ALL_ROWS
optimizer_secure_view_merging boolean TRUE
optimizer_use_invisible_indexes boolean FALSE
optimizer_use_pending_statistics boolean FALSE
optimizer_use_sql_plan_baselines boolean TRUE
os_authent_prefix string ops$
os_roles boolean FALSE
parallel_adaptive_multi_user boolean TRUE
parallel_automatic_tuning boolean FALSE
parallel_degree_limit string CPU
parallel_degree_policy string MANUAL
parallel_execution_message_size integer 16384
parallel_force_local boolean FALSE
parallel_instance_group string
parallel_io_cap_enabled boolean FALSE
parallel_max_servers integer 10
parallel_min_percent integer 0
parallel_min_servers integer 0
parallel_min_time_threshold string AUTO
parallel_server boolean FALSE
parallel_server_instances integer 1
parallel_servers_target integer 4
parallel_threads_per_cpu integer 2
permit_92_wrap_format boolean TRUE
pga_aggregate_target big integer 0
plscope_settings string IDENTIFIERS:NONE
plsql_ccflags string
plsql_code_type string INTERPRETED
plsql_debug boolean FALSE
plsql_optimize_level integer 2
plsql_v2_compatibility boolean FALSE
plsql_warnings string DISABLE:ALL
pre_page_sga boolean FALSE
processes integer 150
query_rewrite_enabled string TRUE
query_rewrite_integrity string enforced
rdbms_server_dn string
read_only_open_delayed boolean FALSE
recovery_parallelism integer 0
recyclebin string on
redo_transport_user string
remote_dependencies_mode string TIMESTAMP
remote_listener string
remote_login_passwordfile string EXCLUSIVE
remote_os_authent boolean FALSE
remote_os_roles boolean FALSE
replication_dependency_tracking boolean TRUE
resource_limit boolean FALSE
resource_manager_cpu_allocation integer 1
resource_manager_plan string
result_cache_max_result integer 5
result_cache_max_size big integer 1M
result_cache_mode string MANUAL
result_cache_remote_expiration integer 0
resumable_timeout integer 0
rollback_segments string
sec_case_sensitive_logon boolean TRUE
sec_max_failed_login_attempts integer 10
sec_protocol_error_further_action string CONTINUE
sec_protocol_error_trace_action string TRACE
sec_return_server_release_banner boolean FALSE
serial_reuse string disable
service_names string smalldb
session_cached_cursors integer 50
session_max_open_files integer 10
sessions integer 247
sga_max_size big integer 392M
sga_target big integer 0
shadow_core_dump string partial
shared_memory_address integer 0
shared_pool_reserved_size big integer 3774873
shared_pool_size big integer 0
shared_server_sessions integer
shared_servers integer 1
skip_unusable_indexes boolean TRUE
smtp_out_server string
sort_area_retained_size integer 0
sort_area_size integer 65536
spfile string /u01/app/oracle/product/11.2.0
/db_1/dbs/spfilesmalldb.ora
sql92_security boolean FALSE
sql_trace boolean FALSE
sqltune_category string DEFAULT
standby_archive_dest string ?/dbs/arch
standby_file_management string MANUAL
star_transformation_enabled string FALSE
statistics_level string TYPICAL
streams_pool_size big integer 0
tape_asynch_io boolean TRUE
thread integer 0
timed_os_statistics integer 0
timed_statistics boolean TRUE
trace_enabled boolean TRUE
tracefile_identifier string
transactions integer 271
transactions_per_rollback_segment integer 5
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS1
use_indirect_data_buffers boolean FALSE
user_dump_dest string /u01/app/oracle/diag/rdbms/sma
lldb/smalldb/trace
utl_file_dir string
workarea_size_policy string AUTO
xml_db_events string enable
SQL>
C:\Documents and Settings\Administrator>sqlplus sys/password@smalldb as sysdba
...
SQL> create user hr identified by hr;
User created.
SQL> grant create session to hr;
Grant succeeded.
SQL> exit;
...
C:\Documents and Settings\Administrator>sqlplus hr/hr@smalldb
...
SQL> select sysdate from dual;
SYSDATE
---------
12-NOV-12
[oracle@primary01 ~]$ crsctl status res ora.smalldb.db -p
NAME=ora.smalldb.db
TYPE=ora.database.type
ACL=owner:oracle:rwx,pgrp:oinstall:rwx,other::r--
ACTION_FAILURE_TEMPLATE=
ACTION_SCRIPT=
ACTIVE_PLACEMENT=1
AGENT_FILENAME=%CRS_HOME%/bin/oraagent%CRS_EXE_SUFFIX%
AUTO_START=restore
CARDINALITY=1
CHECK_INTERVAL=1
CHECK_TIMEOUT=600
CLUSTER_DATABASE=false
DB_UNIQUE_NAME=smalldb
DEFAULT_TEMPLATE=PROPERTY(RESOURCE_CLASS=database) PROPERTY(DB_UNIQUE_NAME= CONCAT(PARSE(%NAME%, ., 2), %USR_ORA_DOMAIN%, .)) ELEMENT(INSTANCE_NAME= %GEN_USR_ORA_INST_NAME%)
DEGREE=1
DESCRIPTION=Oracle Database resource
ENABLED=1
FAILOVER_DELAY=0
FAILURE_INTERVAL=60
FAILURE_THRESHOLD=1
GEN_AUDIT_FILE_DEST=/u01/app/oracle/admin/smalldb/adump
GEN_USR_ORA_INST_NAME=
GEN_USR_ORA_INST_NAME@SERVERNAME(primary01)=smalldb
HOSTING_MEMBERS=
INSTANCE_FAILOVER=0
LOAD=1
LOGGING_LEVEL=1
MANAGEMENT_POLICY=AUTOMATIC
NLS_LANG=
NOT_RESTARTING_TEMPLATE=
OFFLINE_CHECK_INTERVAL=0
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
PLACEMENT=restricted
PROFILE_CHANGE_TEMPLATE=
RESTART_ATTEMPTS=2
ROLE=PRIMARY
SCRIPT_TIMEOUT=60
SERVER_POOLS=ora.smalldb
SPFILE=
START_DEPENDENCIES=weak(type:ora.listener.type,uniform:ora.ons,uniform:ora.eons)
START_TIMEOUT=600
STATE_CHANGE_TEMPLATE=
STOP_DEPENDENCIES=
STOP_TIMEOUT=600
UPTIME_THRESHOLD=1h
USR_ORA_DB_NAME=smalldb
USR_ORA_DOMAIN=
USR_ORA_ENV=
USR_ORA_FLAGS=
USR_ORA_INST_NAME=smalldb
USR_ORA_OPEN_MODE=open
USR_ORA_OPI=false
USR_ORA_STOP_MODE=immediate
VERSION=11.2.0.1.0
[oracle@primary01 ~]$ srvctl status database -d smalldb
Instance smalldb is running on node primary01