Loading...

We've detected that your browser language is Chinese. Would you like to visit our Chinese website? [ Dismiss ]
By: Emma

Creating a new Oracle database is very different from creating a database in MySQL or PostgreSQL. In Oracle, the database includes the physical storage structure, background processes, control files, redo logs, system tablespaces, and internal metadata that power the entire instance.

That is why Oracle database creation involves more planning and configuration than a simple CREATE DATABASE command in other platforms.

What Oracle CREATE DATABASE Actually Does

Before diving in: if you only need to create tables in an existing Oracle instance, you don’t need this command. In Oracle, a schema is tied to a user. Running CREATE USER gives you a named workspace equivalent to what MySQL calls a database. The steps below are for DBAs provisioning a brand-new Oracle instance from scratch.

The CREATE DATABASE statement initializes the physical file structure on disk: datafiles, control files, and redo log files. It also builds the data dictionary, the internal catalog Oracle uses to track every user, object, and piece of metadata in the system.

CREATE DATABASE is a one-time operation per instance. Once executed, the database exists permanently on disk. Re-running it on the same instance requires deleting all existing files and rebuilding from scratch.

what oracle create database does

To create an Oracle database, you need to plan the storage layout, instance parameters, and architecture before anything runs, and include additional configuration steps after creation is complete. The following are four ways to approach it, from manual scripts to fully managed cloud services.

4 Methods to Create Database in Oracle

The method you choose depends on your environment and how much control you need. Before running any of them, make sure you have completed the following planning steps.

Before You Start: Pre-Creation Planning

Some of these decisions cannot be changed after creation, so plan before you run any commands.

  • Oracle SID: A unique identifier for the instance. Keep it short and uppercase, for example PROD or TESTDB.
  • Storage layout: Place redo log files on separate disks from datafiles to avoid I/O bottlenecks.
  • Character set: Use AL32UTF8 unless you have a specific reason not to. It cannot be changed after creation.
  • Storage sizing: Estimate one to two years of data growth. Enable AUTOEXTEND but start with a realistic initial size.
  • init.ora file: Copy the sample from $ORACLE_HOME/dbs, rename it to init<SID>.ora, and configure it before starting the instance.

Method 1: Manual CREATE DATABASE (Step-by-Step)

The manual method gives you full control over every aspect of the database structure. It is rarely used for standard production setups today, but understanding it helps you know exactly what tools like DBCA are doing under the hood.

Step 1: Set ORACLE_SID and prepare directories

Set the ORACLE_SID environment variable to identify your instance, then create the necessary directories on your server.

export ORACLE_SID=testdb
mkdir -p $ORACLE_BASE/admin/testdb/adump
mkdir -p $ORACLE_BASE/oradata/testdb

 

oracle create database manually create

Step 2: Create and edit the parameter file (init<SID>.ora)

The initialization file defines how the instance behaves. Configure these key parameters before starting:

  • CONTROL_FILES: Lists the locations where Oracle creates control files.
  • DB_BLOCK_SIZE: Sets the standard block size, typically 8192. This cannot be changed after creation.
  • UNDO_MANAGEMENT: Set to AUTO to let Oracle manage undo data automatically.
  • DB_NAME: Match the database name used in your CREATE DATABASE statement exactly.

Step 3: Start the instance in NOMOUNT mode

In NOMOUNT mode, Oracle reads the parameter file and initializes memory structures but does not look for an existing database on disk. This is the required state before running CREATE DATABASE.

sqlplus / as sysdba
STARTUP NOMOUNT;

oracle create database manually create step 3

Step 4: Execute the CREATE DATABASE statement

Before running the statement, check your Oracle version. Starting with Oracle 21c, the parameter ENABLE_PLUGGABLE_DATABASE defaults to TRUE, and setting it to FALSE will cause CREATE DATABASE to fail.

If you are on 19c or later, Oracle recommends creating a CDB by including the ENABLE PLUGGABLE DATABASE clause in your statement. Once the CDB exists, you can add pluggable databases to it using CREATE PLUGGABLE DATABASE.

The following statement builds the physical file structure for an Oracle 19c database.

CREATE DATABASE testdb
   USER SYS IDENTIFIED BY sys_password
   USER SYSTEM IDENTIFIED BY system_password
   -- Define the redo log groups for transaction history
   LOGFILE GROUP 1 ('/u01/oradata/testdb/redo01.log') SIZE 50M BLOCKSIZE 512,
           GROUP 2 ('/u01/oradata/testdb/redo02.log') SIZE 50M BLOCKSIZE 512,
           GROUP 3 ('/u01/oradata/testdb/redo03.log') SIZE 50M BLOCKSIZE 512
   MAXLOGFILES 5
   MAXLOGMEMBERS 5
   MAXDATAFILES 100
   -- Set the permanent character sets
   CHARACTER SET AL32UTF8
   NATIONAL CHARACTER SET AL16UTF16
   EXTENT MANAGEMENT LOCAL
   -- Define mandatory system tablespaces
   DATAFILE '/u01/oradata/testdb/system01.dbf' SIZE 325M REUSE
   SYSAUX DATAFILE '/u01/oradata/testdb/sysaux01.dbf' SIZE 325M REUSE
   DEFAULT TABLESPACE users
      DATAFILE '/u01/oradata/testdb/users01.dbf'
      SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
   DEFAULT TEMPORARY TABLESPACE temp
      TEMPFILE '/u01/oradata/testdb/temp01.dbf'
      SIZE 20M REUSE
   UNDO TABLESPACE undotbs1
      DATAFILE '/u01/oradata/testdb/undotbs01.dbf'
      SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

 

