Utilities for Oracle Developers
Oracle developers can take advantage of many PL/SQL or Java utilities that exist in $ORACLE_HOME/bin or in supplied packages.
These utilities can load, encrypt, tune or debug code objects. This chapter will focus on the utilities that perform these functions, including wrap, dbms_profiler, dbms_debug, loadjava, dropjava and loadpsp.
The first of these utilities to be discussed will be the wrap utility that allows PL/SQL developers to encrypt their code.
The wrap utility (wrap.exe) provides a way for PL/SQL developers to protect their intellectual property by making their PL/SQL code unreadable. These encryption options have long been available for other programming languages and were introduced for PL/SQL in version 7. It still amazes me at the number of proprietary procedures and packages that are installed in a readable format – plain PL/SQL.
Unfortunately there is no such command as:
ALTER PACKAGE BODY [name] WRAP;
Instead, the wrap utility takes a readable, ASCII text file as input and converts it to a file containing byte code. The result is that the DBA, developers or anyone with database access cannot view the source code in any readable format.
The command line options for wrap are:
wrap iname=[file] oname=[file]
· iname – The name of the unencrypted PL/SQL file to be used as input (your source file).
· oname – The name of the output file. This file will be encrypted.
Below is a sample procedure that increases an employee’s salary by 15%, if they scored a 5 in their performance rating:
create or replace procedure give_raise
(emp_id in employee.id%type,
emp_rating in NUMBER )
-- raises are only given to those that scored a 5
-- in their rating
if emp_rating = 5 then
set salary = salary + (salary * .15)
where id = emp_id;
Once added to the dictionary, the data dictionary views display the source code for this procedural object:
To learn more about these techniques, see the book "Advanced
Oracle Utilities: The Definitive Reference".
Copyright © 1996 - 2014 by Burleson. All rights reserved.
Oracle® is the registered trademark
of Oracle Corporation.