How to Create a 9i Database by DBCA with Silent Mode

  • by
In my experience, to create a new database by DBCA with silent mode in a 9i database on Linux, you must issue the dbca command under a x-window environment, otherwise, you will get “java.lang.NoClassDefFoundError”, even you set CLASSPATH correct. I think it maybe a bug on Linux platform.

But the most ironic thing is, if you can access a database server under x-window, why don’t you use dbca with the graphic interface instead of the silent mode. In fact, you can set more details on the database by the graphic interface than the silent mode. Nevertheless, I would like to test the silent mode which might have more facts can be discovered.
  1. First, let’s see all available attributes that dbca allows.
  2. [oracle@oracle9i ~]$ dbca -help
    dbca  [-silent | -progressOnly | -customCreate] {<command> <options> }  | { [<co mmand> [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>
                    [-sid <database system identifier>]
                    [-datafileDestination <destination for all the datafiles>]
                    [-datafileJarLocation  <location of the data file jar, used only  for clone database creation>]
                    [-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 > ]
                    [-listeners  <list of listeners to configure the database with>]
                    [-variablesFile   <file name for the variable-value pair for var iables in the template>]]


    Create a template from an existing database by specifying the following paramete rs:
            -createTemplateFromDB
                    -sourceDB    <service in the form of <host>:<port>:<sid>>
                    -sysDBAUserName     <user name  with SYSDBA privileges>
                    -sysDBAPassword     <password for sysDBAUserName user name>
                    -templateName      <new template name>
                    [-maintainFileLocations <true | false>]


    Create a clone template from an existing database by specifying the following pa rameters:
            -createCloneTemplate
                    -sourceDB    <source database sid>
                    -sysDBAUserName     <user name  with SYSDBA privileges>
                    -sysDBAPassword     <password for sysDBAUserName user name>
                    -templateName      <new template name>
                    [-maintainFileLocations <true | false>]
                    [-datafileJarLocation       <directory to place the datafiles in  a compressed format>]
    Query for help by specifying the following options: -h | -help

  3. Issue dbca command with silent mode.
  4. [oracle@oracle9i ~]$ dbca -silent -createDatabase -templateName Transaction_Processing.dbc -gdbname smalldb -sid smalldb -datafileJarLocation /u01/app/oracle/product/9.2.0/assistants/dbca/templates -datafileDestination /u01/app/oracle/oradata -responseFile NO_VALUE -characterSet AL32UTF8 -listeners  listener


    Look at the log file "/u01/app/oracle/admin/smalldb/create/smalldb.log" for further details.
    [oracle@oracle9i ~]$ cat /u01/app/oracle/admin/smalldb/create/smalldb.log
    Database creation completed.  See logfiles at /u01/app/oracle/admin/smalldb/create for details.

    Database Information:

      global database name:  smalldb
      database system identifier (SID):  smalldb
      SYS account password:  change_on_install
      SYSTEM account password:  manager.
    Note: All other database accounts have been locked. Oracle highly RECOMMENDS to change the default passwords of all the users.

  5. Start the listener after installation.
  6. [oracle@oracle9i ~]$ cat /u01/app/oracle/product/9.2.0/network/admin/listener.ora
    ...
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
          )
          (ADDRESS_LIST =
            (ADDRESS = (PROTOCOL = TCP)(HOST = oracle9i.example.com)(PORT = 1521))
          )
        )
      )

    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = /u01/app/oracle/product/9.2.0)
          (PROGRAM = extproc)
        )
        (SID_DESC =
          (GLOBAL_DBNAME = ORACLE9I)
          (ORACLE_HOME = /u01/app/oracle/product/9.2.0)
          (SID_NAME = ORACLE9I)
        )
        (SID_DESC =
          (GLOBAL_DBNAME = smalldb)
          (ORACLE_HOME = /u01/app/oracle/product/9.2.0)
          (SID_NAME = smalldb)
        )
      )

    [oracle@oracle9i ~]$ lsnrctl status
    ...
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
    TNS-12541: TNS:no listener
     TNS-12560: TNS:protocol adapter error
      TNS-00511: No listener
       Linux Error: 111: Connection refused
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle9i.example.com)(PORT=1521)))
    TNS-12541: TNS:no listener
     TNS-12560: TNS:protocol adapter error
      TNS-00511: No listener
       Linux Error: 111: Connection refused
    [oracle@oracle9i ~]$ lsnrctl start
    ...
    Starting /u01/app/oracle/product/9.2.0/bin/tnslsnr: please wait...

    TNSLSNR for Linux: Version 9.2.0.8.0 - Production
    System parameter file is /u01/app/oracle/product/9.2.0/network/admin/listener.ora
    Log messages written to /u01/app/oracle/product/9.2.0/network/log/listener.log
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle9i.example.com)(PORT=1521)))

    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 9.2.0.8.0 - Production
    Start Date                16-NOV-2012 19:13:24
    Uptime                    0 days 0 hr. 0 min. 0 sec
    Trace Level               off
    Security                  OFF
    SNMP                      OFF
    Listener Parameter File   /u01/app/oracle/product/9.2.0/network/admin/listener.ora
    Listener Log File         /u01/app/oracle/product/9.2.0/network/log/listener.log
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle9i.example.com)(PORT=1521)))
    Services Summary...
    Service "ORACLE9I" has 1 instance(s).
      Instance "ORACLE9I", status UNKNOWN, has 1 handler(s) for this service...
    Service "PLSExtProc" has 1 instance(s).
      Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "smalldb" has 1 instance(s).
      Instance "smalldb", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully

    You can notice that the listener is not started after creation. So I must start it up by myself.
  7. Check database status and change password.
  8. [oracle@oracle9i ~]$ sqlplus /nolog
    ...
    SQL> conn / as sysdba
    Connected.
    SQL> select open_mode from v$database;

    OPEN_MODE
    ----------
    READ WRITE

    It’ weird, dbca did startup the database, but did not start the listener in the first place.
  9. Change sys and system password.
  10. Since the default password of sys and system created by dbca are obviously well known in 9i world, so we must change them after database creation.
    SQL> alter user sys identified by sys_password;

    User altered.

    SQL> alter user system identified by system_password;

    User altered.

  11. Check more details about the newly created database.
  12. SQL> set pagesize 500;
    SQL> show parameters;

    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ---------------------------
    O7_DICTIONARY_ACCESSIBILITY          boolean     FALSE
    active_instance_count                integer
    aq_tm_processes                      integer     1
    archive_lag_target                   integer     0
    audit_file_dest                      string      ?/rdbms/audit
    audit_sys_operations                 boolean     FALSE
    audit_trail                          string      NONE
    background_core_dump                 string      partial
    background_dump_dest                 string      /u01/app/oracle/admin/smalldb/
                                                     bdump
    backup_tape_io_slaves                boolean     FALSE
    bitmap_merge_area_size               integer     1048576
    blank_trimming                       boolean     FALSE
    buffer_pool_keep                     string
    buffer_pool_recycle                  string
    circuits                             integer     170
    cluster_database                     boolean     FALSE
    cluster_database_instances           integer     1
    cluster_interconnects                string
    commit_point_strength                integer     1
    compatible                           string      9.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/oradata/smalldb/control02.c
                                                     tl, /u01/app/oracle/oradata/sm
                                                     alldb/control03.ctl
    core_dump_dest                       string      /u01/app/oracle/admin/smalldb/
                                                     cdump
    cpu_count                            integer     4
    create_bitmap_area_size              integer     8388608
    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                    boolean     TRUE
    db_block_size                        integer     4096
    db_cache_advice                      string      ON
    db_cache_size                        big integer 33554432
    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     8
    db_file_name_convert                 string
    db_files                             integer     200
    db_keep_cache_size                   big integer 0
    db_name                              string      smalldb
    db_recycle_cache_size                big integer 0
    db_writer_processes                  integer     1
    dblink_encrypt_login                 boolean     FALSE
    dbwr_io_slaves                       integer     0
    dg_broker_config_file1               string      ?/dbs/dr1@.dat
    dg_broker_config_file2               string      ?/dbs/dr2@.dat
    dg_broker_start                      boolean     FALSE
    disk_asynch_io                       boolean     TRUE
    dispatchers                          string      (PROTOCOL=TCP) (SERVICE=smalld
                                                     bXDB)
    distributed_lock_timeout             integer     60
    dml_locks                            integer     748
    drs_start                            boolean     FALSE
    enqueue_resources                    integer     968
    event                                string
    fal_client                           string
    fal_server                           string
    fast_start_io_target                 integer     0
    fast_start_mttr_target               integer     300
    fast_start_parallel_rollback         string      LOW
    file_mapping                         boolean     FALSE
    filesystemio_options                 string      none
    fixed_date                           string
    gc_files_to_locks                    string
    global_context_pool_size             string
    global_names                         boolean     FALSE
    hash_area_size                       integer     1048576
    hash_join_enabled                    boolean     FALSE
    hi_shared_memory_address             integer     0
    hs_autoregister                      boolean     TRUE
    ifile                                file
    instance_groups                      string
    instance_name                        string      smalldb
    instance_number                      integer     0
    java_max_sessionspace_size           integer     0
    java_pool_size                       big integer 83886080
    java_soft_sessionspace_limit         integer     0
    job_queue_processes                  integer     10
    large_pool_size                      big integer 16777216
    license_max_sessions                 integer     0
    license_max_users                    integer     0
    license_sessions_warning             integer     0
    local_listener                       string
    lock_name_space                      string
    lock_sga                             boolean     FALSE
    log_archive_dest                     string
    log_archive_dest_1                   string
    log_archive_dest_10                  string
    log_archive_dest_2                   string
    log_archive_dest_3                   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_2             string      enable
    log_archive_dest_state_3             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.dbf
    log_archive_max_processes            integer     2
    log_archive_min_succeed_dest         integer     1
    log_archive_start                    boolean     FALSE
    log_archive_trace                    integer     0
    log_buffer                           integer     524288
    log_checkpoint_interval              integer     0
    log_checkpoint_timeout               integer     1800
    log_checkpoints_to_alert             boolean     FALSE
    log_file_name_convert                string
    log_parallelism                      integer     1
    logmnr_max_persistent_sessions       integer     1
    max_commit_propagation_delay         integer     700
    max_dispatchers                      integer     5
    max_dump_file_size                   string      UNLIMITED
    max_enabled_roles                    integer     30
    max_rollback_segments                integer     37
    max_shared_servers                   integer     20
    mts_circuits                         integer     170
    mts_dispatchers                      string      (PROTOCOL=TCP) (SERVICE=smalld
                                                     bXDB)
    mts_listener_address                 string
    mts_max_dispatchers                  integer     5
    mts_max_servers                      integer     20
    mts_multiple_listeners               boolean     FALSE
    mts_servers                          integer     1
    mts_service                          string      smalldb
    mts_sessions                         integer     165
    nls_calendar                         string
    nls_comp                             string
    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                  integer     33554432
    open_cursors                         integer     300
    open_links                           integer     4
    open_links_per_instance              integer     4
    optimizer_dynamic_sampling           integer     1
    optimizer_features_enable            string      9.2.0
    optimizer_index_caching              integer     0
    optimizer_index_cost_adj             integer     100
    optimizer_max_permutations           integer     2000
    optimizer_mode                       string      CHOOSE
    oracle_trace_collection_name         string
    oracle_trace_collection_path         string      ?/otrace/admin/cdf
    oracle_trace_collection_size         integer     5242880
    oracle_trace_enable                  boolean     FALSE
    oracle_trace_facility_name           string      oracled
    oracle_trace_facility_path           string      ?/otrace/admin/fdf
    os_authent_prefix                    string      ops$
    os_roles                             boolean     FALSE
    parallel_adaptive_multi_user         boolean     FALSE
    parallel_automatic_tuning            boolean     FALSE
    parallel_execution_message_size      integer     2148
    parallel_instance_group              string
    parallel_max_servers                 integer     5
    parallel_min_percent                 integer     0
    parallel_min_servers                 integer     0
    parallel_server                      boolean     FALSE
    parallel_server_instances            integer     1
    parallel_threads_per_cpu             integer     2
    partition_view_enabled               boolean     FALSE
    pga_aggregate_target                 big integer 16777216
    plsql_compiler_flags                 string      INTERPRETED
    plsql_native_c_compiler              string
    plsql_native_library_dir             string
    plsql_native_library_subdir_count    integer     0
    plsql_native_linker                  string
    plsql_native_make_file_name          string
    plsql_native_make_utility            string
    plsql_v2_compatibility               boolean     FALSE
    pre_page_sga                         boolean     FALSE
    processes                            integer     150
    query_rewrite_enabled                string      FALSE
    query_rewrite_integrity              string      enforced
    rdbms_server_dn                      string
    read_only_open_delayed               boolean     FALSE
    recovery_parallelism                 integer     0
    remote_archive_enable                string      true
    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_plan                string
    rollback_segments                    string
    row_locking                          string      always
    serial_reuse                         string      DISABLE
    serializable                         boolean     FALSE
    service_names                        string      smalldb
    session_cached_cursors               integer     0
    session_max_open_files               integer     10
    sessions                             integer     170
    sga_max_size                         big integer 235999648
    shadow_core_dump                     string      partial
    shared_memory_address                integer     0
    shared_pool_reserved_size            big integer 4194304
    shared_pool_size                     big integer 83886080
    shared_server_sessions               integer     165
    shared_servers                       integer     1
    sort_area_retained_size              integer     0
    sort_area_size                       integer     524288
    spfile                               string      ?/dbs/spfile@.ora
    sql92_security                       boolean     FALSE
    sql_trace                            boolean     FALSE
    sql_version                          string      NATIVE
    standby_archive_dest                 string      ?/dbs/arch
    standby_file_management              string      MANUAL
    star_transformation_enabled          string      FALSE
    statistics_level                     string      TYPICAL
    tape_asynch_io                       boolean     TRUE
    thread                               integer     0
    timed_os_statistics                  integer     0
    timed_statistics                     boolean     TRUE
    trace_enabled                        boolean     TRUE
    tracefile_identifier                 string
    transaction_auditing                 boolean     TRUE
    transactions                         integer     187
    transactions_per_rollback_segment    integer     5
    undo_management                      string      AUTO
    undo_retention                       integer     900
    undo_suppress_errors                 boolean     FALSE
    undo_tablespace                      string      UNDOTBS1
    use_indirect_data_buffers            boolean     FALSE
    user_dump_dest                       string      /u01/app/oracle/admin/smalldb/
                                                     udump
    utl_file_dir                         string
    workarea_size_policy                 string      AUTO

  13. Add an entry of local naming in a client machine.
  14. ...
    smalldb =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = oracle9i.example.com)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = smalldb)
        )
      )

  15. Test the tnsname.
  16. C:\Documents and Settings\Administrator>tnsping smalldb
    ...
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle9i.example.com)(PORT = 1521)) (CONNECT_DATA = (SERV
    ER = DEDICATED) (SERVICE_NAME = smalldb)))
    OK (20 msec)

  17. Test the connection.
  18. C:\Documents and Settings\Administrator>sqlplus system/system_password@smalldb
    ..

    SQL> select sysdate from dual;

    SYSDATE
    ---------
    16-NOV-12
I have ever tried to create a database by DBCA with a response file many times, but all failed and left the same errors:
[oracle@oracle9i oradata]$ cd /u01/app/oracle/product/9.2.0/assistants/dbca/logs/
[oracle@oracle9i logs]$ cat silent5.log
No command specified to perform. Please specify one of following commands:
createDatabase, createTemplateFromDB or createCloneTemplate

Leave a Reply

Your email address will not be published. Required fields are marked *