Search This Blog

Saturday, August 1, 2009

How to wrap plsql code

Dear Friends,

Today i come across a requirement to UNWRAP plsql code. want to share with you all.

How to wrap plsql code (procedure,function,trigger)

1. There is client side OS utility "WRAP" through we can wrap plsql code.

2. What is the syntax and parameters

1. The syntax is very simple and there to parameter.

Syntax: cmd>wrap iname=test.sql oname=wrap_test.sql

Parameter:

iname = input plsql code file

oname = output with wrap plsql code file

eg:

SQL> host wrap iname=c:\test.sql oname=c:\test_unwrap.sql
PL/SQL Wrapper: Release 10.1.0.4.2- Production on Sat Aug 01 17:08:02 2009
Copyright (c) 1993, 2004, Oracle. All rights reserved.
Processing c:\test.sql to c:\test_unwrap.sql

SQL> @c:\test_unwrap.sql
Procedure created.
SQL> select text from user_source where name='TEST';
TEXT

--------------------------------------------------------------------------------
procedure TEST wrappeda000000b2abcdabcdabcdabcdabcdabcdabcdabcd
TEXT

--------------------------------------------------------------------------------
abcdabcdabcdabcdabcdabcdabcd723 55DcPgmpJJ2JAE/YKfa+Z8kj6scxUwg5nnm7+fMr2ywFznUrLL7sB0i8DAMv7ShpuZgQgti8CBxy3Jpqbo3ecD

Content of TEST.SQL file

SQL> host type c:\test.sql

create or replace procedure TEST

as

begin

null;

end;

/

Reference:

http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/c_wrap.htm

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1484204932051

It is easy to wrap the plsql code but what happen when we need to unwrap the code without source code file :)

The same situation happen with me... but i found one link on google to unwrap plsql code...

I can't refer here for security reason. Sorry


4 comments:

Rajeshkumar Govindarajan said...

I AM LEARNING LOT OF new concepts using ur blog
thanks taj,

halimdba said...

In 9i, it is possible to unwrap plsql without source code,but in 10g is it possible?

Best Regards
Muhammad Abdul Halim

mohammad tajbakhsh said...

hi.
i'm mohammad tajbakhsh.
i faced an error on a database which i hanged. i dont know what to do.please help me.

Error at line 1
ORA-00604: error occurred at recursive SQL level 1
ORA-00001: unique constraint (SYS.I_OBJ1) violated

Admin said...

hi

nice blog >>>

I have also blog , have look at it , and please suggest something !!

thanks
bye
http://linux-oracle-dba.blogspot.com/