• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 694
  • Last Modified:

I want to write an wrapped procedure in Oracle which is invisible so that no one can drop it.

I want to write an wrapped procedure in Oracle.
That should not  list in the procedure names so that no one will be able to drop it.

Presume  GIVE_RAISE is an wrapped procuedue.

SQL> select text from user_source where name = 'GIVE_RAISE';
The above statment should give a result
"no rows selected"
instead of displaying the content in the encryted format.





Normally wrapped procedure is like below .
 
C:\oracle9i\bin>wrap iname=giveraise.sql oname=give_raise_encrypted.sql
SQL> @c:\oracle9i\bin\give_raise_encrypted.sql
Procedure Created. 
Now, another query against user_source shows the newly wrapped code: 
SQL> select text from user_source where name = 'GIVE_RAISE';
TEXT
----------------------------------------------------------
procedure give_raise wrapped
0
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
0 9a 8f :2 a0 6b :2 a0 f b0
3d 8f a0 b0 3d b4 55 6a
a0 7e 51 b4 2e :3 a0 7e 51
b4 2e e7 :2 a0 7e b4 2e ef
f9 e9 b7 19 3c b7 a4 b1
11 68 4f 1d 17 b5
...

Open in new window

0
bethel777
Asked:
bethel777
  • 4
  • 3
3 Solutions
 
bethel777Author Commented:
Appreciate an example is listed.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you cannot do that.
you can obfuscate the code, you can encrypt it, you can grant/deny permissions so only the owner can drop/alter it, but you cannot hide it completely from the database.
0
 
bethel777Author Commented:
Can I wrap a view ?

When I write a sql
Create or replace view efgh wrapped
as select * from abcd

it throws out an error  " missing keyword"
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>Can I wrap a view ?
can you clarify?

the error you get is the "wrapped" that comes although "as" is expected...
0
 
bethel777Author Commented:
Like wrapping a procedure  I want to create a wrapped view so that the source code is protected.
for eg below

SQL> Create or replace view efgh as select * from abcd
                   creates a view 'efgh' of the table 'abcd'
I want to modify the above source code so that  so that user will not know what is that 'efgh'
if I do wrap iname=ab.sql  oname=ef.sql the resulting query shows the code if it is not wrapped.

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I found the tool "wrap" that you are looking for:
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/wrap.htm

so, you do 2 things:
§ wrap the function/view/package so the code is unreadable (remember to keep a copy of the code in a (protected) .sql file so that you still have the code as such!!!!
§ use access control so that views can only be selected, but not be altered/dropped.
0
 
bethel777Author Commented:
I had gone thru the same.I know to write the code for wrapping procedures and creating wrapped sqls for the same,
But writing code to wrap views is confusing.

Pls help me by converting the below example to protect the source code.

SQL> Create or replace view efgh as select * from abcd;

where 'abcd' is the table and 'efgh' is the view.


0
 
FayyazCommented:
I think you can't wrap the views and triggers. Only procedures, functions and packages can be wrapped. If you want to wrap a trigger, you can call a wrapped procedure inside the trigger.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now