oracle create database manually create builds physicla file structure for an oracle 19c database

Step 5: Run post-creation scripts

After the statement completes, the database files exist on disk but the data dictionary views and built-in packages are not yet available. Run these two scripts as SYSDBA:

  • catalog.sql: Creates the data dictionary views, such as USER_TABLES and DBA_OBJECTS.
  • catproc.sql: Creates the built-in PL/SQL packages, such as DBMS_OUTPUT and DBMS_STATS.
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql

 

Note: Both scripts can take several minutes to complete. Do not interrupt them

Step 6: Back up the database immediately

Take a full backup using Oracle Recovery Manager (RMAN) before loading any application data. This establishes a clean baseline recovery point.

Method 2: Using DBCA (Oracle’s Recommended Way)

The Oracle Database Configuration Assistant (DBCA) is Oracle’s official recommended tool for creating databases. It automates parameter file creation, directory setup, and post-creation scripts, producing a fully configured database when it completes. DBCA can be launched as a graphical wizard or run in silent mode from the command line.

  1. Launch DBCA: Run dbca from the command line with your Oracle environment variables set. On systems with a display, this opens the graphical wizard.
  2. Select Advanced Configuration: The typical configuration uses pre-built templates that include all optional components by default. Advanced Configuration lets you exclude unnecessary components, which reduces complexity during future upgrades and patching.
  3. Choose storage and character set: Select between a standard file system or ASM (Automatic Storage Management). Always set the character set to AL32UTF8.

For automated or scripted environments, use silent mode:

dbca -silent -createDatabase \
   -templateName General_Purpose.dbc \
   -gdbName testdb \
   -sid testdb \
   -characterSet AL32UTF8 \
   -sysPassword sys_password \
   -systemPassword system_password \
   -datafileDestination /u01/oradata \
   -storageType FS

 

oracle create database manually create silent mode
Tip: Silent mode is well-suited for DevOps pipelines and infrastructure-as-code workflows where databases need to be provisioned consistently across multiple environments.

Method 3: Clone from an Existing DB via DBCA Template

This method is useful when you need a staging or development environment that matches your production database’s structure and configuration.

  1. Create a template: Launch DBCA and select Manage Templates, then Create a database template from an existing database. Choose whether to include structure only or data as well.
  2. Deploy the template: DBCA generates a set of template files, including a .dbc and a .dbt file. Copy both files to the target server. Launch DBCA on the destination, select Create a Database, and choose your custom template.
  3. Adjust instance-specific settings: Update the SID, file paths, and passwords to match the new environment. All other configurations are inherited from the source.
Note: Template-based creation does not replace a full backup. Always take an RMAN backup of the new database before loading data.

Method 4: Oracle Cloud (DB Systems / Autonomous Database)

In Oracle Cloud Infrastructure (OCI), you do not need to run creation scripts manually. Both options below provision the database through the OCI console.

DB Systems give you a virtual machine or bare metal server with Oracle software pre-installed. Navigate to Oracle Database → DB Systems → Create DB System, select your shape, storage, and Oracle Database version, and configure your network settings. You retain full DBA access to both the operating system and the database.

Autonomous Database is fully managed. Oracle handles patching, tuning, and backups automatically. Navigate to Oracle Database → Autonomous Database → Create Autonomous Database, choose a workload type such as Transaction Processing, and set your admin credentials. The database is ready within minutes.

With Autonomous Database, you do not have access to the OS layer or DBCA. You connect directly as the ADMIN user and begin creating your application objects immediately.

Common Errors When Creating Oracle Database and Fixes

Creating an Oracle database has many steps, and a single typo in a parameter file or a missing directory can stop the process entirely. Here are the most frequent errors and how to resolve them.

ORA-01501: CREATE DATABASE failed

This is a generic error that is always accompanied by a second, more specific error code. Check the alert log to find the root cause.

$ORACLE_BASE/diag/rdbms///trace/alert_.log

ORA-01504: database name does not match DB_NAME parameter

The name in your CREATE DATABASE statement does not match the DB_NAME value in your init.ora file. Make both names identical, or omit the name from the SQL statement to inherit the value from the parameter file.

ORA-01506: missing or illegal database name

No database name was provided in the SQL statement, and DB_NAME is not set in the initialization file. Add DB_NAME=yourname to your init.ora file.

