Creating a Database System

Create an OCI Database with PostgreSQL database system.

Caution

Database systems can only be created in subnets that don't have IPv6 enabled. If you select an existing subnet with IPv6 enabled, database system creation fails.

After the necessary OCI prerequisites and network are in place, you can create the database system.

  1. Create or select a vault for the database administrator password. For more information, see Managing Vaults.
  2. Create a key for the database password. For more information, see Managing Keys.
  3. Create a secret for the database password. For more information, see Managing Vault Secrets.
    1. Open the navigation menu and select Databases. Under PostgreSQL, select DB Systems.
    2. (Optional) In the List scope section, under Compartment, select a compartment.
    3. Click Create PostgreSQL Database system.
    4. In the Create PostgreSQL Database system screen, select Create new Database system, then select Next.
    5. Set the database system configuration by providing values for the following:
      • Database system name: Enter a name for the database system.
      • Description: Optionally, enter a description for the database system.
      • PostgreSQL major version: Select a major version of the PostgreSQL database.
    6. (Optional) Tags: If you have permissions to create a resource, then 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're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.
    7. In the Database system section, enter a value for Node count. One primary node is required. Extra nodes are reserved as read replica nodes.
    8. Performance tier: Select the performance tier for the database. The default value is 75,000 IOPS. For more information, see Performance Tiers.
    9. Select an option for Data placement:
      • Regional: Data is durably stored in multiple availability domains in the region.
      • Availability Domain-specific: Data is durably stored in the selected availability domain.
    10. Set the Hardware configuration for the database system using the following:
      • Shape series: Select a processor group.

        • AMD: (Flexible) Standard shapes that use current-generation AMD processors.
        • Intel: (Flexible) Standard shapes that use current-generation Intel processors.
      • Shape filter: Choose from Flex or Fixed. Flexible shapes have a customizable number of OCPUs and amount of memory.
      • Shape name: Select a shape.
      If you chose a flexible shape, enter values for the shape's OCPU count and Memory. For more information, including minimum and maximum values, see Supported Shapes.
    11. (Optional) Configure extensions: Select an existing database configuration or select Create new configuration and extensions to create a new configuration compatible with the shape of the database system. For more information, see Creating a Configuration.
    12. In the Network configuration section providing values for the following:
      • Virtual Cloud Network: Select the VCN in which you want to create the database system. If you need to create a VCN, click create a VCN and see VCN and Subnet Management.
      • Subnet: Choose the private subnet of the selected VCN.
      • Provide an available Private IP address in the specified subnet of the database system. If you don't provide an address, the service chooses an address for you.
      • Enable reader endpoint: Select this option to enable a single read-only endpoint for the database system. For more information, see Enabling or Disabling the Database System Reader Endpoint.
      • Use network security groups to control traffic: Enable this option to add this database system to an existing network security group. Select an NSG from the list, and select Add another network security group if needed.

        Important

        Security lists applied on the selected subnet or NSG you select must be configured to allow traffic to the database system's VNIC using specific protocols and ports.
    13. Provide the Database system administrator credentials to the database. Administrators don't get superuser access. An OCI Database with PostgreSQL admin user can create users and roles.
      1. Username: Specify the username of the administrator. This value can't be changed after the database system is created.
      2. Select one of the following Password options:
        • Input password:
          1. Password: Specify the administrator password.
          2. Confirm password: Confirm the administrator password.
        • Use OCI Vault:
          1. Vault: Select the vault that contains the administrator password.
          2. Secret: Select the secret containing the administrator password.
          3. Secret version: Select a secret version.
    14. The Management policy section gives you the opportunity to specify backup and maintenance policies for the database system:
      1. Automatic backups: Select Enable automatic backups to enable automatic backups. If you don't select automatic backups, you must manage backups manually. We recommend that you enable automatic backups. After enabling automatic backups, you can set the following options:
        • Backup frequency: How often a backup is created.
        • Day of the (time period): The day that the backup is created.
        • Backup start time (UTC): The time that the backup is created.
        • Backup retention period (days): Enter a value, in days, that the backup will be retained before it's deleted by the system.
      2. Maintenance: Select a Maintenance type option. For more information, see Maintenance.
        • Set by Oracle: Oracle chooses the best day and time to start any essential maintenance.
        • Schedule your own maintenance: Specify the day of the week and the maintenance start time (in UTC timezone) that you want to schedule any essential maintenance activity, such as OS or instance upgrades. If you don't specify a day and time, Oracle chooses it for you.
    15. (Optional) Select Show advanced options to set configuration variables or add tags for the database system.
    16. After configuring the database system, select Next.
    17. Review the database system configuration, then select Create.
  • Use the oci psql db-system create command and required parameters to create a database system:

    oci psql db-system create --compartment-id <compartment_OCID> --db-version <db_version> --display-name <display_name> --network-details <file://network-details.json> --shape <shape> --storage-details <file://storage-details.json> --system-type <system_type> [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the CreateDbSystem operation to create a database system.

    For information about using the API and signing requests, see REST API documentation and Security Credentials. For information about SDKs, see SDKs and the CLI.