Advertisement
fkeles

ENABLE_RESOURCE_PRINCIPAL.sql

May 18th, 2023 (edited)
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.74 KB | Source Code | 0 0
  1. -- enable resource principal
  2. EXEC DBMS_CLOUD_ADMIN.ENABLE_RESOURCE_PRINCIPAL();
  3.  
  4. -- list all credentials, you should see OCI$RESOURCE_PRINCIPAL
  5. SELECT * FROM all_credentials
  6.  
  7. -- test accessing object storage with different types of credentials: User Auth Token, User API Key and Resource Principal
  8. SELECT * FROM dbms_cloud.list_objects('CRED_USER_AUTH_TOKEN','https://objectstorage.<region-id>.oraclecloud.com/n/<ns>/b/bucket-20230405-1558/o/');
  9. SELECT * FROM dbms_cloud.list_objects('CRED_USER_API_KEY','https://objectstorage.<region-id>.oraclecloud.com/n/<ns>/b/bucket-20230405-1558/o/');
  10. SELECT * FROM dbms_cloud.list_objects('OCI$RESOURCE_PRINCIPAL','https://objectstorage.<region-id>.oraclecloud.com/n/<ns>/b/bucket-20230405-1558/o/');
  11.  
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement