Skip to Main Content
  • Questions
  • Error in job of type: executable (window ) (express edition)

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Tony Brandon Rojas.

Asked: July 07, 2024 - 5:48 pm UTC

Last updated: July 22, 2024 - 12:46 pm UTC

Version: ORACLE DATABASE 21C

Viewed 1000+ times

You Asked

I HAVE "Windows 11 Home Single Language". DEVICE NAME: Laptopnum02. NO PASSWORD FOR MY ACCOUNT.

1.CREATE A TEST *.CMD FILE . CREATE A *.TXT THEN CHANGED THE EXTENSION TO: *.CMD THIS MAKES THE *.CMD CALLED: creararchivo.cmd

@echo off
echo Este es el contenido del archivo creado por demo.cmd. > archivo_creado.txt
echo Segunda línea en el archivo creado. >> archivo_creado.txt
echo Tercera línea en el archivo creado. >> archivo_creado.txt

I DISABLED MY ANTIVIRUS (AVAST)

CREATE CREDENTIALS IN sqldeveloper

BEGIN
  DBMS_SCHEDULER.CREATE_CREDENTIAL (
    credential_name => 'CREDENCIAL_PRUEBA',
    username => 'TONYROJAS',
    password => 'ABC',
    windows_domain => 'SYSTEM'
  );
END;
CREATE JOB
BEGIN
  DBMS_SCHEDULER.create_job (
    job_name        => 'PRUEBA',
    job_type        => 'EXECUTABLE',
    job_action      => 'C:\WINDOWS\SYSTEM32\CMD.EXE',
    number_of_arguments => 2,
    start_date      => SYSTIMESTAMP,
    repeat_interval => 'FREQ=DAILY; BYHOUR=23',
    enabled         => FALSE,
    auto_drop       => FALSE,
    comments        => 'Job para realizar backup diario'
  );
  -- EJECUTAR COMANDOS DENTRO DEL SIMBOLO DEL SISTEMA
    DBMS_SCHEDULER.set_job_argument_value ('PRUEBA', 1, '/C');
    DBMS_SCHEDULER.set_job_argument_value ('PRUEBA', 2, 'C:\BackupOracle\creararchivo.cmd');
  **  DBMS_SCHEDULER.set_attribute('PRUEBA', 'credential_name', 'CREDENCIAL_PRUEBA');**
    DBMS_SCHEDULER.enable('PRUEBA'); `
END;
EXECUTE JOB BEGIN DBMS_SCHEDULER.run_job('PRUEBA'); END;

ERROR:

Bug Report -
ORA-27369: job of type EXECUTABLE failed with exit code: 7 Invalid username or password
ORA-06512: in "SYS.DBMS_ISCHED", line 241
ORA-06512: in "SYS.DBMS_SCHEDULER", line 566
Also, when I delete the JOB credential: DELETE THIS PART: DBMS_SCHEDULER.set_attribute('PRUEBA', 'credential_name', 'CREDENCIAL_PRUEBA');


And run it again, I get the following error:

Bug Report -
ORA-27369: job of type EXECUTABLE failed with exit code: 1 Access Denied.
Access denied.
Access denied.

I would like to understand both errors and how to solve it please.

with LiveSQL Test Case:

and Chris said...

The first error is because the username/password are invalid. You'll need to find these and set them appropriately.

Access denied means the database is unable to reach the script. Ensure the user that the Oracle Database service runs as is able to run the script.

A couple of general points:

- DBMS_SCHEDULER.CREATE_CREDENTIAL has been deprecated (since 12.1) in favour of DBMS_CREDENTIAL.CREATE_CREDENTIAL. You should use this instead (it has no bearing figuring out the username/password, though)

- Oracle Database 23ai Free is now available. As you're on Express Edition I recommend moving to this if possible

https://www.oracle.com/database/free

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thanks, the current error is "Cannot forcé process"

A reader, July 19, 2024 - 5:06 pm UTC

Thank you very much, I configured the credentials with those of my laptop, then I gave it all the permissions. But it worked only once, now I get "You can't forcé the process." Could you help me please?
Chris Saxon
July 22, 2024 - 12:46 pm UTC

What gives you that error?

More to Explore

Security

All of the vital components for a secure database are covered in the Security guide.