ALL_SOURCE table - SQL & PL/SQL

Dear all,
Is there any method to hide my package body? I do not want the users to get my source code from ALL_SOURCE table, thanks.
Regards,
George 

Use the wrap utility that Oracle provides to encrypt the package source. It should be in your oracle_home/bin directory. 

Hi,
using wrap utility you will get the the .pll file. Which contains the codein hexadecimal format, when u compile this file instead of the .sql file, your code will be in hexa decimal format, so that you can't figure out the exact text from user_source.
just run this from the ORACLE_HOME/BIN OR SET THE PATH TO THIS DIRECTORY.
wrap iname=inputfilename.sql oname=outfilename
all the best
Khaleel 

Hello,
Thanks for reply.
Actually in my environment, I can select the package (header) from all_source, but I can't find the package body. So I just wonder how the DBA does this.
Regards,
George

Hi George,
I think that's because only the DBA has the privilege to view the source code. Your DBA has set the privilege of the user login so the user login can only view the header.

Related

Find Wraped Source In Oracle...

Hi all,
how can i findout wraped function and procedure ... in oracle database
Regards
Gopinath M 
Hi Gopinath,
From your post I understand that you want to see the original non wrapped function or a procedure from its wrapped version.
As per my knowledge from a wrapped code we will not be able to generate the original version.
While creating a procedure or function if you wrap the code it will be stored in the wrapped format in the data dictionaries.
If you come to know of any other way to see the original code of a wrapped object please share it with me.
Thanks
Hari 
Code Wrap is to avoid others seeing / editing the source.
Hence if you are owner of the code you should save the source in normal sql file and then wrap it. Any changes required - base source should be changed and then wrap.
Oracle provide a function for security - why you need to break that? 
hi,
My question is to identify only wrapped procedure or any other wrapped
sources .no probs i got the solutions.
SELECT NAME FROM USER_SOURCE WHERE TYPE='PACKAGE BODY'AND TEXT LIKE'%wrapped%'

BLOB into Content Area

