142.4.3 CREATE_CREDENTIAL Procedure

The CREATE_CREDENTIAL procedure creates either a user-only, user-password, or token-based credential.

Syntax

To create a user-only or username-password credential:
DBMS_OBSERVABILITY.CREATE_CREDENTIAL( credential_name IN VARCHAR2,
                                      username        IN VARCHAR2,
                                      password        IN VARCHAR2,
                                      comments        IN VARCHAR2 DEFAULT NULL );
To create a token-based credential:
DBMS_OBSERVABILITY.CREATE_CREDENTIAL( credential_name IN VARCHAR2,
                                      token_type      IN BINARY_INTEGER,
                                      token           IN VARCHAR2,
                                      comments        IN VARCHAR2 DEFAULT NULL );

Parameters

Table 142-9 CREATE_CREDENTIAL Procedure Parameters

Parameter Description

credential_name

The user-specified name of the credential.

username

The username for the credential.

password

The user password for the credential.

token_type

The type of the token to create.

token

The token itself.

comments

User specified comments about the credential.

Usage Notes

You must use this Oracle API to create and manage credentials used for DBMS_OBSERVABILITY services or Oracle does not guarantee the usability of the observability services.

Examples

The following example illustrates how to create a user-only credential:
execute dbms_observability.create_credential( credential_name => 'my_cred_1',
                                              username        => 'my_usr',
                                              password        => NULL,
                                              comments        => 'My dbms_observability credential' );
The following example illustrates how to create a user-password credential:
execute dbms_observability.create_credential( credential_name => 'my_cred_2',
                                              username        => 'my_usr',
                                              password        => 'my_pwd',
                                              comments        => NULL );
The following example illustrates how to create a token-based credential:
execute dbms_observability.create_credential( credential_name => 'my_cred_3',
                                              token_type      => dbms_observability.oci_datakey,
                                              token           => 'abcdefghijklmnopqrstuvwxyz',
                                              comments        => 'This is my token credential!' );