The process cannot access the file

Hi there

I have a very strange issue - I have V3 /V4 and v5.6 on different machines.
I have an automation script which worked fine exporting data from view in an Oracle database.
1 of the 4 exports started failing - so i decided to clone the process on another machine.
Now the failure only occurs when i's invoked by windows scheduler or via a bat file, but when run from Toad environment, it works fine.

As for testing on V5.6, I tried to change the query from a view to querying a table and still it fails via the scheduler but works fine when invoked directly.

I even deleted the file and then tried this and still get the same error "The process cannot access the file "c:users~".
Changing the path does not seem to make any difference at all.

Any ideas?

Ash

I have seen this before, and one reason (there might be others) is that the user/process running the automation doesn't have privs to write to certain disk locations... Does writing the export file to your MyDocuments help?

I tried this and still no joy. I have other modules that run fin in the same TAS file - just this one.

the one thing that I did notice was I had a line of code to overcome the 'not a valid month' error

alter session set NLS_DATE_FORMAT='dd/mm/yyyy hh24:mi:ss';

SELECT * FROM V_WEEKLY_ETH_SOM_OP_DATA;

so I simply changed the view to an M View and removed the NLS setting - like this :

alter session set NLS_DATE_FORMAT='dd/mm/yyyy hh24:mi:ss';

SELECT * FROM MV_WEEKLY_ETH_SOM_OP_DATA;

which now works

It's still beyond me that I can run the export module with any other view (same range of columns)
but only fails with this view and related table :confused:

Well so far I managed a workaround but hope this workaround doesn't let me down.

1 Like

further update
I have 4 export modules
All are querying a view with the NLS setting to avoid the 'not a valid month' issue

So if I run it the Toad environment - no issues

if I run via scheduler, I get the issues

I replaced one of the views with and MV and the next export module in line which worked fine before now comes up with the same error as 'file being used by another process'

So it seems that I now need to create 4 x MVs in place of a view, remove the NLS setting as don't need this - Here's hoping

Wow, what a journey... keep us posted on progress/success... and... crossing fingers for ya....