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
Solved

Creating Folders on OS from PLSQL

Posted on 2012-03-30
5
1,415 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
5 Comments
 
LVL 76

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
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.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

856 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