How to create a Credential in Oracle Autonomous Database

BaskarBaskar
2 min read

This article quickly guides you on how to create and drop the credential in Oracle Autonomous Database.

  1. To create a Credential, you can use the following command:
BEGIN
  DBMS_CLOUD.CREATE_CREDENTIAL(
    credential_name => 'MY_CLOUD_CREDENTIAL',  -- Give any name of your choice
    username => 'identitycloudservice/baskar.babu@xyz.com', -- This is taken from your OCI User Profile
    password => '+BM4(U)d-GgxUXirFkGS' ); -- This is your Auth Token ID / Password
END;
/

In the above command, pass the 'username' variable with your User Profile value and pass the 'password' variable with your Auth Token value. Let me show you the screenshots so that you will be able to understand from where these values are picked up from the OCI Console.

For the 'username' value, refer to below screenshot:

For the 'password' value, refer to below screenshots one by one:

Note: As the Auth Token Value will not be shown again, copy and save it in your personal notepad.

  1. Let's now look at how to drop the credential if it is no longer needed.
BEGIN
  DBMS_CLOUD.DROP_CREDENTIAL(credential_name => 'MY_CLOUD_CREDENTIAL');
EXCEPTION
  WHEN OTHERS THEN NULL;
END;
/
  1. If you want to see the list of credentials which was created in your Autonomous Database, then you can run the following SQL.
col owner format a15
col credential_name format a26
col username format a60
set lines 250 pages 5000
SELECT owner, credential_name, username FROM all_credentials ORDER BY owner, credential_name, username;
0
Subscribe to my newsletter

Read articles from Baskar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Baskar
Baskar