Set Advanced Diagnostics Preferred Credential

You must set the Advanced diagnostics preferred credential to connect to the database and perform tasks such as creating and monitoring SQL Performance Analyzer tasks.

Preferred credentials simplify access to the database by using the database user password stored in an Oracle Cloud Infrastructure Vault service secret. The Advanced diagnostics preferred credential for SQL Performance Watch must be set in Database Management Diagnostics & Management. Note that you can set the preferred credential even if you've not enabled Diagnostics & Management for the database.

To set the Advanced diagnostics preferred credential for SQL Performance Watch:

  1. Go to the SQL Performance Watch Summary page.
  2. Click the name of the SQL Performance Watch-enabled database.
    The SQL Performance Watch home page for the database is displayed. If the Advanced diagnostics preferred credential is not set, a message asking to set the preferred credential is displayed on the top of the page.
  3. Click the Set the Advanced diagnostics preferred credential link in the message.
    The Preferred credentials tab in the Credentials section in Diagnostics & Management is displayed.
  4. Click the Actions icon (Actions) for the Advanced diagnostics preferred credential and click Edit.
  5. In the Edit preferred credential panel, select one of the following options in the Credential type drop-down list to set the preferred credential:
    • Named credential: Select this option to associate the preferred credential with an existing named credential.
      Note

      If a named credential is in use (active) and is set as the session credential for the database, then the name of the named credential is displayed adjacent to Active.
      1. Scope: Select the scope of the named credential:
        • Resource: A named credential with the Resource scope can be used to access, monitor and manage a single database.
        • Global: A named credential with the Global scope can be used to access, monitor and manage all the databases in Database Management.
      2. Named credential: Select the named credential. If the compartment in which the named credential resides is different from the compartment displayed, click Change compartment and select another compartment.
    • New credential: Select this option to create a new credential:
      1. User name: Specify the database user name to connect to the database.
      2. User password secret: Select the secret that contains the database user password from the drop-down list. Note that the user password cannot be directly stored in the preferred credential and it must first be stored in a Vault service secret. If the compartment in which the secret resides is different from the compartment displayed, click Change compartment and select another compartment.

        If an existing secret with the database user password is not available, then select Create new secret... in the drop-down list. For information on the permission required to create a secret and how to create a secret, see Perform Prerequisite Tasks.

      3. Role: Select the role from the available options.
      4. Save as new named credential: Optionally, select this check box and specify a name for the named credential and one of the following password access mode options to save the new credential as a named credential.
        • User: The permission to access the password secret is defined for a user in the policy.
        • Resource: The permission to access the password secret is defined for the type of resource (for which the named credential is created) in the policy.

    For information on how to work with named credentials in Database Management Diagnostics & Management, see Create and Manage Named Credentials.

  6. Optionally, click Test to check whether the connection to the database is established successfully using the credentials.
  7. Click Save to save the credentials.
On the Preferred credentials tab, you can click the Advanced diagnostics credential to view details such as the user name and password secret. You can also click the Actions icon (Actions) for the Advanced diagnostics preferred credential to edit, view, or clear the preferred credential.