dbTalk Databases Forums  

Accessing files copied by UTL_FILE.FCOPY

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Accessing files copied by UTL_FILE.FCOPY in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Claus
 
Posts: n/a

Default Accessing files copied by UTL_FILE.FCOPY - 09-29-2008 , 08:25 AM






Hi folks,

I'm running into a strange (at least to me) problem. I have
implemented a small document management system into an existing
Oracle10g database application. DMS requires copying files from one
folder to another. Physical files (originals as well as copies) are
located on a mapped resource. This drive is mapped by group policy so
SYSTEM user which oracle service is running on "sees" that resource.
Thus, copying files with utl_file.fcopy is no problem.
But I cannot access any copied file with it's application. An MSExcel
file won't open at all. Error message says, network drive wasn't
available or file was write protected. A pdf files is opened by Adobe
Reader but showing empty pages (in correct number, by the way).
Network drive is available and, as far as I can see, there is no lock
on any file. Original files open without problems.

Do you have any ideas on where to to closer examination?

Regards
Claus.

Reply With Quote
  #2  
Old   
DA Morgan
 
Posts: n/a

Default Re: Accessing files copied by UTL_FILE.FCOPY - 09-29-2008 , 10:14 AM






Claus wrote:
Quote:
Hi folks,

I'm running into a strange (at least to me) problem. I have
implemented a small document management system into an existing
Oracle10g database application. DMS requires copying files from one
folder to another. Physical files (originals as well as copies) are
located on a mapped resource. This drive is mapped by group policy so
SYSTEM user which oracle service is running on "sees" that resource.
Thus, copying files with utl_file.fcopy is no problem.
But I cannot access any copied file with it's application. An MSExcel
file won't open at all. Error message says, network drive wasn't
available or file was write protected. A pdf files is opened by Adobe
Reader but showing empty pages (in correct number, by the way).
Network drive is available and, as far as I can see, there is no lock
on any file. Original files open without problems.

Do you have any ideas on where to to closer examination?

Regards
Claus.
No idea where to look but a lot of questions:

1. What operating system?
2. How are drives mapped?
3. Is the file size being changed by the copying?
4. Why are you doing this at all rather than storing the docs as a BLOB?

I have no problem, with the code here:
http://www.psoug.org/reference/securefiles.html
(scroll down to .mpg)
storing docs and restoring them on demand in perfectly usable form.
Similar code is available in all currently supported versions.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #3  
Old   
DA Morgan
 
Posts: n/a

Default Re: Accessing files copied by UTL_FILE.FCOPY - 09-29-2008 , 10:14 AM



Claus wrote:
Quote:
Hi folks,

I'm running into a strange (at least to me) problem. I have
implemented a small document management system into an existing
Oracle10g database application. DMS requires copying files from one
folder to another. Physical files (originals as well as copies) are
located on a mapped resource. This drive is mapped by group policy so
SYSTEM user which oracle service is running on "sees" that resource.
Thus, copying files with utl_file.fcopy is no problem.
But I cannot access any copied file with it's application. An MSExcel
file won't open at all. Error message says, network drive wasn't
available or file was write protected. A pdf files is opened by Adobe
Reader but showing empty pages (in correct number, by the way).
Network drive is available and, as far as I can see, there is no lock
on any file. Original files open without problems.

Do you have any ideas on where to to closer examination?

Regards
Claus.
No idea where to look but a lot of questions:

1. What operating system?
2. How are drives mapped?
3. Is the file size being changed by the copying?
4. Why are you doing this at all rather than storing the docs as a BLOB?

I have no problem, with the code here:
http://www.psoug.org/reference/securefiles.html
(scroll down to .mpg)
storing docs and restoring them on demand in perfectly usable form.
Similar code is available in all currently supported versions.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #4  
Old   
DA Morgan
 
Posts: n/a

Default Re: Accessing files copied by UTL_FILE.FCOPY - 09-29-2008 , 10:14 AM



