Oracle WRAP Utility
Hello Friends,
In this article, I will write about Oracle WRAP Utility. And how we can hide our PL/SQL codes. Oracle hides its packages (internal packages, also knows as DBMS packages). If we want to see body of the DBMS_JOB package, we can not see PL/SQL code. We will see the code is wrapped.
CREATE OR REPLACE PACKAGE BODY SYS.dbms_job wrapped a000000 1 abcd abcd abcd abcd abcd abcd 21a3 b16 lo1iuGKabyEptQ7AYEgtdK75BmEwg5Wr3l4FYKAPamS0YVj3PRYchH0hld1fVjvwrMuAW69P IRpr66AU9anSde7G/s0SEqGnRq1lMtPIv5oS+LkLjWMsdviZ/8mTU+AsGapF4qqdz3JR4PZt fzqcP2JOVo84jcefz+RAsEnvMxsTLRYBAxaBTlykY2wPpW6+XqZvj/lmCFhU18E/3TEWpRQb 5qZckusO2rpG787GwuV+s2zCeeXxFg4vs4uaQo05AYljfhxjOKSSbLg3TUk/VlckCE6PhXK/ ... /
We can hide our procedure, function or package codes with wrap utility. We can also hide our dynamic codes with using DBMS_DDL package in Oracle 10g R2. WRAP is a utility that runs on the operating system command. Use the prototype is as follows.
wrap iname=input_file oname=output_file
Here, iname is the input file covering procedure,function or package that we want to hide. Oname is the output file. You can write only iname. In this situation the output file name will be input_file_name.plb .
For example, we have the procedure talip_test. And we want to hide the content of this procedure with wrap utility.
CREATE OR REPLACE PROCEDURE talip_test AS BEGIN DBMS_OUTPUT.PUT_LINE('Test proseduru'); END; /
Save the procedure as talip_test.sql on the operating system. And use wrap utility as following
$ wrap iname= talip_test.sql
PL/SQL Wrapper: Release 11.2.0.1.0- Production on Thu Mar 10 13:50:13 2011 Copyright (c) 1993, 2009, Oracle. All rights reserved. Processing talip_test.sql to talip_test.plb
The output file will be saved as talip_test.plb. let’s open this file with vi
$ vi talip_test.plb
CREATE OR REPLACE PROCEDURE talip_test wrapped a000000 1 abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd 7 4d 89 BnIWMXkTu2kwu8RXi1DM+jgMrZUwg5nnm7+fMr2ywFwWoUf6VuOWoWLRzLh0i8DAMv7Shglp uFKbskr+KLK957KzHQYwLK4k6rKBL8jlrFHkBneJJVEJMi720eokH/Y5pqcyH4I= /
You can deploy this code to database. After deployment you can use this procedure.
SQL>exec talip_test;
Talip Hakan Ozturk