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.
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