Claus wrote:
Quote:
Hi folks,

I'm running into a strange (at least to me) problem. I have
implemented a small document management system into an existing
Oracle10g database application. DMS requires copying files from one
folder to another. Physical files (originals as well as copies) are
located on a mapped resource. This drive is mapped by group policy so
SYSTEM user which oracle service is running on "sees" that resource.
Thus, copying files with utl_file.fcopy is no problem.
But I cannot access any copied file with it's application. An MSExcel
file won't open at all. Error message says, network drive wasn't
available or file was write protected. A pdf files is opened by Adobe
Reader but showing empty pages (in correct number, by the way).
Network drive is available and, as far as I can see, there is no lock
on any file. Original files open without problems.

Do you have any ideas on where to to closer examination?

Regards
Claus.
No idea where to look but a lot of questions:

1. What operating system?
2. How are drives mapped?
3. Is the file size being changed by the copying?
4. Why are you doing this at all rather than storing the docs as a BLOB?

I have no problem, with the code here:
http://www.psoug.org/reference/securefiles.html
(scroll down to .mpg)
storing docs and restoring them on demand in perfectly usable form.
Similar code is available in all currently supported versions.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #5  
Old   
DA Morgan
 
Posts: n/a

Default Re: Accessing files copied by UTL_FILE.FCOPY - 09-29-2008 , 10:14 AM



Claus wrote:
Quote:
Hi folks,

I'm running into a strange (at least to me) problem. I have
implemented a small document management system into an existing
Oracle10g database application. DMS requires copying files from one
folder to another. Physical files (originals as well as copies) are
located on a mapped resource. This drive is mapped by group policy so
SYSTEM user which oracle service is running on "sees" that resource.
Thus, copying files with utl_file.fcopy is no problem.
But I cannot access any copied file with it's application. An MSExcel
file won't open at all. Error message says, network drive wasn't
available or file was write protected. A pdf files is opened by Adobe
Reader but showing empty pages (in correct number, by the way).
Network drive is available and, as far as I can see, there is no lock
on any file. Original files open without problems.

Do you have any ideas on where to to closer examination?

Regards
Claus.
No idea where to look but a lot of questions:

1. What operating system?
2. How are drives mapped?
3. Is the file size being changed by the copying?
4. Why are you doing this at all rather than storing the docs as a BLOB?

I have no problem, with the code here:
http://www.psoug.org/reference/securefiles.html
(scroll down to .mpg)
storing docs and restoring them on demand in perfectly usable form.
Similar code is available in all currently supported versions.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #6  
Old   
Mark D Powell
 
Posts: n/a

Default Re: Accessing files copied by UTL_FILE.FCOPY - 09-29-2008 , 11:38 AM



On Sep 29, 11:14*am, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Quote:
Claus wrote:
Hi folks,

I'm running into a strange (at least to me) problem. I have
implemented a small document management system into an existing
Oracle10g database application. DMS requires copying files from one
folder to another. Physical files (originals as well as copies) are
located on a mapped resource. This drive is mapped by group policy so
SYSTEM user which oracle service is running on "sees" that resource.
Thus, copying files with utl_file.fcopy is no problem.
But I cannot access any copied file with it's application. An MSExcel
file won't open at all. Error message says, network drive wasn't
available or file was write protected. A pdf files is opened by Adobe
Reader but showing empty pages (in correct number, by the way).
Network drive is available and, as far as I can see, there is no lock
on any file. Original files open without problems.

Do you have any ideas on where to to closer examination?

Regards
Claus.

No idea where to look but a lot of questions:

1. What operating system?
2. How are drives mapped?
3. Is the file size being changed by the copying?
4. Why are you doing this at all rather than storing the docs as a BLOB?

I have no problem, with the code here:http://www.psoug.org/reference/securefiles.html
(scroll down to .mpg)
storing docs and restoring them on demand in perfectly usable form.
Similar code is available in all currently supported versions.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text -

