René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

create database in Oracle

create database db_name
user sys    identified by password_sys
user system identified by password_system
controlfile reuse
maxdatafiles 22
maxinstances  2
character set          we8iso8859p1
national character set utf8
set default bigfile tablespace
-- database logging clauses
logfile 
      group 1 ('c:\x\y\redo_1a.log', 'd:\x\y\redo_2a.log) size 512K,
      group 2 ('c:\x\y\redo_1b.log', 'd:\x\y\redo_2b.log) size 512K
maxlogfiles 3
maxlogmembers 7
maxloghistory 1000
archivelog
force logging
-- Tablespace Clauses
extent management local
datafile 'c:\foo\bar\system.dbf' size 300M [reuse] autoextend off
sysaux datafile 'c:\foo\bar\sysaux.dbf' size 100M [reuse] autoextend off
default           tablespace ts_data datafile 'c:\foo\bar\data.dbf' size 1M autoextend on next 128K maxsize 2M extent management local
default temporary tablespace ts_temp tempfile 'c:\foo\bar\temp.dbf' size 2M autoextent off                     extent management local
undo tablespace ts_undo datafile 'c:\foo\bar\undo.dbf' size 2M autoextent off 
--
set time_zone = '-01:00';
The database name is specified with the create database statement. After the database is created, the database name and the init parameter db_name must have the same value.
This statement also executes a file whose name is determined by the (hidden) init parameter _init_sql_file.
Among others, maxinstances governs the size of controlfiles.

sql.bsq

Oracle calls the sql.bsq script (located under $ORACLE_HOME/rdbms/admin) when a database is created. This script creates the data dictionary.
Also, the public role is created in this script.

Thanks

Thanks to Eileen Bauer for reporting an error on this page.