``create-standby-database``
===========================
.. contents:: :local:
 :depth: 1
Description
------------
Creates a new standby database for the given source database id.

Usage
-----
.. code-block:: none

  oci db database create-standby-database [OPTIONS]

Required Parameters
--------------------
.. option:: --database-admin-password [text]

The administrator password of the primary database in this Data Guard association.

* The password MUST be the same as the primary admin password.

.. option:: --source-database-id [text]

The `OCID <https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm>`__ of the source (primary) database for the Data Guard group.


Optional Parameters
--------------------
.. option:: --db-unique-name [text]

Specifies the `DB_UNIQUE_NAME` of the standby database to be created.

.. option:: --is-active-data-guard-enabled [boolean]

True if active Data Guard is enabled.

.. option:: --protection-mode [text]

The protection mode to set up between the primary and standby databases. For more information, see `Oracle Data Guard Protection Modes <http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-protection-modes.htm#SBYDB02000>`__ in the Oracle Data Guard documentation.

**IMPORTANT** - The protection mode is required for first standby to be created.

Accepted values are:

.. code-block:: py

    MAXIMUM_AVAILABILITY, MAXIMUM_PERFORMANCE

.. option:: --sid-prefix [text]

Specifies a prefix for the `Oracle SID` of the standby database to be created.

.. option:: --source-tde-wallet-password [text]

The existing TDE wallet password of the source (primary) database.

.. option:: --transport-type [text]

The redo transport type to use for the standby database to be created.  Valid values depend on the specified `protectionMode`:

* MAXIMUM_AVAILABILITY - SYNC * MAXIMUM_PERFORMANCE - ASYNC

For more information, see `Redo Transport Services <http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-redo-transport-services.htm#SBYDB00400>`__ in the Oracle Data Guard documentation.

Accepted values are:

.. code-block:: py

    ASYNC, SYNC



Global Parameters
------------------
Use ``oci --help`` for help on global parameters.

:option:`--auth-purpose`, :option:`--auth`, :option:`--cert-bundle`, :option:`--cli-auto-prompt`, :option:`--cli-rc-file`, :option:`--config-file`, :option:`--connection-timeout`, :option:`--debug`, :option:`--defaults-file`, :option:`--endpoint`, :option:`--generate-full-command-json-input`, :option:`--generate-param-json-input`, :option:`--help`, :option:`--latest-version`, :option:`--max-retries`, :option:`--no-retry`, :option:`--opc-client-request-id`, :option:`--opc-request-id`, :option:`--output`, :option:`--profile`, :option:`--proxy`, :option:`--query`, :option:`--raw-output`, :option:`--read-timeout`, :option:`--realm-specific-endpoint`, :option:`--region`, :option:`--release-info`, :option:`--request-id`, :option:`--version`, :option:`-?`, :option:`-d`, :option:`-h`, :option:`-i`, :option:`-v`



Example using required parameter
------------------

Copy the following CLI commands into a file named example.sh. Run the command by typing "bash example.sh" and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up `the OCI configuration  <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile>`__ and `appropriate security policies  <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm>`__ before trying the examples.

.. code-block:: none
    :class: copy-code-block

    
	export database_admin_password=<substitute-value-of-database_admin_password> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/db/database/create-standby-database.html#cmdoption-database-admin-password
	export source_database_id=<substitute-value-of-source_database_id> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/db/database/create-standby-database.html#cmdoption-source-database-id
	
	oci db database create-standby-database --database-admin-password $database_admin_password --source-database-id $source_database_id