ORA-27451: CREDENTIAL_NAME cannot be NULL

ORA-27451: CREDENTIAL_NAME cannot be NULL

Error
ORA-27451: CREDENTIAL_NAME cannot be NULL

BEGIN
dbms_scheduler.create_job(
job_name => 'Full_Backup'
,job_type => 'backup_script'
,job_action => 'C:\script\rmanbackup.rman'
--,credential_name => 'Windowuser'
,start_date => SYSDATE +1/24/59
,repeat_interval => 'FREQ=DAILY; BYHOUR=9; BYMINUTE=38;'
,enabled => TRUE
,comments => 'Full DB BACKUP'
);
END;
/
PL/SQL procedure successfully completed
SQL> Exec dbms_scheduler.run_job(job_name => 'FULL_BACKUP');
BEGIN dbms_scheduler.run_job(job_name => 'FULL_BACKUP'); END;
*
ERROR at line 1:
ORA-27451: CREDENTIAL_NAME cannot be NULL
ORA-06512: at "SYS.DBMS_ISCHED", line 238
ORA-06512: at "SYS.DBMS_SCHEDULER", line 568
ORA-06512: at line 1

Solution
You need to provide the credential_name value in the DBMS_SCHEDULER package.
In My package, i commented the credential name that why during running it is giving me the error:

1. Fetch the definition of the scheduler package. Check Credential value.

col job_name for a10
col owner for a10
col job_action for a50
col credential_name for a30
select owner,job_name,job_action,credential_name from dba_scheduler_jobs where job_name like 'FULL%';


---Get the DDL of DBMS scheduler package:
SELECT DBMS_METADATA.get_ddl('PROCOBJ','FULL_BACKUP', 'SCOTT') AS JOB_DDL FROM dual;

2. Update the credential name parameter of job which is null.

BEGIN
DBMS_SCHEDULER.SET_ATTRIBUTE (
name => 'Full_Backup',
attribute => 'credential_name',
value => 'Windowuser');
END;
/

For creating credential and update it, Please follow the link:Use of DBMS_CREDENTIAL Package in Oracle

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.