Creating Databases

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.

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. 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.

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. For more information on automatic backups, see Oracle Cloud Infrastructure Managed Backup Features.
  • On-demand full backup. See To create an on-demand full backup of a database for information on creating an on-demand backup.
  • Standalone backup. For more information, see Standalone Backups.
  • 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 Backing Up a Container Database to Oracle Cloud Infrastructure Object Storage.

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.

Using the Console

To 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.
  1. Open the navigation menu. Click Oracle Database, then click Bare Metal, VM, and Exadata.
  2. Choose your Compartment.

    A list of DB systems is displayed.

  3. In the list of DB systems, find the DB system in which you want to create the database, and then click its name to display details about it.
  4. Click Create Database.

  5. 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 Provided 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.

        Important

        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.

    • 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:

      • Online Transactional Processing (OLTP) configures the database for a transactional workload, with a bias towards high volumes of random data access.
      • Decision Support System (DSS) 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.
      • 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. See Backup Scheduling for more information.
  6. 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 Encryption tab, configure the encryption key management option for your database. By default, the database is configured using Oracle-managed encryption keys. To configure the database with encryption based on encryption keys you manage:

    1. Select Use customer-managed keys. You must have a valid encryption key in Oracle Cloud Infrastructure Vault service. See Let security admins manage vaults, keys, and secrets.
      Note

      You must use AES-256 encryption keys for your database.
    2. Choose a Vault.
    3. Select a Master encryption key.
    4. To specify a key version other than the latest version of the selected key, check Choose the key version and enter the OCID of the key you want to use in the Key version OCID field.

    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. See Resource Tags for information about using tags to manage your OCI resources.

  7. Click Create Database.

When the database creation is complete, the status changes from Provisioning to Available.

To create a database in an existing DB system using a backup
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 To create a DB system from a backup

You can create a new database from a database backup. See Options for Creating a Container Database from a Backup for details on backup source options.

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. See the Security Zone Policies topic for a full list of policies that affect Database service resources.
  1. Open the navigation menu. Click Oracle Database, then click Bare Metal, VM, and Exadata.
  2. Choose your Compartment.

    A list of DB systems is displayed.

  3. 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 Oracle Cloud Infrastructure Managed Backup Features.
    To select a daily automatic backup or on-demand full backup as the source
    1. Find the DB system where the database is located, and click the system name to display details about it.
    2. From the Databases list, click the source database name.
    3. 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.
    4. Click the Actions menu for the backup, and then click Create Database.
    5. In the Create Database from Backup dialog, select Use an existing DB system.
    6. Click Create.
    To select the last archived redo log automatic backup as the source
    1. Find the DB system where the database is located, and click the system name to display details about it.
    2. Find the database associated with the backup you wish to use, and click its name to display details about it.
    3. On the database details page, click Create Database from Backup.
    4. In the Create Database from Backup dialog, select the following:

      • Create database from last backup
      • Use an existing DB system
    5. Click Create.
    To specify a timestamp for a point-in-time copy of the source
    1. Find the DB system where the database is located, and click the system name to display details about it.
    2. Find the database associated with the backup you wish to use, and click its name to display details about it.
    3. On the database details page, click Create Database from Backup.
    4. In the Create Database from Backup dialog, do the following:

      1. Select Create database from specified timestamp.
      2. 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.
      3. Select Use an existing DB system.
      4. Click Create.
    To select a standalone backup as the source
    1. Click Standalone Backups under Bare Metal, VM, and Exadata.
    2. In the list of standalone backups, find the backup you want to use to create the database.
    3. Click the Actions menu for the backup you are interested in, and then click Create Database.
    4. In the Create Database from Backup dialog, select Use an existing DB system.
    5. Click Create.
  4. 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.
  5. 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.

  6. Click Create Database.