ORA-01507: database not mounted

A command was issued before the instance reached the required state. Use NOMOUNT for a fresh creation or MOUNT for maintenance tasks.

Character set mistake

Choosing a restricted character set such as WE8ISO8859P1 means your database may be unable to store multi-language data or special characters later. This cannot be changed without rebuilding the entire database. Always use AL32UTF8.

Forgetting post-creation scripts

If CREATE DATABASE completes but queries against USER_TABLES or DBA_OBJECTS return errors, you have not yet run the post-creation scripts. Run catalog.sql and catproc.sql as SYSDBA to create the data dictionary views and built-in PL/SQL packages.

Missing or incorrect ORACLE_SID

If you see a “Protocol Adapter Error” or “ORA-12560” when connecting, the ORACLE_SID environment variable is not set correctly. Set it before launching SQL*Plus:

# Linux
export ORACLE_SID=

# Windows
set ORACLE_SID=

Checklist After Creating Oracle Database

Complete these steps before the database goes into production.

  1. Run catalog.sql and catproc.sql as SYSDBA if you created the database manually. DBCA handles this automatically.
  2. Create the password file using the orapwd utility to allow remote SYSDBA connections.
  3. Configure listener.ora and tnsnames.ora so applications can connect to the database over the network.
  4. Add the SID to /etc/oratab on Linux to register the database with Oracle’s startup and shutdown scripts.
  5. Configure the Fast Recovery Area (FRA) to give RMAN a dedicated location for backups and archived logs.
  6. Take a full RMAN backup immediately to establish a clean baseline recovery point.
  7. Set up OS-level services or dbstart/dbshut scripts to start and stop the database automatically when the server restarts.

How to Protect Your Newly Created Oracle Database with i2Backup

The first thing to do after creating a database is to establish a backup strategy. Oracle’s native Recovery Manager (RMAN) is a solid tool, but it requires scripting knowledge, manual scheduling, and offers no centralized management interface across multiple databases or servers. For teams managing several Oracle instances, this operational overhead adds up quickly.

i2Backup is an enterprise backup solution that supports Oracle database protection with a centralized, web-based console. It reduces the operational complexity of database backup without replacing the protection RMAN provides.

Key Features of i2Backup:

  • Real-time and scheduled database backup: i2Backup supports continuous capture of redo logs and archive logs for near-zero RPO, as well as flexible scheduling, such as hourly, daily, or weekly backups, to fit your operational requirements.
  • Standalone and cluster support: Whether your Oracle instance runs as a standalone database or in a cluster environment including HA, ADG, or RAC, i2Backup handles both without additional configuration.
  • Point-in-time recovery: Using continuous backup logs and multiple restore points, you can recover to any specific point in time, which is critical for recovering from accidental data changes or corruption.
  • Multiple backup destinations: Backups can be sent to local storage, NAS, tape libraries, or cloud object storage simultaneously, helping you implement a 3-2-1 backup strategy and avoid a single point of failure.
  • Encrypted transmission: Data is protected during transfer using AES and SM4 encryption standards, and backups are stored in WORM-compliant storage to prevent unauthorized modification or deletion.

For teams looking beyond backup, Info2Soft also offers i2Availability, a solution for high availability and disaster recovery, and i2Stream, a database replication tool that supports Oracle and over 40 other database environments. Together, these tools cover the full spectrum of data protection from backup to continuous availability.

FREE Trial for 60-Day

Conclusion

Creating an Oracle database is not a single command. It requires planning your storage layout, character set, and instance parameters before anything runs, and post-creation steps like running catalog.sql and catproc.sql before the database is fully usable.

The right method depends on your situation. Manual CREATE DATABASE gives you full control and is useful for understanding how Oracle initializes an instance. DBCA is Oracle’s recommended approach for most production deployments and handles the heavy lifting automatically. Template-based cloning works well when you need to replicate a known configuration across environments. Oracle Cloud removes infrastructure management entirely for teams that do not need OS-level access.

Whichever method you use, take a backup with solutions like Info2soft’s i2Backup before loading any application data. A clean baseline recovery point is the simplest safeguard against configuration mistakes and early data loss.

Emma
Emma is the bridge between complex engineering and the people who need it. As a content creator at Info2Soft, she spends her days translating "tech-speak" into clear, actionable stories about data resilience. She’s not just documenting software; she's uncovering how data replication and recovery actually change the way businesses run.

More Related Articles

Table of Contents:
Stay Updated on Latest Tips
Subscribe to our newsletter for the latest insights, news, exclusive content. You can unsubscribe at any time.
Subscribe
Ready to Enhance Business Data Security?
Start a 60-day free trial or view demo to see how Info2soft protects enterprise data.
{{ country.name }}
Please fill out the form and submit it, our customer service representative will contact you soon.
By submitting this form, I confirm that I have read and agree to the Privacy Notice.
{{ isSubmitting ? 'Submitting...' : 'Submit' }}