Manage Credentials
You can create credentials, list credentials, or delete credentials in your Autonomous Database.
- Create Credentials to Access Cloud Services
To access services in the Cloud, such as Cloud Object Store, you first need to create credentials in your Autonomous Database. - Create Credentials to Access Cloud Services in Cloud Shell
Use Cloud Shell to run a script that creates OCI Native Credentials and Auth Token in your Autonomous Database. - List Credentials
DBMS_CLOUD
provides the ability to store credentials using the procedureDBMS_CLOUD.CREATE_CREDENTIAL
. You can list credentials from the viewALL_CREDENTIALS
. - Delete Credentials
DBMS_CLOUD
provides the ability to store credentials using the procedureDBMS_CLOUD.CREATE_CREDENTIAL
. You can remove credentials withDBMS_CLOUD.DROP_CREDENTIAL
.
Create Credentials to Access Cloud Services
To access services in the Cloud, such as Cloud Object Store, you first need to create credentials in your Autonomous Database.
Parent topic: Manage Credentials
Create Credentials to Access Cloud Services in Cloud Shell
Use Cloud Shell to run a script that creates OCI Native Credentials and Auth Token in your Autonomous Database.
Create OCI Native Credentials Using Cloud Shell
To create OCI Native Credentials, sign into your tenancy and run the
adb-create-cred.sh
script in the Cloud Shell developer tool.
- If you are in your home region and the Autonomous Database is in your home region, execute the script without the region argument. The script assumes the Autonomous Database is in your home region and will not prompt for an alternate region.
- However, if you are in your home region and your Autonomous Database is in an
alternate region, then you must pass in the
--region
argument when executing the script.
If you want to create an Auth Token/Swift credential,
though Oracle recommends the use of OCI Native Credentials, you can add the
--all
flag to the script to generate OCI Native Credentials and
the Auth Token/Swift credential.
adb-create-cred.sh --all
When this flag is used, the script asks if you want to include an Auth
Token. By answering y, your Auth Token key is generated and uploaded to your
OCI profile, and the oci_auth_token_credential.sql
and
auth_token.tok
scripts are created.
- Run the
oci_auth_token_credential.sql
script from the Cloud Shell, to create the Auth Token key in your database. The Auth Token key is the value of thepassword
parameter forDBMS_CLOUD_CREATE_CREDENTIAL
. - View
auth_token.tok
from the Cloud Shell. Your Auth Token is the value oftoken
.
Parent topic: Manage Credentials
List Credentials
DBMS_CLOUD
provides the ability to store
credentials using the procedure DBMS_CLOUD.CREATE_CREDENTIAL
. You can list credentials from the view
ALL_CREDENTIALS
.
For example, to list credentials, run the following command:
SELECT credential_name, username, comments FROM all_credentials;
CREDENTIAL_NAME USERNAME
---------------------------–----------------------------- --------------------
COMMENTS
---------------------------–----------------------------- --------------------
ADB_TOKEN user_name@example.com
{"comments":"Created via DBMS_CLOUD.create_credential"}
DEF_CRED_NAME user_name@example.com
{"comments":"Created via DBMS_CLOUD.create_credential"}
See ALL_CREDENTIALS for more information.
Parent topic: Manage Credentials
Delete Credentials
DBMS_CLOUD
provides the ability to store
credentials using the procedure DBMS_CLOUD.CREATE_CREDENTIAL
. You can remove credentials with DBMS_CLOUD.DROP_CREDENTIAL
.
For example, to remove the credential named DEF_CRED_NAME
, run the following command:
BEGIN
DBMS_CLOUD.DROP_CREDENTIAL
('DEF_CRED_NAME');
END;
For more information about the DBMS_CLOUD
procedures and parameters, see DBMS_CLOUD Subprograms and REST APIs.
Parent topic: Manage Credentials