【问题标题】:PLS-00201: identifier 'DBMS_OBFUSCATION_TOOLKIT.DESENCRYPT' must be declaredPLS-00201:必须声明标识符“DBMS_OBFUSCATION_TOOLKIT.DESENCRYPT”
【发布时间】:2021-12-22 03:58:28
【问题描述】:

这是我的包代码:

create or replace package body encryption as
    key_string   varchar2(64) := '$0@!H&^%#8I^~!JYE&#$55JKH*(@#$^^';
    encrypted_string varchar2(2048);
    decrypted_string varchar2(2048);

function encrypt (input_string IN varchar2) return varchar2 is
   BEGIN
       encrypted_string :=null;   

       dbms_obfuscation_toolkit.DESEncrypt(input_string =>pad(input_string),
                                       key_string   => key_string,
                                       encrypted_string=> encrypted_string);
       RETURN encrypted_string;                                    
   END;
   
function decrypt(input_string In varchar2) RETURN varchar2 IS
    BEGIN
        decrypted_string :=null;
        encrypted_string :=null; 

        dbms_obfuscation_toolkit.DESDecrypt(input_string => UTL_RAW.cast_to_varchar2(input_string),
                          key_string   =>key_string,
                                          decrypted_string=>decrypted_string);
    
        RETURN RTRIM(decrypted_string,'*');                                   
    END;
END;

运行此命令后,我在 Oracle 21c 中收到以下错误,但在 Oracle 18c 中运行成功。

Compilation failed,line 13 (17:55:27)
PLS-00201: identifier 'DBMS_OBFUSCATION_TOOLKIT.DESENCRYPT' must be declaredCompilation failed,line 13 (17:55:27)
PL/SQL: Statement ignoredCompilation failed,line 26 (17:55:27)
PLS-00201: identifier 'DBMS_OBFUSCATION_TOOLKIT.DESDECRYPT' must be declaredCompilation failed,line 26 (17:55:27)
PL/SQL: Statement ignored 

【问题讨论】:

    标签: sql plsql oracle-apex-20.1 oracle21c


    【解决方案1】:

    看起来应该是特权用户(例如SYS,如果您没有其他用户)应该

    grant execute on DBMS_OBFUSCATION_TOOLKIT to your_user;
    

    【讨论】:

      猜你喜欢
      • 2014-06-24
      • 1970-01-01
      • 1970-01-01
      • 2019-12-17
      • 2016-07-25
      • 2018-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多