The first thing I'd do is to explicitly code your environment variables in your backup script. So the first thing I'd have the script do is as follows:
set ORACLE_SID=my_db set ORACLE_HOME=c:oracleora92
Make sure to substitute correct values for your environment.
The ORA-12640 error in Windows environment most often means that your connection request to the database cannot find the database because it does not have the correct environment variables. When you run the batch program from your Windows session, it inherits any environment variables defined for your user. But running batch programs is a little different. The above lines should fix your problem.
You might also want to make sure that you schedule this job as a user
in the oradba group.
This was first published in April 2004