/create_credential.pls Secret
Last active
May 19, 2022 09:53
クリデンシャルを作成するスクリプト。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
C_RSA_KEY constant varchar2(4000) := q'~ | |
*** 秘密キーの貼り付け *** | |
~'; | |
l_oneline_key varchar2(4000); | |
begin | |
-- 一行にする。 | |
l_oneline_key := regexp_replace( | |
C_RSA_KEY | |
,'(-+((BEGIN|END) (RSA )?(PUBLIC|PRIVATE) KEY)-+\s?|\s)' | |
, ''); | |
dbms_cloud.create_credential( | |
credential_name => 'MY_DATA_CRED8' | |
, user_ocid => '構成ファイルのuser=で指定されているOCID' | |
, tenancy_ocid => '構成ファイルのtenancy=で指定されているOCID' | |
, private_key => l_oneline_key | |
, fingerprint => '構成ファイルのfingerprint=で指定されている値' | |
); | |
end; | |
/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment