Creating a Database

Note

This topic is not applicable to virtual machine DB systems.

When you launch a bare metal DB system, an initial database is created in that system. You can create additional databases in that DB system 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 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 Database to Oracle Cloud Infrastructure Object Storage.

Required IAM Policy

To use Oracle Cloud Infrastructure, you must be given the required type of access in a policy  written by an administrator, whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you try to perform an action and get a message that you don’t have permission or are unauthorized, confirm with your administrator the type of access you've been granted and which compartment  you should work in.

For administrators: The policy in Let database admins manage DB 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 the DB system.

  1. Open the navigation menu. Under Database, 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 version: The version of the database. You can mix database versions on the DB system, but not editions.
    • 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.
    • 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.
      • 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 database:

    • 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.
    • Optionally, you can apply tags. If you have permissions to create a resource, you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you are not sure if you should apply tags, skip this option (you can apply tags later) or ask your administrator.
  7. Click Create Database.

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

To create a database from a backup in an existing DB system

You can create a new database from a database backup. See Options for Creating a 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.
  1. Open the navigation menu. Under Database, 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.
  4. In the Create Database from Backup dialog, enter the following:

    • DB System: The DB system in which you want to create the database. You must have the Use Existing DB System radio button selected to see the drop-down list of DB system choices.

      Note

      You cannot create a new database in the same DB system in which the database used to create the backup resides.
    • 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 Admin Password:
      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.
      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 Database Admin Password: Re-enter the Database Admin Password you specified.
    • Password for Transparent Data Encryption (TDE) Wallet or RMAN Encryption:

      Enter either the TDE wallet password or the RMAN encryption password for the backup, whichever is applicable. The TDE wallet password is the SYS password provided when the database was created by using the Oracle Cloud Infrastructure Console, API, or CLI. The RMAN encryption password is typically required instead if the password was subsequently changed manually.

  5. Click Create Database.
To select a daily automatic backup or on-demand full backup as the source
  1. Click the DB system name that contains the specific database to display the DB System Details page.
  2. From the Databases list, click the database name associated with the backup you want to use.
  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 icon (three dots) for the backup, and then click Create Database.
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 Last Backup.
  4. In the Create Database from Backup dialog, select Create database from last backup.
To specify a timestamp for a point-in-time copy of the source
  1. Click the DB system name that contains the specific database to display the DB System Details page.
  2. From the Databases list, click the database name associated with the backup data you want to use as the source for the initial database in you new DB system.
  3. On the database details page, click Create Database from Last Backup.
  4. In the Create Database from Backup dialog, select Create database from specified timestamp.
To select a standalone backup as the source
To terminate a database

You'll get the chance to back up the database prior to terminating it. This creates a standalone backup that can be used to create a database later. Oracle recommends that you create this final backup for any production (non-test) database.

Note

Terminating a database removes all automatic incremental backups of the database from Oracle Cloud Infrastructure Object Storage. However, all full backups that were created on demand, including your final backup, will persist as standalone backups.

You cannot terminate a database that is assuming the primary role in a Data Guard association. To terminate it, you can switch it over to the standby role.

  1. Open the navigation menu. Under Database, 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 that contains the database you want to terminate, and then click its name to display details about it.
  4. In the list of databases, find the database you want to terminate, and then click its name to display details about it.
  5. Click Actions, and then click Terminate.
  6. In the confirmation dialog, indicate whether you want to back up the database before terminating it, and type the name of the database to confirm the termination.
  7. Click Terminate Database.

    The database's status indicates Terminating.