As this is a .BAT file (at least, that's what I understood), you can run it from the operating system command prompt. I suggest you to do it:
- drop the user
- start your "data cut" operation
- run the .bat manually and see the message you got - should be
ORA-01017: invalid username/password; logon denied
- once loading is done, recreate the user
- run the .bat manually again and observe the message you get now. Which one is it?
Make sure that .bat doesn't exit the command prompt session (either comment the EXIT
command, or put PAUSE
at the end of the script).
However, why are you dropping the user? Isn't that a little bit too much? You have to not only create it, but grant all privileges it had before. Are you sure you perform that step too? Depending on what that user does, there might be different privileges granted to it, as well as privileges that user grants to other users. Mind database links etc.
Why don't you simply revoke create session
from that user? The effect (regarding your .bat script) will be just the same - it won't be able to establish connection). Once you're done, grant that privilege back.