WHCSRL 技术网

【ORACLE】dbms_cloud包使用的各大云厂商对象存储的username及password位置

前言

之前没有万事达和visa卡,想测试oracle各种功能,比如dbms_cloud,遇到了点麻烦,当天就申请了万事达卡,结果卡还没到,第二天就用京东云和腾讯云跑通了。
https://www.darkathena.top/archives/dbmscloudjdcloudoss
https://www.darkathena.top/archives/dbmscloudrelated

然后今天我的万事达卡到了,赶紧去银行把卡开了,然后马不停蹄地赶回家,直接就把国外三大云服务厂商的免费套餐都申请了
image.png
image.png
image.png

然后这三家全部都用dbms_cloud包上传成功,中间找api要用的username及password费了不少时间,所以本文就收集整理各个云厂商对象存储针对dbms_cloud包的username及password位置。

begin
  dbms_cloud.create_credential (
    credential_name => credential_name ,
    username        => username        ,
    password        => password        );
end;
/
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

先上官方文档

https://docs.oracle.com/en/cloud/paas/autonomous-database/adbdh/#ADBDH-GUID-0C42BA43-3960-416D-B351-FDFBA8733847

Oracle Cloud Infrastructure Credentials (Auth Tokens)

For Oracle Cloud Infrastructure the username is your Oracle Cloud Infrastructure user name. The password is your Oracle Cloud Infrastructure auth token. See Working with Auth Tokens.

Oracle Cloud Infrastructure Object Storage Classic Credentials

If your source files reside in Oracle Cloud Infrastructure Object Storage Classic, the username is your Oracle Cloud Infrastructure Classic user name and the password is your Oracle Cloud Infrastructure Classic password.

Amazon Web Services (AWS) Credentials

If your source files reside in Amazon S3 or you are calling an AWS API, the username is your AWS access key ID and the password is your AWS secret access key. See AWS Identity and Access Management.

Microsoft Azure Credentials

If your source files reside in Azure Blob Storage or you are calling an Azure API, the username is your Azure storage account name and the password is an Azure storage account access key. See About Azure storage accounts.

Amazon S3-Compatible Credentials

Service Credentials Information

Oracle Cloud Infrastructure (Customer Secret Keys)

If your source files reside in Oracle Cloud Infrastructure, then you need to use Customer Secret Keys with S3-compatible URLs. See Working with Customer Secret Keys for more information.

Google Cloud Storage

If your source files reside in Google Cloud Storage or you are calling Google Cloud Storage APIs, then you need to set a default Google project and obtain an HMAC key to create credentials to supply with Google Cloud Storage S3-compatible URLs. Use the HMAC key id as the username, and the HMAC secret as the password.

See Projects and HMAC Keys for more information.

Wasabi Hot Cloud Storage

If your source files reside in Wasabi Hot Cloud Storage or you are calling Wasabi Hot Cloud Storage APIs, then you need Access Keys to create credentials to supply with S3-compatible URLs. Use the Wasabi Hot Cloud Storage Access Key as the username, and the Wasabi Hot Cloud Storage Secret Key as the password.

See Creating a Wasabi API Access Key Set for more information.

图都没配,各种"See …",要到处找。

Oracle(甲骨文)

ORACLE自己一家就搞了3种方式,这3种方式根据链接url的规则不同而使用不同的username及password,
如果其中一种方式提示

ORA-20401: Authorization failed for URI
ORA-06512: 在 “SYS.DBMS_CLOUD”, line 917
ORA-06512: 在 “SYS.DBMS_CLOUD”, line 2470
ORA-06512: 在 line 2

则换另一种方式再试,或者换url链接规则。

S3兼容方式

  1. 登录后,右上角头像,然后点击User Settings
    image.png
  2. 然后左下角,Customer Secret Keys
    image.png
  3. 点击Generate Secret Key,弹窗
    image.png
  4. 随便起个名,点击Generate Secret Key,变成这样,先别关
    image.png
  5. 点击copy,粘贴到你记东西的地方,这玩意只出现一次,忘记得重新生成,然后点close
    image.png
  6. 鼠标移到省略号上面,弹提示,点击copy,同样也是粘贴到你记东西的地方
    到此,你已经获得了password(第一次粘贴的)和username(第二次粘贴的)

token方式

链接格式

https://objectstorage.ap-tokyo-1.oraclecloud.com/n/xxxxxxxxxxxx/b/bucket-xxxxxxxxx-xxxxx/o/filename.csv

  1. 还是刚刚的界面,点击Auth Tokens ,点击Generate Token
    image.png
  2. 随便输入个名字,点击Generate Token
    image.png
  3. 点击copy,粘贴到你记东西的地方,这玩意只出现一次,忘记得重新生成,然后点close
    image.png
  4. 到此,你已经获得了password(刚刚粘贴的)和username(这个界面最上面的用户名,根据进来的账号而定,是一长串的就是这一长串)
    image.png

经典方式

Oracle Cloud Infrastructure Object Storage Classic
我账号里没有这种,测不了

Aws(亚马逊)

  1. 点击左上角服务,然后在安全性、身份与合规性下面点击IAM
    image.png
  2. 点击左边的用户,切换到安全证书,点击下面的创建访问密钥
    image.png
  3. 点击显示,把密钥ID和密钥复制保存下来,或者点击下载.csv文件保存下来
    image.png
  4. 至此,你已获得了username(前者)及password(后者)

Azure(微软)

  1. 先要创建存储账户
    image.png
  2. 创建好后,点击账户名称进去
    image.png
  3. 点击访问密钥,然后点击显示密钥
    image.png
  4. 至此,你已获得了username(存储账户名称)及password(密钥)

另外官方说的兼容S3的那两家,googlecloud(谷歌云)国内测不了,wasabihot(芥末热?)还不太了解,不敢瞎弄,毕竟这玩意要绑信用卡,怕误操作就扣费了

然后下面是oracle官方没提到的,但我实测国内通过的云服务厂商

腾讯云COS

进访问管理、访问密钥、API密钥管理,新建密钥
image.png
username就是secret id,password就是secrect key

京东云OSS

进账户管理点AccessKey管理,点创建AccessKey

username就是key ID,password就是Key Secret

另外

我在github上开了个仓库,收集了各个云的证书文件、sql配置参数,并且把这些要用到的证书都打包成了一个oracle的wallet,方便大家使用
https://github.com/Dark-Athena/DBMS_CLOUD_3RD_OPTION

推荐阅读