Oracle工具——WRAP

来源:互联网 发布:做淘宝刷手的接单技巧 编辑:程序博客网 时间:2024/04/18 11:42

Oracle工具——WRAP

WRAP工具是Oracle用来加密PROCEDURE、FUNCTION、PACKAGE和TYPE的工具,使用WRAP加密后,PL/SQL代码变得无法阅读,但是Oracle可以执行加密后的PL/SQL代码。需要注意WRAP加密后,没有办法还原,因此如果在数据库中创建的过程或函数是加密的,那么如果以后需要修改代码,必须找到未加密的版本进行修改,然后再次加密。Oracle绝大部分的内部包都是经过加密的。

WRAP工具的使用很简单,指定一个输入参数,一个输出参数就可以了:

E:>wrap iname=e:f_link.sql oname=e:f_link.out

PL/SQL Wrapper: Release 10.2.0.1.0- Production on Mon May 11 20:55:39 2009

Copyright (c) 1993, 2004, Oracle. All rights reserved.

Processing e:f_link.sql to e:f_link.out

不过由于WRAP工具没有任何的提示,还是很容易犯错误的,当时就是将iname和oname参数错记为ifile和ofile,导致的错误:

E:>wrap ifile=e:f_link.sql ofile=e:f_link.out
PSU(32,1,0,0):Invalid command line arguments
PL/SQL Wrapper error: Couldn't process command line arguments.

E:>wrap

E:>wrap help
PSU(32,1,0,0):Invalid command line arguments
PL/SQL Wrapper error: Couldn't process command line arguments.

E:>help wrap帮助实用程序不支持这个命令。请键入 "x /?"。

E:>wrap /?
PSU(32,1,0,0):Invalid command line arguments
PL/SQL Wrapper error: Couldn't process command line arguments.

E:>wrap ifile="e:f_link.sql" ofile="e:f_link.out"
PSU(32,1,0,0):Invalid command line arguments
PL/SQL Wrapper error: Couldn't process command line arguments.

另外还需要注意一点,各个版本的WRAP的结果相差很大,Oracle对WRAP生成的结果也是向下兼容的,10g的数据库可以使用9i生成的WRAP文件,而在9i中无法使用10g的wrap的生成结果。

E:>wrap iname=e:f_link.sql

PL/SQL Wrapper: Release 9.2.0.4.0- Production on 星期二 5月 12 17:17:40 2009

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

Processing e:f_link.sql to f_link.plb

在10g中加载f_link.plb文件:

SQL> SELECT * FROM V$VERSION;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production

SQL> @E:F_LINK.PLB

程序包已创建。

类型已创建。

类型主体已创建。

函数已创建。

http://hi.baidu.com/goodlisf/item/c0213c45c86a3d2411ee1e2d

原创粉丝点击