Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01031: insufficient privilege while running a batch job

757840Jul 27 2012 — edited Jul 27 2012
Hi Gurus...
I have created a oracle scheduler job to run a batch file (On WS2k8, Oracle 11.2.0.1) as

BEGIN
sys.dbms_scheduler.create_job(

job_name => 'MY_JOB',

job_type => 'EXECUTABLE',

job_action => 'C:\WINDOWS\system32\cmd.exe',

repeat_interval => 'FREQ=MINUTELY; interval=30; bysecond=0;',

start_date => systimestamp,

job_class => 'DEFAULT_JOB_CLASS',

comments => 'This Job Collect Statas as per Analyze.bat',

auto_drop => FALSE,

number_of_arguments => 3,

enabled => FALSE);

sys.dbms_scheduler.set_job_argument_value( job_name => 'MY_JOB', argument_position => 1, argument_value => '/q');

sys.dbms_scheduler.set_job_argument_value( job_name => 'MY_JOB', argument_position => 2, argument_value => '/c');

sys.dbms_scheduler.set_job_argument_value( job_name => 'MY_JOB', argument_position => 3, argument_value => 'D:\analyze.bat >> d:\as.txt');

sys.dbms_scheduler.enable( 'MY_JOB' );

END;
/

#########################################################################################################
REM batch file.....

set ORACLE_HOME=D:\Oracle\Ora11g
echo %ORACLE_HOME%
cd /d %ORACLE_HOME%\BIN
sqlplus /@ORCL as sysdba
EXIT

this pops up an error ORA-01031: insufficient privilege.........
I am running this job as SYSDBA..What could be the problem
Moreover when i run this bat file from CMD, its go very smoothly

Thanks
Sunil

Edited by: user9276229 on 27 Jul, 2012 5:12 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 24 2012
Added on Jul 27 2012
0 comments
478 views