转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 数据库 >> ORACLE >> 正文
使用Oracle Wrap工具加密你的代码         ★★★★

使用Oracle Wrap工具加密你的代码

作者:闵涛 文章来源:闵涛的学习笔记 点击数:727 更新时间:2009/4/22 21:58:31


 

Oracle提供Wrap工具,可以用于加密你的Package等.
不过需要注意的是,加密后的代码无法解密,你需要保管好你的源代码。

以下是个例子:

1.源代码

create or replace function get_rowid
(l_rowid in varchar2)
return varchar2
is
ls_my_rowid     varchar2(200);          
rowid_type      number;          
object_number   number;          
relative_fno    number;          
block_number    number;          
row_number      number;  
begin
 dbms_rowid.rowid_info(l_rowid,rowid_type,object_number,relative_fno, block_number, row_number);          
 ls_my_rowid := 'Object# is      :'||to_char(object_number)||chr(10)||
                'Relative_fno is :'||to_char(relative_fno)||chr(10)||
                'Block number is :'||to_char(block_number)||chr(10)||
                'Row number is   :'||to_char(row_number);
 return ls_my_rowid ;
end;          
/                      

 

2.代码功能测试

 

[oracle@jumper tools]$ sqlplus scott/tiger

SQL*Plus: Release 9.2.0.4.0 - Production on Mon Nov 15 21:56:36 2004

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning option
JServer Release 9.2.0.4.0 - Production

SQL> @f_get_rowid

Function created.

SQL> select rowid from dept where deptno=10;

ROWID
------------------
AAABiPAABAAAFRSAAA

SQL> select get_rowid('AAABiPAABAAAFRSAAA') from dual;                               

GET_ROWID('AAABIPAABAAAFRSAAA')
------------------------------------------------------------------
Object# is      :6287
Relative_fno is :1
Block number is :21586
Row number is   :0


SQL> !
[oracle@jumper tools]$ ls
ct.sql  ddlt.sql  f_get_rowid.sql  getevent.sql					  

3.使用wrap加密及加密后的代码

 

[oracle@jumper tools]$ wrap iname=f_get_rowid.sql oname=f_get_rowid.plb

PL/SQL Wrapper: Release 9.2.0.4.0- Production on Mon Nov 15 21:59:39 2004

Copyright (c) Oracle Corporation 1993, 2001.  All Rights Reserved.

Processing f_get_rowid.sql to f_get_rowid.plb
     
[oracle@jumper tools]$ cat f_get_rowid.plb 
create or replace function get_rowid wrapped 
0
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
3
8
9200000
1
4
0 
17
2 :e:
1FUNCTION:
1GET_ROWID:
1L_ROWID:
1VARCHAR2:
1RETURN:
1LS_MY_ROWID:
1200:
1ROWID_TYPE:
1NUMBER:
1OBJECT_NUMBER:
1RELATIVE_FNO:
1BLOCK_NUMBER:
1ROW_NUMBER:
1DBMS_ROWID:
1ROWID_INFO:
1Object# is      :::
1||:
1TO_CHAR:
1CHR:
110:
1Relative_fno is :::
1Block number is :::
1Row number is   :::
0

0
0
83
2
0 a0 8d 8f a0 b0 3d b4
:2 a0 2c 6a a3 a0 51 a5 1c
81 b0 a3 a0 1c 81 b0 a3
a0 1c 81 b0 a3 a0 1c 81
b0 a3 a0 1c 81 b0 a3 a0
1c 81 b0 :2 a0 6b :6 a0 a5 57
a0 6e 7e :2 a0 a5 b b4 2e
7e a0 51 a5 b b4 2e 7e
6e b4 2e 7e :2 a0 a5 b b4
2e 7e a0 51 a5 b b4 2e
7e 6e b4 2e 7e :2 a0 a5 b
b4 2e 7e a0 51 a5 b b4
2e 7e 6e b4 2e 7e :2 a0 a5
b b4 2e d :2 a0 65 b7 a4
b1 11 68 4f 1d 17 b5 
83
2
0 3 7 23 1f 1e 2b 1b
30 34 38 3c 59 44 48 4b
4c 54 43 75 64 68 70 40
8d 7c 80 88 63 a9 98 9c
a4 60 c1 b0 b4 bc 97 dd
cc d0 d8 94 c8 e4 e8 eb
ef f3 f7 fb ff 103 104 109
10d 112 115 119 11d 11e 120 121
126 129 12d 130 131 133 134 139
13c 141 142 147 14a 14e 152 153
155 156 15b 15e 162 165 166 168
169 16e 171 176 177 17c 17f 183
187 188 18a 18b 190 193 197 19a
19b 19d 19e 1a3 1a6 1ab 1ac 1b1
1b4 1b8 1bc 1bd 1bf 1c0 1c5 1c9
1cd 1d1 1d5 1d7 1db 1dd 1e9 1ed
1ef 1f0 1f9 
83
2
0 1 a 2 d :2 2 :2 1 8
:3 1 e 17 16 :2 e :2 1 :3 d :2 1
:3 10 :2 1 :3 f :2 1 :3 f :2 1 :3 d 1
2 :2 d 18 20 2b 39 47 55
:3 2 11 24 26 2e :2 26 :2 11 3c
3e 42 :2 3e :2 11 45 3 :2 11 16
18 20 :2 18 :2 11 2d 2f 33 :2 2f
:2 11 36 3 :2 11 16 18 20 :2 18
:2 11 2d 2f 33 :2 2f :2 11 36 3
:2 11 16 18 20 :2 18 :2 11 :2 2 9
2 :9 1 
83
4
0 :2 1 :5 2 :2 3
:2 1 :7 5 :5 6 :5 7
:5 8 :5 9 :5 a :b c
:11 d e :2 d :5 e
:2 d :5 e :2 d e
f :2 d :5 f :2 d
:5 f :2 d f 10
:2 d :5 10 :3 d :3 11
:2 b :7 1 
1fb
4
:3 0 1 :3 0 2
:a 0 7e 1 :7 0
5 :2 0 3 4
:3 0 3 :7 0 5
4 :3 0 5 :3 0
4 :3 0 7 9
0 7e 2 a
:2 0 b 60 0
9 4 :3 0 7
:2 0 7 d f
:6 0 12 10 0
7c 0 6 :6 0
f 94 0 d
9 :3 0 14 :7 0
17 15 0 7c
0 8 :6 0 9
:3 0 19 :7 0 1c
1a 0 7c 0
a :6 0 13 c8
0 11 9 :3 0
1e :7 0 21 1f
0 7c 0 b
:6 0 9 :3



[网页制作]CSS文本:word-wrap  
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · Sql Server  · MySql
    · Access  · ORACLE
    · SyBase  · 其他
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台