Tom,
Thanks in advance for some guidance with following:
We recently migrated our dbs from 9i to 10gR2 (10.2.0.4) and got an application table that stores xml data on a long data column.
We¿re required to encrypt content data of the column holding the xml_data_txt so to accomplish this I¿ve been exploring to covert the long data to clob with below CTAS statement then use dbms_crypto or TDE as discussed on:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:44742967463133 Is the CTAS method to reorganize the table a good approach?
Or should we consider converting to XMLTYPE? As discussed on:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:44892646023494 Is TDE even supported on CLOB or XMLTYPE?
table_with_long_data_type
CLIENT_ID NOT NULL VARCHAR2(3)
PRODUCT_ID NOT NULL VARCHAR2(3)
SITE_ID NOT NULL VARCHAR2(3)
SVI_USER_ID NOT NULL VARCHAR2(18)
LOGIN_ID NOT NULL VARCHAR2(22)
NAME_SEARCH_KEY NOT NULL VARCHAR2(80)
SSN_TAX_ID VARCHAR2(12)
EMAIL VARCHAR2(80)
XML_DATA_TXT LONG
CTAS to reorganized the table:
create table user. table_with_long_data_type_tmp1
INITRANS 35 MAXTRANS 255
storage (initial 1G next 512M freelists 35 freelist groups 2)
tablespace tv_long
as
select dbms_metadata_util.long2clob(50000,' user. table_with_long_data_type_tmp1','xml_data_txt','rowid') xml_data_txt
from tv.site_user_profile
order by client_id,site_id,product_id,svi_user_id
desc user. table_with_long_data_type_tmp1
Name Null? Type
----------------------------------------- -------- ----------------------------
XML_DATA_TXT CLOB
March 06, 2009 - 10:37 am UTC
ops$tkyte%ORA10GR2> create table t ( x clob encrypt );
create table t ( x clob encrypt )
*
ERROR at line 1:
ORA-28330: encryption is not allowed for this data type
there is a TO_LOB function, do not use that api you are using, that would have huge overheads. TO_LOB just does it.
You could use dbms_redefinition in order to do this online.
As to whether you want to use XMLTYPE, that would be a rather personal decision you would have to make after reviewing the features/capabilities and determining whether they would benefit you or not.