Hallo,
Is there a way to upload a file, that is in
a blok-column of a custom table, and put it
on a content area ?
Thanks.
Filip Huysmans. 
Do you want to move the file from the custom table to the content area?
You can use the content area APIs to add a file item, but you'll first have to write the file to the file system (it has to be visible to the add_item procedure).
Regards,
Jerry 
Thanks Jerry,
But how do I write the file to the database ?
Thanks.+ 
See my response to thread http://technet.oracle.com:89/ubb/Forum82/HTML/000334.html.
Regards,
Jerry 
Hallo,
Why isn't there an API for uploading a
file into the content area ?
Thanks. 
I don't understand your question.
The add_item function will create a file item, but the file has to be uploaded from a file system that is visible to the API. There is no API call to load a file directly from another table.
Regards,
Jerry 
Filip,
The add_item function will create a file item in a content area, and upload the file. However, the file must reside on a file system that is visible to the procedure; i.e. on the same server as the database. There is no API that will copy a file stored in another database table.
If you want to load a file from a database table, you'll have to write it to the file system first.
Regards,
Jerry 
Jerry,
I think that Filip meant why don't we have an API to directly upload a BLOB into the content area, passing a BLOB locator, rather than a filename to the API call. Doesn't that make sense?
For example, imagine that we dynamically generate a file/report, and store things temporary in a BLOB. We would like to store that BLOB in the content area.
We currently implemented the work around to write the BLOB in a temporary file and then upload that file (and then delete it...). But it is a bit awkward and a API with BLOB parameter would be handy.
Pierre 
Pierre,
I've got documents stored as blobs in a table and I would like to add them to my content area (using the api). So I first need to load them to the file server.
Can you please explain in more details how you implemented your workaround?
Thanks,
Malin 
A solution to see documents stored as BLOB in a table directly in a content area could be to write a procedure that uses the package dbms_lob.read (pay attention 'cause it read only 32K at time!).
Lucy 
In Portal 3.0.9 there are two new functions that solve this problem:
add_item_post_upload and modify_item_post_upload (click on the links to see the documentation). These functions work by allowing you to first upload a document to the WWDOC_DOCUMENT$ table, and then creating/modifying a portal item to point to the document.
See the PL/SQL Gateway documention for more information on uploading files to the document table.
Regards,
Jerry 
If you search this forum for "PL/SQL gateway", you'll find several examples and tips for using the gateway together with the post_upload procedure.
Regards,
Jerry
the same problem.
I intent to use add_item_post_upload function.
How insert a document(file.txt) in "WWDOC_DOCUMENT$"

Bulk load PDFs into database

Hi,
I have a PL/SQL procedure that helps me to load PDFs (with fixed names) into a database table (in a BLOB column). I would like to run this procedure to upload all the PDFs by scanning through a directory (something like *.pdf). Is this possible? If so, could someone can help me to achieve this?
Any kind of help is appreciated.
Thanks
Leo. 
Hi,
to upload all the PDFs by scanning through a directory (something like *.pdf). Is this possible?If you mean to 'insert all PDF's into a BLOB column', yes, that should be possible.
However: mentioning your DB-version is very important here (always mention your version):
On 9i (or 8) you'd need some JAVA:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584
On 10g you could use DBMS_SCHEDULER to host OS commands or:
Upload blob by reading a directory
On 11gR2 there's the File Watcher:
http://download.oracle.com/docs/cd/E11882_01/server.112/e10595/scheduse005.htm#ADMIN13286 
Since it's not easy to traverse a directory or set of directories in PL/SQL it may be easier to do either of the following:
1. Write a shell script that loops through the directory and passes the file name to SQL*Plus which will in turn invoke the necessary procedure to load it into the database.
2. Write a shell script that generates a list of filenames in a text file. This output file can be then opened and looped through in PL/SQL to load the PDFs in the database. 
No need of shell script.........
Load all your files in OS directory....-Ek...
Link this directory to alias directory on databse.....
use dbms_lob.loadfromfile package to load file with BLOB as datatype
create table
Hope this helps..........
-Ek 
user2361373 wrote:
No need of shell script.........
use dbms_lob.loadfromfile package to load file with BLOB as datatypeHow do you expect to get the list of files to the DBMS_LOB function? PL/SQL cannot loop through the contents of a directory. :)
That is why I made the suggestion to have a shell script do that work and pass the results onto the PL/SQL program. 
Thanks Heok. I will use your Java option to solve my problem.
On 9i (or 8) you'd need some JAVA:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584
Many thanks to Centinel and EK.
Regards,
Leo.
Edited by: Leo Rajan on Nov 17, 2009 10:16 AM

About wrap utility

Sir,
I successfully wrap abc.sql to abc.plb .
After that, the file abc.plb is still readable using notepad. Is there anything wrong?
And also, how can compile abc.plb back into the database from which I dumped the source code?
Thanks a lot
Stephen
After that, the file abc.plb is still readable using notepad. Is there anything wrong?Nothing worng with it,
just run the .plb script in your database and it will create the procedure with encrypted code.
Thanks a lot for your reply.
Now how can I prove to myself that the newly compiled stored function is encrypted?
the procedure that I did is as following:
type the function code in notepad and save it in operating system file. Then wrap it into .plb file. Then
create the function in Enterprise Manager by copying the wrapped version source code.
Thanks
Stephen 
SELECT text FROM user_source where name = 'your_procedure_name';
You must see the text as garbage(encrypted).
SJH
OCP DBA

Deleting a Text File in PL/SQL

I am using the utl_file package to read a text file one row at a
time into my PL/SQL program, I then manipulate data and output
my results to a 2nd text file.
I reuse the the output file and would therefore like to delete
the contence of the file before I start the procedure. Does
anybody know how to delete a text file within a PL/SQL procedure?
Thanks for you help 
HI ,
If you open file in write mode automoatically the contents
will delete . So no need to delete file and recreate .
Open in 'W' mode.
Rajesh
Is there any way to remove the file completely from the disk? 
The only way is by using java. Create a java class load to
database then create a function based on class and call theat
function where required. 
Thanks Vikas!
That pointed me in the right direction. Found this excellent
article which describes how to do this, in case someone else
runs into this problem...
http://www.oracle.com/oramag/oracle/00-Mar/index.html?
o20java.html

Categories

Resources