ORA-28338: cannot encrypt indexed column(s) with salt

In my Oracle database wallet is configured. While i tried to create an index on the encrypted column then i got the following error:

Error:

SQL> CREATE INDEX EMP_IDX on EMPLOYEES(EMPID);
error:
ORA-28338: cannot encrypt indexed column(s) with salt

Solution:

On the encrypted column with salt option, we cannot create the index, We need to modified the column property to the no salt. In Wallet, when we create the encrypt column to save data then with SALT option is default. it automatically pick by Oracle.

While Creating the table we have to follow the following syntax if we want to create index on that column:

CREATE TABLE employee (
   empID NUMBER ENCRYPT NO SALT,
   salary NUMBER(6) ENCRYPT USING '3DES168');

If want to create the index on existing column which already encrypted then we use ALTER command:

ALTER TABLE employee MODIFY (empid ENCRYPT NO SALT);

After convert the encrypted from SALT to No SALT option. you will able to create index on it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.