top of page
CerebroSQL

Oracle:

CREATE DATABASE

CREATE DATABASE [ database ]
{ USER SYS IDENTIFIED BY password
| USER SYSTEM IDENTIFIED BY password
| CONTROLFILE REUSE
| MAXDATAFILES integer
| MAXINSTANCES integer
| CHARACTER SET charset
| NATIONAL CHARACTER SET charset
| SET DEFAULT
{ BIGFILE | SMALLFILE } TABLESPACE
| database_logging_clauses
| tablespace_clauses
| set_time_zone_clause
}... ;

database_logging_clauses::=
{ LOGFILE
[ GROUP integer ] file_specification
[, [ GROUP integer ] file_specification ]...
| MAXLOGFILES integer
| MAXLOGMEMBERS integer
| MAXLOGHISTORY integer
| { ARCHIVELOG | NOARCHIVELOG }
| FORCE LOGGING
}
tablespace_clauses::=
{ EXTENT MANAGEMENT LOCAL
| DATAFILE file_specification [, file_specification ]...
| SYSAUX DATAFILE file_specification [, file_specification ]...
| default_tablespace
| default_temp_tablespace
| undo_tablespace
}
default_tablespace ::=
DEFAULT TABLESPACE tablespace
[ DATAFILE datafile_tempfile_spec ]
[ extent_management_clause ]
default_temp_tablespace ::=
[ BIGFILE | SMALLFILE ]
DEFAULT TEMPORARY TABLESPACE tablespace
[ TEMPFILE file_specification [, file_specification ]...]
[ extent_management_clause ]
extent_management_clause::=
EXTENT MANAGEMENT LOCAL
[ AUTOALLOCATE
| UNIFORM [ SIZE size_clause ]
]
undo_tablespace ::=
[ BIGFILE | SMALLFILE ]
UNDO TABLESPACE tablespace
[ TABLESPACE file_specification [, file_specification ]...]
set_time_zone_clause ::=
SET TIME_ZONE =
'{ { + | - } hh : mi | time_zone_region }'

Example

CREATE DATABASE sample
CONTROLFILE REUSE
LOGFILE
GROUP 1 ('diskx:log1.log', 'disky:log1.log') SIZE 50K,
GROUP 2 ('diskx:log2.log', 'disky:log2.log') SIZE 50K
MAXLOGFILES 5
MAXLOGHISTORY 100
MAXDATAFILES 10
MAXINSTANCES 2
ARCHIVELOG
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL16UTF16
DATAFILE
'disk1:df1.dbf' AUTOEXTEND ON,
'disk2:df2.dbf' AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE temp_ts
UNDO TABLESPACE undo_ts
SET TIME_ZONE = '+02:00';

bottom of page