Solved

Creating Folders on OS from PLSQL

Posted on 2012-03-30
5
1,518 Views
Last Modified: 2012-04-04
Hello Experts,

Is it possible to create a folder from PLSQL.

My database version is 10g and OS version is Windows XP and Redhat Linux.

I want from examples for this.
0
Comment
Question by:Swadhin Ray
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 167 total points
ID: 37786733
There is no direct way.

There is a trick from the link below that uses dbms_scehduler to call MKDIR.

http://www.orafaq.com/forum/t/154053/2/

exec dbms_scheduler.create_job('mkdir','executable','/bin/mkdir',1,auto_drop=>false);
exec dbms_scheduler.set_job_argument_value('mkdir',1,'/tmp/newdir');
exec dbms_scheduler.run_job('mkdir');
0
 
LVL 16

Assisted Solution

by:Wasim Akram Shaik
Wasim Akram Shaik earned 167 total points
ID: 37786736
you can't create physical directories  in OS using plsql..

there is an alternative way, you have to use external routines possibly a Java or C++ program which can do this for you..

i don't have this sample piece code for this, but you can refer to docs on how to call a routine from oracle

http://docs.oracle.com/cd/B19306_01/appdev.102/b14251/adfns_extern_proc.htm#i1019726
0
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 166 total points
ID: 37786787
if the system you want to create the directories in has an ftp server you could try

http://www.experts-exchange.com/A_3043.html

note, you would be limited to only those file systems exposed by the ftp server, but you could do it on multiple servers, all with pl/sql
0
 
LVL 16

Author Comment

by:Swadhin Ray
ID: 37786870
Thanks experts for you comments. I will try all the possible method and update as soon as possible.
0
 
LVL 16

Author Closing Comment

by:Swadhin Ray
ID: 37809570
By getting all the inputs I have used the JAVA source to solve my problem.

here are the steps that I used to accomplish my problem :
1)      Created a JAVA SOURCE on Oracle database.
2)      Create a wrapper to make use of the JAVA Source and named it like runOScm.
3)      Login with SYS user and grant DBMS_JAVA read, write and execute to the users from where we want to run the export (Export is my main issue where I am having a table with file name and doc contain with Langraw column )
4)      Then i had run the runOScm from java granted users to create folder.
5) Finally wrote one program which exported the LangRaw column i.e. contains pdf's , .doc files to folders based on its file name using UTL File.
6) Finally used script to FTP all the folders to other remote DB.


This is really great :-)  Thanks a ton experts..
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Import and exporting Oracle Data with encrypted columns 4 70
Fill Null values 5 55
scheduler notification 9 79
Force XMLSEQUENCE to return empty tags for null values. 10 45
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question