我需要解开由其他开发人员创建的 Oracle 包。我在数据库中创建了 Prackage,但采用加密格式。
我需要的原因是,原来的开发人员已经离开了组织,现在需要通过数据库结构和逻辑的更新更改来重新定义包中的过程定义。
有人可以帮助我如何将 oracle 中的包裹解开吗?
您可以将代码粘贴到此处,它会为您解开它。
请注意,您将丢失所有注释,但变量名称将保留。
但为了好玩,让我们测试一下逻辑。
首先创建程序:
sqlplus testing/testtest
SQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 10 08:36:06 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create or replace procedure AA as
2 begin
3 null;
4 /*comments*/
5 end;
6 /
Procedure created.
Run Code Online (Sandbox Code Playgroud)
接下来我们将程序保存到操作系统中:
SQL> save aa.sql
Created file aa.sql
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle@HOSTNAME:/home/oracle/USER/wrapTest> ll
total 12K
drwxr-x---. 4 oracle oinstall 4.0K Oct 10 08:36 ../
-rw-r-----. 1 oracle oinstall 66 Oct 10 08:37 aa.sql
drwxr-x---. 2 oracle oinstall 4.0K Oct 10 08:37 ./
Run Code Online (Sandbox Code Playgroud)
保存后,我们将使用种子包装实用程序来混淆包:
oracle@HOSTNAME:/home/oracle/USER/wrapTest> wrap iname=aa.sql oname=aa.pls
PL/SQL Wrapper: Release 11.2.0.3.0- 64bit Production on Fri Oct 10 08:37:29 2014
Copyright (c) 1993, 2009, Oracle. All rights reserved.
Processing aa.sql to aa.pls
Run Code Online (Sandbox Code Playgroud)
现在让我们看看它是什么样子的:
oracle@HOSTNAME:/home/oracle/USER/wrapTest> cat aa.
aa.pls aa.sql
oracle@HOSTNAME:/home/oracle/USER/wrapTest> cat aa.pls
create or replace procedure AA wrapped
a000000
1f
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
7
22 55
7weeW1mRAdYVG9cX0WEujCaQghIwg5nnm7+fMr2ywFy49cO4dIvAwDL+0oabmYEILYsGwIHH
LcmmpnWE55Q=
/
Run Code Online (Sandbox Code Playgroud)
因此,我们将该代码复制到该链接中,如下所示:
正如您所看到的,我们丢失了注释,但检索了代码。