Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Andrey.

Asked: March 15, 2017 - 9:58 pm UTC

Last updated: March 25, 2017 - 3:43 am UTC

Version: Oracle XE 11.2.0

Viewed 1000+ times

You Asked

Hello, Tom! Tell me plz how i can copies file from server to another computer throught executable jobs ?

Code of my job:

begin
dbms_scheduler.create_job (
job_name =>'tstcmd',
job_type =>'executable',
job_action =>'D:\Copy_export_data.bat',
enabled => False,
auto_drop => true
);
commit;
end;

I tried do it throught bat file with next code:

copy D:\DATA_EXPORT.CSV \\Piligrim\test

But it did not work...If i runing bat file on click then its working

and Connor said...

Create a program, and then create a job on that program.

An old but valid example here

http://www.databasejournal.com/features/oracle/article.php/3365371/Executing-External-Programs-From-Within-Oracle.htm

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Andrey -, March 19, 2017 - 7:54 pm UTC

Thanks, but i have error "STANDARD_ERROR="ЋвЄ § ­® ў ¤®бвгЇҐ" in jobs.

\\Piligrim\test - address other computer

If i runing bat file on click then its working...

job_action =>'D:\Copy_export_data.bat' had such problem...

How resolve that problem?
Connor McDonald
March 22, 2017 - 2:02 am UTC

We need more details than that.

Detail info

Andrey -, March 23, 2017 - 10:03 pm UTC

There are two computers - on the first one is installed Oracle Server, and the second - the user's computer. They are connected by wi-fi. I want that I run Job, which will copy the file from the server computer to the user's computer file. I tried to use the CMD command in the action Executable Job field and created a bat-file, starting both through the action Executable Job and through the Program, as you recommended, but it does not help (How do I implement a file copy from one computer to another?

Name of the user's computer Pilgrim. On this computer there is a share-folder in which I want to copy the file.
Connor McDonald
March 25, 2017 - 3:43 am UTC

The OS account via which the database is running under needs to have the appropriate rights to access/copy/etc the target computer as destination.

But it strikes me as an odd way to achieve this - why push data to the user's machine. Would it not be more efficient to write the file locally, and let the user retrieve it from a shared drive *when* they need it.

More to Explore

DBMS_SCHEDULER

More on PL/SQL routine DBMS_SCHEDULER here