- Show quoted text -
Claus, I found the following in the 10gR2 Oracle PL/SQL Packages and
Types Reference:

Quote:
With the UTL_FILE package, PL/SQL programs can read and write
operating system text files. UTL_FILE provides a restricted version of
operating system stream file I/O.
<<

An Excel file is not an OS text file so I think using it might be the
cause of your file corruption.

I have not used it but if you are on 10g+ look up the
dbms_file_transfer package which while added to Oracle to support
moving files into and out of ASM states it can copy from OS directory
to OS directory.
Quote:
provides procedures to copy a binary file within a database or to
transfer a binary file between databases
<<

I have not used this routine so I do not know if it will work for you
but thought I would mention it.

Depending on your application, your Oracle version, and your platform
you might just want to use OS commands to copy your files.

HTH -- Mark D Powell --


Reply With Quote
  #7  
Old   
Mark D Powell
 
Posts: n/a

Default Re: Accessing files copied by UTL_FILE.FCOPY - 09-29-2008 , 11:38 AM



On Sep 29, 11:14*am, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Quote:
Claus wrote:
Hi folks,

I'm running into a strange (at least to me) problem. I have
implemented a small document management system into an existing
Oracle10g database application. DMS requires copying files from one
folder to another. Physical files (originals as well as copies) are
located on a mapped resource. This drive is mapped by group policy so
SYSTEM user which oracle service is running on "sees" that resource.
Thus, copying files with utl_file.fcopy is no problem.
But I cannot access any copied file with it's application. An MSExcel
file won't open at all. Error message says, network drive wasn't
available or file was write protected. A pdf files is opened by Adobe
Reader but showing empty pages (in correct number, by the way).
Network drive is available and, as far as I can see, there is no lock
on any file. Original files open without problems.

Do you have any ideas on where to to closer examination?

Regards
Claus.

No idea where to look but a lot of questions:

1. What operating system?
2. How are drives mapped?
3. Is the file size being changed by the copying?
4. Why are you doing this at all rather than storing the docs as a BLOB?

I have no problem, with the code here:http://www.psoug.org/reference/securefiles.html
(scroll down to .mpg)
storing docs and restoring them on demand in perfectly usable form.
Similar code is available in all currently supported versions.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text -

- Show quoted text -
Claus, I found the following in the 10gR2 Oracle PL/SQL Packages and
Types Reference:

Quote:
With the UTL_FILE package, PL/SQL programs can read and write
operating system text files. UTL_FILE provides a restricted version of
operating system stream file I/O.
<<

An Excel file is not an OS text file so I think using it might be the
cause of your file corruption.

I have not used it but if you are on 10g+ look up the
dbms_file_transfer package which while added to Oracle to support
moving files into and out of ASM states it can copy from OS directory
to OS directory.
Quote:
provides procedures to copy a binary file within a database or to
transfer a binary file between databases
<<

I have not used this routine so I do not know if it will work for you
but thought I would mention it.

Depending on your application, your Oracle version, and your platform
you might just want to use OS commands to copy your files.

HTH -- Mark D Powell --


Reply With Quote
  #8  
Old   
Mark D Powell
 
Posts: n/a

Default Re: Accessing files copied by UTL_FILE.FCOPY - 09-29-2008 , 11:38 AM



On Sep 29, 11:14*am, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Quote:
Claus wrote:
Hi folks,

I'm running into a strange (at least to me) problem. I have
implemented a small document management system into an existing
Oracle10g database application. DMS requires copying files from one
folder to another. Physical files (originals as well as copies) are
located on a mapped resource. This drive is mapped by group policy so
SYSTEM user which oracle service is running on "sees" that resource.
Thus, copying files with utl_file.fcopy is no problem.
But I cannot access any copied file with it's application. An MSExcel
file won't open at all. Error message says, network drive wasn't
available or file was write protected. A pdf files is opened by Adobe
Reader but showing empty pages (in correct number, by the way).
Network drive is available and, as far as I can see, there is no lock
on any file. Original files open without problems.

