如何以普通用户身份在Oracle中运行dbms_crypto函数? [英] How to run dbms_crypto functions in Oracle as regular user?
问题描述
我在Oracle中使用 dbms_crypto.hash()
函数时遇到问题.
I have problem with using dbms_crypto.hash()
function in Oracle.
我使用sqlplus作为"sys/passwd as sysdba"连接到数据库服务器,然后我安装了 dbms_crypto
软件包:
I connected to database server using sqlplus as "sys/passwd as sysdba",
then I installed dbms_crypto
package:
@/home/oracle/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/dbmsobtk.sql
@/home/oracle/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/prvtobtk.plb
Grant execute on dbms_crypto to public;
Grant execute on dbms_sqlhash to public;
Grant execute on dbms_obfuscation_toolkit to public;
Grant execute on dbms_obfuscation_toolkit_ffi to public;
Grant execute on dbms_crypto_ffi to public;
一切看起来都很不错,所以我测试了 hash()
函数:
Everything looks good, so I tested hash()
function:
SQL> select dbms_crypto.hash(utl_raw.cast_to_raw('zorg'), 3) from dual;
DBMS_CRYPTO.HASH(UTL_RAW.CAST_TO_RAW('ZORG'),3)
--------------------------------------------------------------------------------
60C440F9954CA4744204CDA9CC93567059C1EC82
我已断开连接并以普通用户身份连接到该数据库,但随后出现错误:
I disconnected and connected to that database as regular user, but then I got error:
SQL> select dbms_crypto.hash(utl_raw.cast_to_raw('zorg'), 3) from dual;
select dbms_crypto.hash(utl_raw.cast_to_raw('zorg'), 3) from dual
*
ERROR at line 1:
ORA-06521: PL/SQL: Error mapping function
ORA-06512: at "MN.DBMS_CRYPTO_FFI", line 131
ORA-06512: at "MN.DBMS_CRYPTO", line 72
为什么我不能以普通用户使用此功能?如何允许其他用户使用它?
Why I cannot use this function as regular user? How to allow other users to use it?
我与之合作:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
推荐答案
问题已解决.我以错误的用户身份创建了程序包.正确的方法:
Problem solved. I created package as wrong user. Proper way:
-
使用以下方法连接:
connect using:
sqlplus / as sysdba
安装软件包:
Install packages:
@/home/oracle/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/dbmsobtk.sql
@/home/oracle/app/oracle/product/11.2.0/dbhome_1/rdbms/admin/prvtobtk.plb
以常规用户身份连接并使用 dbms_crypto
包中的功能.
这篇关于如何以普通用户身份在Oracle中运行dbms_crypto函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!