Applies to:
Oracle Database - Enterprise Edition - Version 12.1.0.2 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.
Symptoms
In an Oracle SIHA (Oracle Restart) environment, external executable jobs are failing with:
Errors in file /u01/app/oracle/diag/rdbms/orcl/ORCL/trace/ORCL_j000_28299.trc:
ORA-12012: error on auto execute of job "SYS"."MY_EXE_JOB"
ORA-27369: job of type EXECUTABLE failed with exit code: Permission denied
Changes
None
Cause
The oraagent on Oracle Restart systems is owned by the GI Software owner which is why you are seeing the OS User for the DB background processes as grid. This is by design on SIHA Systems (Oracle Restart) in order to reduce the number of processes in turn reducing the overhead of the processes. In a GI for a Cluster environment, each DB install owner would get its own oraagent process that is owned by that user which is why we do not see this behavior in RAC.
OS User for Background Processes when the database is started via SRVCTL (as the DB software owner):
SQL> select osuser from v$session where type='BACKGROUND';
OSUSER
------------------------------
grid
grid
grid
. . .
OS User for Background Processes when the database is started via SQLPLUS (as the DB software owner):
SQL> select osuser from v$session where type='BACKGROUND';
OSUSER
------------------------------
oracle
oracle
oracle
. . .
Solution
In a role separated SIHA (Restart) environment you must configure the scheduler job to utilize credentials to allow the Job to run as the DB Software owner. The steps to do so are as follows:
1. Create the credential for the oracle OS user:
begin
dbms_scheduler.create_credential(
credential_name => 'ORACLE_CRED',
username => 'oracle',
password => '');
end;
/
2. Modify the job to make use of the credentials created in step 1:
begin
dbms_scheduler.set_attribute
(
NAME => 'MY_EXE_JOB',
ATTRIBUTE => 'CREDENTIAL_NAME',
VALUE => 'ORACLE_CRED'
);
end;
/
If you want to do this at the time of job creation, the PL/SQL block would be:
begin
dbms_scheduler.create_job
(
job_name => 'MY_EXE_JOB',
program_name => 'MY_EXE_PROG',
schedule_name => 'MY_EXE_JOB_SCHEDULE',
credential_name => 'ORACLE_CRED',
comments => 'Run MY_EXE_JOB',
enabled => TRUE
);
end;
/
References
NOTE:279866.1 - DBMS_SCHEDULER FAILS WITH ORA-27369 WHEN JOB TYPE IS EXECUTABLE
NOTE:1953432.1 - Processes Started With srvctl does not Inherit Secondary Group Modifications
BUG:22477962 - INCORRECT MEMLOCK SETTING USED IN GI STANDALONE
BUG:13442441 - DATABASE PROCESSES OWNED BY GRID USER IN GI STANDALONE SERVER
BUG:13503874 - WRONG OWNER FOR DATABASE PROCESS
NOTE:166650.1 - Working Effectively With Oracle Support - Best Practices
NOTE:1473610.1 - Background Processes Ownership When Registering Database With Oracle Restart
NOTE:961019.1 - DBMS_SCHEDULER Extjob Fails With "Login Executable Not Setuid-Root"