🔹 How to Enable DBMS_CRYPTO
in Oracle 11g
The DBMS_CRYPTO
package is used for encryption, hashing, and secure data handling in Oracle. However, it requires explicit privileges before use.
[Warning] ORA-24344: success with compilation error
4/26 PLS-00201: identifier 'DBMS_CRYPTO' must be declared
4/5 PL/SQL: Statement ignored
(1: 0): Warning: compiled but with compilation errors
4/26 PLS-00201: identifier 'DBMS_CRYPTO' must be declared
4/5 PL/SQL: Statement ignored
(1: 0): Warning: compiled but with compilation errors
1️⃣ Grant Required Privileges
By default, DBMS_CRYPTO
is not accessible to normal users in Oracle 11g. You need to grant access.
🔹 Step 1: Grant Execution Privileges
Log in as SYSDBA and run:
🔹 Replace your_username
with the actual Oracle user who needs access.
2️⃣ Verify DBMS_CRYPTO
is Enabled
Check if the package is available:
🔹 If it returns a row, the package exists.
3️⃣ Test DBMS_CRYPTO
Run a simple encryption test:
🔹 If this runs without errors, DBMS_CRYPTO
is enabled.
4️⃣ Common Errors & Fixes
🔹 ORA-00904: DBMS_CRYPTO.ENCRYPT: Invalid Identifier
Fix: Grant EXECUTE
privilege:
🔹 ORA-06550: PLS-00201: Identifier 'DBMS_CRYPTO' must be declared
Fix: Connect as SYSDBA and recompile:
✅ Summary
Step | Command |
---|---|
Grant access | GRANT EXECUTE ON DBMS_CRYPTO TO your_username; |
Verify package | SELECT * FROM all_objects WHERE object_name = 'DBMS_CRYPTO'; |
Test encryption | Use DBMS_CRYPTO.ENCRYPT to test |
Tags:
Oracle