Create a Database
This article explains how to create a database in bare metal DB systems. When you launch a bare metal DB system, an initial database is created in that system. After provisioning your system, you can create additional databases at any time by using the Console or the API.
Note:
- This topic applies only to bare metal DB systems. Virtual machine DB systems can only contain a single database, which is created when the DB system is provisioned.
- Database backups on virtual machine DB systems can only be restored to an existing bare metal DB system or a newly-created virtual machine or bare metal DB system.
The database edition will be the edition of the DB system in which the database is created, and each new database is created in a separate database home. You can create an empty database or reproduce a database by using a backup.
Required IAM Policy
To use Oracle Cloud Infrastructure, you must be granted security access in a policy by an administrator. This access is required whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you get a message that you don’t have permission or are unauthorized, verify with your administrator what type of access you have and which compartment to work in.
For administrators: The policy in Let database admins manage Oracle Cloud database systems lets the specified group do everything with databases and related Database resources.
If you're new to policies, see Getting Started with Policies and Common Policies. If you want to dig deeper into writing policies for databases, see Details for the Database Service.
Related Topics
Options for Creating a Container Database from a Backup
When creating a new database using a backup stored in Object Storage as the source, you have the following backup source options:
- Daily automatic backup. Requires that you have automatic backups enabled and an available backup to use. If you are creating a database from an automatic backup, you can choose any level 0 weekly backup, or a level 1 incremental backup created after the most recent level 0 backup.
- On-demand full backup.
- Standalone backup.
- Last archived redo log backup. Requires that you have automatic backups enabled. This backup combines data from the most recent daily automatic backup and data from archived redo logs, and represents the most current backup available. The time of the last archived redo log backup is visible on the database details page in the Last Backup Time field.
-
Point-in-time out of place restore. Specify a timestamp to create a new copy of the database that included data up to a specified point in time. The timestamp must be earlier or equal to the Last Backup Time time displayed on the database details page. Note the following limitations when performing a point-in-time out of place restore:
- The timestamp must be within the recovery window of the database
- The timestamp must be available within the database incarnation of the available automatic backups
- The timestamp cannot fall within two overlapping database incarnations
- The create database operation will fail if the database has undergone structural changes since the specified timestamp. Structural changes include operations such as creating or dropping a tablespace.
- The create database operation cannot be started if another point-in-time database copy operation is in progress.
For information on configuring your DB system to back up to Object Storage, see Back Up a Database Using the Console.
Create a New Database In an Existing DB System
Note:
- The database that you create will be the same edition as the initial database in your bare metal DB system.
- Virtual machine DB systems do not support the creation of additional databases after system provisioning.
- Open the navigation menu. Select Oracle Database, then select Oracle Base Database.
- Choose your Compartment. A list of DB systems is displayed.
- In the list of DB systems, click the DB system in which you want to create the database.
- The details of the DB system is displayed.
- Click Create database.
- In the Create database dialog, enter the following:
- Database name: The name for the database. The database name must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted.
-
Database image: Determines what Oracle Database version is used for the database. You can mix database versions on the DB system, but not editions. By default, the latest Oracle-published database software image is selected.
Click Change database image to use an older Oracle-published image or a custom database software image that you have created in advance, then select an Image Type:
- Oracle Database software images: These images contain generally available versions of Oracle Database software.
- Custom database software images: These images are created by your organization and contain customized configurations of software updates and patches. Use the Select a compartment and Select a database version selectors to limit the list of custom database software images to a specific compartment or Oracle Database software major release version.
Note:
The custom database software image must be based on an Oracle Database release that meets the following criteria:- The release is currently supported by Oracle Cloud Infrastructure
- The release is supported by the hardware model you are using
After choosing a software image, click Select to return to the Create Database dialog.
For more information on database software images, see Oracle Database Software Images.
- PDB name: (Optional) For version 12.1.0.2 and later, you can specify the name of the pluggable database. The PDB name must begin with an alphabetic character, and can contain a maximum of 8 alphanumeric characters. The only special character permitted is the underscore ( _).
-
Create administrator credentials: A database administrator
SYS
user will be created with the password you supply.- Username: SYS
-
Password: Supply the password for this user. The password must meet the following criteria:
A strong password for SYS, SYSTEM, TDE wallet, and PDB Admin. The password must be 9 to 30 characters and contain at least two uppercase, two lowercase, two numeric, and two special characters. The special characters must be _, #, or -. The password must not contain the username (SYS, SYSTEM, and so on) or the word "oracle" either in forward or reversed order and regardless of casing.
- Confirm password: Re-enter the SYS password you specified.
-
Using a TDE wallet password is optional. If you are using customer-managed encryption keys stored in a vault in your tenancy, the TDE wallet password is not applicable to your DB system. Use Show Advance Options at the end of the Create Database dialog to configure customer-managed keys.
If you are using customer-managed keys, or if you want to specify a different TDE wallet password, uncheck the Use the administrator password for the TDE wallet box. If you are using customer-managed keys, leave the TDE password fields blank. To set the TDE wallet password manually, enter a password in the Enter TDE wallet password field, and then confirm by entering it into the Confirm TDE wallet password field.
-
Select workload type: Choose the workload type that best suits your application:
- Transaction Processing configures the database for a transactional workload, with a bias towards high volumes of random data access.
- Data Warehouse configures the database for a decision support or data warehouse workload, with a bias towards large data scanning operations.
-
Configure database backups: Specify the settings for backing up the database to Object Storage:
- Enable automatic backup: Check the check box to enable automatic incremental backups for this database. If you are creating a database in a security zone compartment, you must enable automatic backups. For more information on security zones, see Overview of Security Zones.
- Backup retention period: If you enable automatic backups, you can choose one of the following preset retention periods: 7 days, 15 days, 30 days, 45 days, or 60 days. The default selection is 30 days.
- Backup scheduling: If you enable automatic backups, you can choose a two-hour scheduling window to control when backup operations begin. If you do not specify a window, the six-hour default window of 00:00 to 06:00 (in the time zone of the DB system's region) is used for your database. For more information, see managed backup features in Back Up a Database Using the Console.
- Click Show advanced options to specify advanced options for the initial database.
In the Management tab, you can set the following options:
- Character set: The character set for the database. The default is AL32UTF8.
- National character set: The national character set for the database. The default is AL16UTF16.
In the Tags tab, you can add free-form tags or defined tags to this resource. You must have permissions to use the tag namespace for defined tags. For information about using tags to manage your OCI resources, see Resource Tag.
- Click Create database.
When the database creation is complete, the status changes from Provisioning to Available.
Create a Database From a Backup In an Existing DB System
Note:
Virtual machine DB systems do not support the creation of additional databases after system provisioning. To create a new virtual machine DB system from a backup, see Create a DB System from a Backup Using the Console.You can create a new database from a database backup. For details on backup source options, see Options for Creating a Container Database from a Backup.
Before you begin, note the following:
- When you create a database from a backup, you can choose a different DB system and compartment. However, the availability domain will be the same as where the source database is hosted.
Tip:
You can use the GetBackup API to obtain information about the availability domain of the backup. - The DB system you specify must support the same type as the system from which the backup was taken. For example, if the backup is from a single-node database, then the target DB system must be a single-node shape.
- The version of the target DB system must be the same or higher than the version of the backup.
- If the backup being used to create a database is in a security zone compartment, the database cannot be created in a compartment that is not in a security zone. For a full list of policies that affect Database service resources, see Security Zone Policies.
Procedure
- Open the navigation menu. Click Oracle Database, then click Oracle Base Database.
- Choose your Compartment. A list of DB systems is displayed.
- Navigate to the backup or standalone backup you want to use to create the new DB system:
Tip:
If you are creating a database from an automatic backup, you may choose any level 0 weekly backup, or a level 1 incremental backup created after the most recent level 0 backup. For more information on automatic backups, see Back Up a Database Using the Console.- To select a daily automatic backup or on-demand full backup as the source
- Find the DB system where the database is located, and click the system name to display details about it.
- From the Databases list, click the source database name.
- Find your desired backup in the Backups list. If you don't see the backups list on the database details page, click Backups in the Resources menu.
- Click the Actions menu for the backup, and then click Create database.
- In the Create database from backup dialog, select Use an existing DB system.
- Click Create.
- To select the last archived redo log automatic backup as the source
- Find the DB system where the database is located, and click the system name to display details about it.
- Find the database associated with the backup you wish to use, and click its name to display details about it.
- On the database details page, click Create database from backup.
- In the Create database from backup dialog, select the following:
- Create database from last backup
- Use an existing DB system
- Click Create.
- To specify a timestamp for a point-in-time copy of the source
- Find the DB system where the database is located, and click the system name to display details about it.
- Find the database associated with the backup you wish to use, and click its name to display details about it.
- On the database details page, click Create database from backup.
- In the Create Database from Backup dialog, do the following:
- Select Create database from specified timestamp.
- In the Restore timestamp field, enter a timestamp. The restore timestamp determines the most recent data that will be included in the restored version of the database.
- Select Use an existing DB system.
- Click Create.
- To select a standalone backup as the source
- Open the navigation menu. Click Oracle Database, then click Standalone backups under Resources.
- In the list of standalone backups, find the backup you want to use to create the database.
- Click the Actions menu for the backup you are interested in, and then click Create Database.
- In the Create database from backup dialog, select Use an existing DB system.
- Click Create.
- To select a daily automatic backup or on-demand full backup as the source
- In the Create database from backup dialog, enter the following:
- Select a shape: Select the shape of the target DB system where the new database being created from the selected backup will be located.
- Select a DB system: Select the target DB system where the new database being created from the selected backup will be located. Click Change compartment if the target DB system is in a different compartment from the one you are currently working in.
- Click Next to advance to the Database information screen. Provide the following information for the initial database:
- Database name: The name for the database. The database name must begin with an alphabetic character and can contain a maximum of eight alphanumeric characters. Special characters are not permitted.
- Database unique name suffix: Optional. The second portion of the database unique name. The complete database unique name is created by appending the database unique name suffix to the database name you specify.
- Database unique name: This read-only field displays the complete database unique name (
DB_UNIQUE_NAME
). The database unique name is a globally unique name for the database. Primary and standby databases in a Data Guard association can share the same database name, but must have different database unique names. - Password: Specify a strong password to be used for the SYS and SYSTEM users, the TDE wallet (if applicable), and the PDB Admin user. The password must be 9 to 30 characters and contain at least two uppercase, two lowercase, two numeric, and two special characters. The special characters must be _, #, or -. The password must not contain the username (SYS, SYSTEM, and so on) or the word "oracle" either in forward or reversed order and regardless of casing.
- Confirm password: Re-enter the database admin password you specified.
- Enter the source database's TDE wallet or RMAN password:
If your database uses Oracle-managed encryption keys, enter either the TDE wallet password or the RMAN encryption password for the backup, whichever is applicable.
- Click Create database.
Use the API
For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.
Use these API operations to create databases on bare metal DB systems.
Database homes:
- ListDbHomes
- GetDbHome
- CreateDbHome
- DeleteDbHome
Databases:
- CreateDatabase
For the complete list of APIs for the Database service, see Database Service API.
Create a Database
Copyright © 2022, 2023, Oracle and/or its affiliates.
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.
Access to Oracle Support
Oracle customers that have purchased support have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.