RE: copy file to a remote server

  • From: Eugene Pipko <epipko@xxxxxxxxxxxx>
  • To: 'Tim Hall' <tim@xxxxxxxxxxxxxxx>, "frits.hoogland@xxxxxxxxx" <frits.hoogland@xxxxxxxxx>
  • Date: Fri, 1 Oct 2010 08:42:41 -0700

Thank you all for your responses.
Can't use some of the solutions that you offered since I am on 9.2.0.8.
Can't upgrade to Linux (just yet).
I will give it another try to write directly to fully qualified unc path 
(mapped drive) and, if that doesn't work I will write and schedule .bat file to 
execute procedure and move the file to remote box.

Eugene


From: timseanhall@xxxxxxxxx [mailto:timseanhall@xxxxxxxxx] On Behalf Of Tim Hall
Sent: Friday, October 01, 2010 7:57 AM
To: frits.hoogland@xxxxxxxxx
Cc: andy@xxxxxxxxxxxxxxx; Eugene Pipko; Goulet, Richard; oracle-l@xxxxxxxxxxxxx
Subject: Re: copy file to a remote server

Alternatively, upgrade to Linux :)

Cheers

Tim...
On Fri, Oct 1, 2010 at 2:47 PM, Frits Hoogland 
<frits.hoogland@xxxxxxxxx<mailto:frits.hoogland@xxxxxxxxx>> wrote:
See this blogpost: Using datapump on windows to write to a 
share<http://fritshoogland.wordpress.com/2010/01/20/using-datapump-on-windows-to-write-to-a-share/>


Frits Hoogland

http://fritshoogland.wordpress.com
mailto: frits.hoogland@xxxxxxxxx<mailto:frits.hoogland@xxxxxxxxx>
cell: +31-6-53569942



On Oct 1, 2010, at 3:27 PM, Andy Klock wrote:


Back in my utl_file_dir/Windows days I remember having issues with accessing 
mapped drives (typically resolved with lots of rebooting).  You may be better 
off with Oracle Directories.

Or another approach is to convert the file into a clob and then having a 
program convert it to a file.  To give Cary Millsap a plug, his Mr. Trace SQL 
Developer pluggin works under this premise to deliver developers server side 
trace information, giving them the tools to think for themselves.

To start convert your file into a clob:

--uncompiled pseudo-code
 create or replace function getmyfile (p_directory varchar2, p_filename 
varchar2)  return clob as
   c clob;
   b bfile := bfilename(p_directory,p_filename);
 begin
    dbms_lob.open(b,dbms_lob.file_readonly);
    dbms_lob.createtemporary(c,true);
    dbms_lob.loadfromfile(c,b,dbms_lob.lobmaxsize);
    dbms_lob.close(b);

    return c;

end getmyfile;
 /

Then you could use a program to dump that clob to a file someplace (that's not 
restricted to an Oracle directory).  I would use Java whereas Jared would 
probably use Perl.

Another option could be to call an Oracle scheduled job that kicks off a bat 
script or xcopy directly to do this file copy.
On Thu, Sep 30, 2010 at 5:21 PM, Eugene Pipko 
<epipko@xxxxxxxxxxxx<mailto:epipko@xxxxxxxxxxxx>> wrote:
They are not directories.
I set utl_file_dir = * on the source box.
I mapped the drive to the destination box.
When I run UTL_FILE.FCOPY (vSource_dir,vSource_file,vDest_dir,vDest_file); I 
get invalid_operation.



Other related posts: