UTL_RAW
The UTL_RAW
package provides SQL functions for manipulating RAW
data types.
该包的功能其实可以用来加密:
SELECT
UTL_RAW.CAST_TO_NUMBER('C20263') ID1,
UTL_RAW.CAST_FROM_NUMBER(UTL_RAW.CAST_TO_NUMBER('C20263')) ID2,
UTL_RAW.CAST_TO_RAW('搞怪的索引') NAME1,
UTL_RAW.CAST_TO_RAW('HTTP://BLOG.CSDN.NET/PERFECT_DB') NAME2,
UTL_RAW.CAST_TO_VARCHAR2(UTL_RAW.CAST_TO_RAW('搞怪的索引')) NAME3,
UTL_RAW.CAST_TO_VARCHAR2(UTL_RAW.CAST_TO_RAW('HTTP://BLOG.CSDN.NET/PERFECT_DB')) NAME4
FROM DUAL;
见老郭在他的文章中用过此函数,是在查看数据块的内容时,数据块中内容基本上都是raw类型,如果想看懂数据块的东西,这个包还是很有用的,下面给出一段数据块中的内容:
col 0: [ 3] c2 02 63
col 1: [ 6] 44 6f 6e 61 6c 64
col 2: [ 8] 4f 43 6f 6e 6e 65 6c 6c
col 3: [ 8] 44 4f 43 4f 4e 4e 45 4c
col 4: [12] 36 35 30 2e 35 30 37 2e 39 38 33 33
col 5: [ 7] 77 c7 06 15 01 01 01
col 6: [ 8] 53 48 5f 43 4c 45 52 4b
col 7: [ 2] c2 1b
col 8: *NULL*
col 9: [ 3] c2 02 19
col 10: [ 2] c1 33
其中红色部分就是可以通过此包查看,这段代码的具体值为:
198
Donald
OConnell
DOCONNEL
650.507.9833
1999-6-21
SH_CLERK
2600.00
124
50