I have following batch script:

copy \\remotehost.ip\c$\dumps\TEST_%date%.dmp C:\dumps\TEST_%date%.dmp

sqlplus sys/password as SYSDBA  @C:\dumps\recreate_test.sql > C:\dumps\recreate_test.log

timeout /t 10

impdp system/password@sid schemas=TEST,TEST_VIEW directory=dumps_dir dumpfile=TEST_%date%.dmp logfile=impdpTEST_%date%.log

It copy sql dmp file from remote host in the same network. Then run script that recreate users in database:

shutdown immediate;
startup restrict;

drop user TEST cascade;
drop user TEST_VIEW cascade;

create user TEST identified by password;
create user TEST_VIEW identified by password;

grant all privileges to TEST;
grant all privileges to TEST_VIEW;

EXEC DBMS_UTILITY.compile_schema(schema => 'TEST');
EXEC DBMS_UTILITY.compile_schema(schema => 'TEST_VIEW');

shutdown immediate;


Then run import script. All this SQL have got log files and it seems everything runs good. I have got some errors during import, but they just told me that user already exists (ORA-31684) and import everything in this existing user and also got ORA-39082 error, which was meant to be fixed with DBMS_UTILITY (yes, I see my error here, but it's not the point) later.

I run it with highest privileges. System administrator allowed me to check option Run whether user is logged on or not and option Do not store password. It has 0x5 code even if I run task manually selecting Run from dropdown menu in Task Scheduler.

Why my task ends with 0x5 error code if everything runs good? I've seen logs, they're good.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.