Do you have any ideas on where to to closer examination?

Regards
Claus.

No idea where to look but a lot of questions:

1. What operating system?
2. How are drives mapped?
3. Is the file size being changed by the copying?
4. Why are you doing this at all rather than storing the docs as a BLOB?

I have no problem, with the code here:http://www.psoug.org/reference/securefiles.html
(scroll down to .mpg)
storing docs and restoring them on demand in perfectly usable form.
Similar code is available in all currently supported versions.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text -

- Show quoted text -
Claus, I found the following in the 10gR2 Oracle PL/SQL Packages and
Types Reference:

Quote:
With the UTL_FILE package, PL/SQL programs can read and write
operating system text files. UTL_FILE provides a restricted version of
operating system stream file I/O.
<<

An Excel file is not an OS text file so I think using it might be the
cause of your file corruption.

I have not used it but if you are on 10g+ look up the
dbms_file_transfer package which while added to Oracle to support
moving files into and out of ASM states it can copy from OS directory
to OS directory.
Quote:
provides procedures to copy a binary file within a database or to
transfer a binary file between databases
<<

I have not used this routine so I do not know if it will work for you
but thought I would mention it.

Depending on your application, your Oracle version, and your platform
you might just want to use OS commands to copy your files.

HTH -- Mark D Powell --


Reply With Quote
  #9  
Old   
Mark D Powell
 
Posts: n/a

Default Re: Accessing files copied by UTL_FILE.FCOPY - 09-29-2008 , 11:38 AM



On Sep 29, 11:14*am, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Quote:
Claus wrote:
Hi folks,

I'm running into a strange (at least to me) problem. I have
implemented a small document management system into an existing
Oracle10g database application. DMS requires copying files from one
folder to another. Physical files (originals as well as copies) are
located on a mapped resource. This drive is mapped by group policy so
SYSTEM user which oracle service is running on "sees" that resource.
Thus, copying files with utl_file.fcopy is no problem.
But I cannot access any copied file with it's application. An MSExcel
file won't open at all. Error message says, network drive wasn't
available or file was write protected. A pdf files is opened by Adobe
Reader but showing empty pages (in correct number, by the way).
Network drive is available and, as far as I can see, there is no lock
on any file. Original files open without problems.

Do you have any ideas on where to to closer examination?

Regards
Claus.

No idea where to look but a lot of questions:

1. What operating system?
2. How are drives mapped?
3. Is the file size being changed by the copying?
4. Why are you doing this at all rather than storing the docs as a BLOB?

I have no problem, with the code here:http://www.psoug.org/reference/securefiles.html
(scroll down to .mpg)
storing docs and restoring them on demand in perfectly usable form.
Similar code is available in all currently supported versions.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text -

- Show quoted text -
Claus, I found the following in the 10gR2 Oracle PL/SQL Packages and
Types Reference:

Quote:
With the UTL_FILE package, PL/SQL programs can read and write
operating system text files. UTL_FILE provides a restricted version of
operating system stream file I/O.
<<

An Excel file is not an OS text file so I think using it might be the
cause of your file corruption.

I have not used it but if you are on 10g+ look up the
dbms_file_transfer package which while added to Oracle to support
moving files into and out of ASM states it can copy from OS directory
to OS directory.
Quote:
provides procedures to copy a binary file within a database or to
transfer a binary file between databases
<<

I have not used this routine so I do not know if it will work for you
but thought I would mention it.

Depending on your application, your Oracle version, and your platform
you might just want to use OS commands to copy your files.

HTH -- Mark D Powell --


Reply With Quote
  #10  
Old   
Claus
 
Posts: n/a

Default Re: Accessing files copied by UTL_FILE.FCOPY - 09-29-2008 , 12:04 PM



Thanks to both of you. Your answers were extremely helpful. Seems, I
have to rewrite a bit... :-/

Regards
Claus.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.