Q: Impact of use_current_session parameter of dbms_scheduler.run_job
On the 11g db that I have access to, I'm seeing different systimestamp value while running plsql block using
dbms_scheduler.run_job with use_current_session = true and false.
My job looks like following.
dbms_scheduler.create_job(
job_name => 'tk2timestamp_test',
job_type => 'PLSQL_BLOCK',
job_action => 'begin insert into tktest values (systimestamp, to_char(sysdate, ''DD-MON-YYYY HH24:MI:SS''), current_timestamp, localtimestamp, dbtimezone, sessiontimezone); end;',
enabled => true,
auto_drop => false);
I see that UTC time was returned as systimestamp if it is called with true and PST if it is called with false.
In the same session, I get following result with select statement.
select systimestamp, current_timestamp, localtimestamp, dbtimezone, sessiontimezone from dual;
SYSTIMESTAMP CURRENT_TIMESTAMP LOCALTIMESTAMP DBTIMEZONE SESSIONTIM
27-MAR-13 04.05.59.914647 PM +00:00 27-MAR-13 09.05.59.914650 AM -07:00 27-MAR-13 09.05.59.914650 AM +00:00 -07:00
Can any one let me know why this is happening? Why systimestamp value is not PST if use_current_session = true?
Thank you again for your response.
I've got following result.
SQL> SELECT SYSTIMESTAMP FROM dual;
SYSTIMESTAMP
28-MAR-13 07.13.08.556079 PM +00:00
SQL> SELECT SYSTIMESTAMP AT TIME ZONE 'PDB' FROM dual;
SELECT SYSTIMESTAMP AT TIME ZONE 'PDB' FROM dual
ERROR at line 1:
ORA-01882: timezone region not found
SQL> SELECT SESSIONTIMEZONE,CURRENT_TIMESTAMP, LOCALTIMESTAMP FROM dual;
SESSIONTIM CURRENT_TIMESTAMP LOCALTIMESTAMP
-07:00 28-MAR-13 12.13.41.196653 PM -07:00 28-MAR-13 12.13.41.196653 PM
BTW, I have two instances returns the result like this if this information helps.
I've created following table in order to help proving something is changing whether I pass true or false to use_current_session parameter when calling dbms_scheduler.run_job.
create table tktest (tksystimestamp timestamp(6), tktocharsysdate varchar2(100), tkcurrent_timestamp timestamp(6), tklocaltimestamp timestamp(6), tldbtimezone varchar2(100), tksessiontimezone varchar2(100));
Then I created job as following. This job inserts systimestamp,sysdate,current_timestamp,localtimestamp,dbtimezone, and sessiontimezone to above table.
begin
dbms_scheduler.create_job(
job_name => 'tk2timestamp_test',
job_type => 'PLSQL_BLOCK',
job_action => 'begin insert into tktest values (systimestamp, to_char(sysdate, ''DD-MON-YYYY HH24:MI:SS''), current_timestamp, localtimestamp, dbtimezone, sessiontimezone); end;',
enabled => true,
auto_drop => false);
exception
when others then
null;
end;
Run the job using run_job procedure.
exec dbms_scheduler.run_job(job_name => 'tk2timestamp_test',use_current_session => true);
Above inserts following record in tktest.
SYSTIMESTAMP SYSDATE CURRENT_TIMESTAMP LOCALTIMESTAMP DBTZ SESSIONTZ
28-MAR-13 07.04.58.227616 PM 28-MAR-2013 19:04:58 28-MAR-13 07.04.58.227617 PM 28-MAR-13 07.04.58.227617 PM +00:00 +00:00
Run the job using run_job procedure again but use 'use_current_session => false' this time.
Above inserts following record in tktest.
SYSTIMESTAMP SYSDATE CURRENT_TIMESTAMP LOCALTIMESTAMP DBTZ SESSIONTZ
28-MAR-13 12.05.24.150817 PM 28-MAR-2013 12:05:24 28-MAR-13 12.05.24.150819 PM 28-MAR-13 12.05.24.150819 PM +00:00 -07:00
I also run following from the same session.
SQL> select systimestamp, current_timestamp, localtimestamp, dbtimezone, sessiontimezone from dual;
SYSTIMESTAMP CURRENT_TIMESTAMP LOCALTIMESTAMP DBTZ SESSIONTZ
28-MAR-13 07.05.40.640499 PM +00:00 28-MAR-13 12.05.40.640503 PM -07:00 28-MAR-13 12.05.40.640503 PM +00:00 -07:00
So why executing dbms_scheduler.run_job with 'use_current_session => false' causes SEESSIONTIMEZONE to be PST8PDT?
I have an another instance pointing all the time based on UTC and my question is why only above instance is showing result like above and what causes it.
thx.
Similar Messages
-
Dbms_scheduler.run_job doesn't work
Hi,
We are currently using dbms_scheduler to execute linux system command. It works all fine before I update our database from 10.2.0.3 to 10.2.0.4. Now if we choose dbms_scheduler.run_job with parameter use_current_session => true, the following error occurs:
ORA-27370: job slave failed to launch a job of type EXECUTABLE ORA-27300: OS system dependent operation:getting external job pid failed with status: 2 ORA-27301: OS failure message: No such file or directory ORA-27302: failure occurred at: sjsec 6a
While we change use_current_session => false, everything works again.
As a result, we have to drop the job with force => true. Then the job details are not listed in view all_scheduler_job_run_details. wow, it seems like a bomb chain. Now everything need to be done in different way. Does anyone know why it will come and how to fix it?
Regards,
LikHi Lik and Ravi,
I'm in a similar situation but haven't managed to get it fixed.
Lik, what exactly did you do to the $ORACLE_HOME/bin dir to get it working again?
I've recently upgraded to 10.2.0.4 from 10.2.0.2 on Linux and I'm hitting problems running jobs.
Oracle is the os user executing the job.
My permissions on the three files you mention to check look ok:
-rwsr-x--- 1 root oinstall 64258 2008-06-17 10:45 /opt/app/oracle/product/10.2.0/db_1/bin/extjob
-rwxr-xr-x 1 oracle oinstall 64258 2008-06-17 10:45 /opt/app/oracle/product/10.2.0/db_1/bin/extjobo
-rw-r--r-- 1 root oinstall 1534 2005-12-22 13:39 /opt/app/oracle/product/10.2.0/db_1/rdbms/admin/externaljob.ora
THe Oracle bin dir has execute permissions also:
drwxr-xr-x 2 oracle oinstall 12288 2008-06-18 12:21 bin
I've looked through your guide also, but no luck with the suggestions mentioned there.
I still get this message when I execute the job (oracle is executing it):
ORA-27370: job slave failed to launch a job of type EXECUTABLE
ORA-27300: OS system dependent operation:getting external job pid failed with
status: 2
ORA-27301: OS failure message: No such file or directory
ORA-27302: failure occurred at: sjsec 6a
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 1
Also, if I create a test job, it does execute the script, as I can see that /tmp/testjob.out is created.
-rw-r--r-- 1 nobody nobody 15 2008-06-18 14:01 /tmp/testjob.out
however, I still get the error message from Oracle:
ERROR at line 1:
ORA-27370: job slave failed to launch a job of type EXECUTABLE
ORA-27300: OS system dependent operation:getting external job pid failed with
status: 2
ORA-27301: OS failure message: No such file or directory
ORA-27302: failure occurred at: sjsec 6a
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 1
This is the script:
#!/bin/ksh
echo "THIS IS A TEST" > /tmp/testjob.out
exit 0
Is there anything else I can try?
Thanks,
Owen.
Message was edited by:
owen00 -
Button process with DBMS_SCHEDULER.run_job
Hi,
I need to execute the DBMS_SCHEDULER.run_job on click of a button .
I tried creating a process (On submit) with DBMS_SCHEDULER.run_job('JOBNAME')
when i tried executing directly in db there is no problem, but when i create the process in apex i am running into the following error
ORA-06550: line 2, column 19: PLS-00222: no function with name 'RUN_JOB' exists in this scope ORA-06550: line 2, column 1: PL/SQL: Statement ignored
Anybody have tried this before?? is there a way around or am i getting this wrong?
Thanks,Resolved,
I had to specify the current session state while executing the scheduler job
In my case i made it false
BEGIN
-- Run job synchronously.
DBMS_SCHEDULER.run_job (job_name => 'JobName',
use_current_session => FALSE);
END;
Thanks -
Error While Running DBMS_SCHEDULER.RUN_JOB in Oacle 11g DB in LINUX ENvirnoment
Dear ALL,
I have two separate Server, One is App. Server which is on WINDOWS 2008 and the DB server on LINUX. I'm created a job for Daily logical Backup of Database through EXP command on DB Server.
I have created DBMS_SCHEDULER.CREATE_JOB with JOB_ACTION /home/oracle/wms_dbdmp/auto_backup.sh the Location of .sh file which contain the following code
#!/bin/bash
exp test/test@orcl file=/home/oracle/wms_dbdmp/test.dmp log=/home/oracle/wms_dbdmp/test.log compress=N rows=Y grants=Y owner=(test) statistics=NONE
ECHO "Export done successfully..."
Exit 0
Now i created job successfully, but when i'm invoking this .sh file through DBMS_SCHEDULER>RUN_JOB('backup_01');
I'm facing error which are given as-
ORA-27369: job of type EXECUTABLE failed with exit code: Permission denied
ORA-06512: at "SYS.DBMS_ISCHED", line 185
ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
ORA-06512: at line 1
I did this on WINDOWS Environment Successfully. I'm naive user for LINUX Envirnoment SO Please Guide me to rid off to this problem.
I will be very thank full to all...I wrote the script as
#!/bin/bash
exp test/test@orcl file=/home/oracle/wms_dbdmp/test.dmp log=/home/oracle/wms_dbdmp/test.log compress=N rows=Y grants=Y owner=(test) statistics=NONE
exit 0
But it didn't work through procedure....how to invoke .sh file through db procedure...? -
DBMS_SCHEDULER.RUN_JOB causes scheduled job not to run again
Environment: 10.2.0.2 Linux 64-bit
Hi,
I have some DBMS_SCHEDULER chain jobs scheduled to run every hour which has been running fine with no issues for a while now.
I needed to run a couple of jobs manually in-between scheduled times so I ran the job using DBMS_SCHEDULER.RUN_JOB, and that worked as expected as it has done in the past.
This issue is that the jobs I ran manually haven't run at their scheduled time since I did that. The only way around it was to recreate the job completely.
Any idea if this is normal functionality, or should I be raising this as a possible issue through Oracle Metalink?
Any help or ideas would be much appreciated.
Thanks
TimHi Tim,
This is a known bug which is tracked internally by bug #5705385. It will be fixed in the next patchsets for 10.2 and 11.1 (i.e. 10.2.0.5 and 11.1.0.7) . If you urgently need a fix, an official patch seems to be available for 10.2.0.3 .
There does seem to be a workaround - using run_job again after the first run_job has completed will not do anything but the chain job should again run on schedule.
Hope this helps,
Ravi. -
DBMS_SCHEDULER.run_job problem
Hi friends.I have one problem. I use Oracle 10g(r2) in oracle enter.server. Also I can execute backupdb.sh script from terminal
success.But I created Job sheduler as
BEGIN
DBMS_SCHEDULER.CREATE_JOB
job_name => 'BACKUP_DB_JOB',
job_type => 'EXECUTABLE',
job_action => '/orahome/orastart/./backupdb.sh',
start_date => '13-jan-2010 6:32 PM',
repeat_interval => 'FREQ=DAILY'
END;
although i execute following
begin
DBMS_SCHEDULER.run_job (job_name=>'BACKUP_DB_JOB');
end;
then occur error [1]: (Error): ORA-27369: job of type EXECUTABLE failed with exit code: 274660 ORA-06512: at "SYS.DBMS_ISCHED", line 150 ORA-06512: at "SYS.DBMS_SCHEDULER", line 441 ORA-06512: at line 4
also i see detail information from dba_scheduler_job_run_details.ADDITIONAL_INFO described as
ORA-27369: job of type EXECUTABLE failed with exit code: 274660
STANDARD_ERROR="Oracle Scheduler error: Not running as extjob or extjobo."
there are for extjob following
ls -l $ORACLE_HOME/bin/extjob
-rwsr-x--- 1 root oinstall 64842 Oct 15 06:58 /orahome/oracle/product/10.2.0/db_1/bin/extjob
and
ls -l $ORACLE_HOME/rdbms/admin/externaljob.ora
-rw-rwxr-- 1 640 oinstall 1536 Jan 19 15:08 /orahome/oracle/product/10.2.0/db_1/rdbms/admin/externaljob.ora
why that error happen?See the below forum for solution
Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch files
Hope this helps,
Regards
http://www.oracleracexpert.com
Click here for [Block Corruption and recovery|http://www.oracleracexpert.com/2009/08/block-corruption-and-recovery.html]
Click here for [Redo log corruption and recovery|http://www.oracleracexpert.com/2009/08/redo-log-corruption-and-recovery.html] -
Error In Running dbms_scheduler.run_job ORA-27369 with psexec.
I'm using dbms_scheduler in Oracle 10g on Windows 2008 (32-bit).
A recent application upgrade moved a portion of my work to a Windows 2008 R2 64-bit server.
Becuase of this I had to move some processing to this server.
When the internal processes within the batch files ran locally, everything functioned properly.
However, when I used 'psexec' to run them remotely on the other server, they crashed.
The batch processes work perfectly fine on the OS level. I believe the issue may have something to do with return code, but I'm not sure.
JOB:
BEGIN
DBMS_SCHEDULER.Create_Job(
Job_Name => 'SCENEXPORT',
Job_Action => 'C:\WINDOWS\SYSTEM32\CMD.EXE',
Number_of_Arguments=> 3,
Job_Type => 'EXECUTABLE',
Enabled => false);
DBMS_SCHEDULER.Set_Job_Argument_Value('SCENEXPORT',1,'/q');
DBMS_SCHEDULER.Set_Job_Argument_Value('SCENEXPORT',2,'/c');
DBMS_SCHEDULER.Set_Job_Argument_Value('SCENEXPORT',3,'E:\DBAAdmin\Hastus\PSoft\Test\Hastus\Extract\ScenariosR.bat');
END;
BATCH: (ScenariosR.bat)
psexec \\test236 -u <username> -p <pwd> e:\DBAAdmin\Hastus\PSoft\Test\Hastus\Extract\Scenarios1.bat
ERROR:
ERROR at line 1:
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 2
Anyone else working with 'PSEXEC'?
Any ideas how to work through this issue?
Thanks.
BillI appreciate the attempt. However, it does not address a Windows environment.
In addition, ‘exertnaljob.ora’ does not exist in a Windows 10g install.
If the Windows similar is the Windows Service Oracle JobScheduler, it is already using an admin level account and should not be encountering permissions issues.
So, swing and a miss.
Thanks,
Bill
Additional testing revealed some strange behavior.
When I run it the first time, it fails.
When I run it immediately after the first failure, it fails.
However if I wait about ten minutes, it completes without issue.
SQL> BEGIN
2 DBMS_SCHEDULER.RUN_JOB ('SCENEXPORT');
3 END;
4 /
BEGIN
ERROR at line 1:
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 2
SQL> /
BEGIN
ERROR at line 1:
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 2
SQL> /
PL/SQL procedure successfully completed.
SQL> -
Error In Running dbms_scheduler.run_job ORA-27369.
Dear Sir
I am trying to execute one batch file from one schedule which imports the data using imp command now my files look like this
*****************imp.bat ***************
imp treasury/tisnic@orcl FILE="C:\data\gis031164.dmp" LOG="C:\data\imp_gis031164.log" FULL=Y IGNORE=Y FEEDBACK=1000
*********************job created with bellow code *******************************
begin
DBMS_SCHEDULER.CREATE_JOB (
job_name=> 'myjob',
job_type=> 'EXECUTABLE',
job_action=> 'c:\windows\system32\cmd.exe /c c:\imp.bat',
enabled=> TRUE,
auto_drop=>false,
start_date => sysdate + 9999
commit;
end;
now when i run my job with bellow command
begin
dbms_scheduler.run_job('myjob');
end;
it gives me error as follow
ERROR at line 1:
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
ORA-06512: at "SYS.DBMS_ISCHED", line 148
ORA-06512: at "SYS.DBMS_SCHEDULER", line 374
ORA-06512: at line 2
kindlly help as i have tried all your solutions in so many threads but same issue not finding any solution for my problem
Thanks & Regards
AashishDear sir
Actually my motive is to execute one shell script which imports all datafile (exported .dmp) files stored in specific folder and i need to run that job on my form 10g button click trigger but its not working ..
***********************************Job name : importjob*****************************************
begin
DBMS_SCHEDULER.CREATE_JOB (
job_name=> 'importjob',
job_type=> 'executable',
job_action=> '/u1/datafile/imp.sh',
enabled=> TRUE,
auto_drop=>false
commit;
end;
1. when i tried to run above job with bellow code it gives me error
begin
DBMS_scheduler.run_job('importjob');
end;
" ORA-27369: job of type EXECUTABLE failed with exit code: 255 "
2. but when i tried to excute that shell script directly from server like bellow
$ /u1/datafile/imp.sh
it works fine and do what i want
permission to my shell scrpit and complete datafile (folder) is set to
chmod 777 -R /u1/datafile
chmod 777 -R /u1/datafile/imp.sh
now seniors please kindly help me to get my problem resolved and bellow is me files which i used in complete procedure
***************************file name : imp.sh.env *************************************
source /u/upsegid/dbtreasury.env
for i in `ls *.dmp.gz`
do
echo $i
gunzip $i
done
for i in `ls *.dmp`
do
imp parfile=imp1.par file=$i
echo ' ' >>impall.log
echo $i >> impall.log
echo ' ' >>impall.log
cat imp1.log >> impall.log
mv $i ./u1/backup/
gzip ./u1/backup/$i
done
# Remeber to change dates in vdtfinal.sql and vdtdaily.sql file for Plan Data
# Remeber to change date in vdtfinal.sql and vdtdaily.sql file for deleting previous Month Data From Koshtb
# cd ../sqls/vdt1011
#sqlplus vdt1011/mn1346@treasury @vdtfinal
exit
***************************file name : dbtreasury.env *************************************
ORACLE_BASE=/u/apps; export ORACLE_BASE
ORACLE_HOME=/u/apps; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:/bin:.;export PATH
ORACLE_SID=orcl; export ORACLE_SID
TERM=treasury; export TERM
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_LANG=AMERICAN; export NLS_LANG
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data; export ORA_NLS33
ORACLE_PATH=$PATH:$ORACLE_HOME/bin; export ORACLE_PATH
LD_LIBRARY_PATH=$PATH:$ORACLE_HOME/lib:/usr/lib:/lib:.;export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
#DISPLAY=apps:0.0; export DISPLAY
TMPDIR=/tmp; export TMPDIR
TMP=/tmp; export TMP
TEMP=/tmp; export TEMP
TEMPDIR=/tmp; export TEMPDIR
Now sir kindly help me what and were i am doing wrong because i need to done this any how -
Impact of COMAPTIBLE parameter on database
My database version is 10.2.0.4.0 and COMPATIBLE parameter value is 9.2.0.1, When run one select query its shows error
ORA-01652: unable to extend temp segment by 64 in tablespace TEMPTBS2.
But while try to run the same query on database version 10.2.0.4.0 with COMPATIBLE parameter value =10.2.0.3.0, it runs without any error.
Size of tablespace-TEMPTBS2 is same on both database.But Execution plan is differ in both database.
Is it the impact of COMAPTIBLE parameter ?
Edited by: user10540254 on Nov 5, 2008 4:38 AMHi,
COMPATIBLE controls the behaviour of interfaces, the available features and specific parameter settings (for instance for the optimizer).
Example 1:
Database 10.2.0.4 with COMPATIBLE=9.2.0
Database uses a 10.2.0.4 oracle kernel with all 10.2.0.4 code - but is parameterized and has just features available like in 9.2.0
Example 2:
Database 10.2.0.4 with COMPATIBLE=10.2.0.3
Database uses a 10.2.0.4 oracle kernel with all 10.2.0.4 code - but is parameterized like in 10.2.0.3 - but has all 10.2. features available.
Please see the doc in the Server Reference at otn.oracle.com for more info on COMPATIBLE.
Kind regards
Mike -
Negative impact of RATE parameter in RMAN backups.. ?
Hello all..
Can u please tel me about the negative impact of rate parameter in RMAN backups.
Thanks in advance,,
Thanks & Regards
Vinay Raj MallaHi Jorgen,
there's no rule of thumb, because every application is different, also the users behaviour...
- every user needs an initial amount of memory while logged in (user context
- then there comes the amount of memory while working with the application
- then it depends if when for example a query is finished the memory gets freed up or if it will be held in memory
- the behaviour of the user if he logs out correctly (memory is freed up) or just closes the browser (memory still in use until timeout occurs)
So the best would be to simply monitor your system with SM04, there you can also click on GOTO -> MEMORY and you'll see the amount of memory for each user. Look what happens when a user works with the application and also what happens when a user closes the browser.
Regards,
Pascal
PS: Please give points for usesful answers -
Impact of job_queue_processes parameter in oracle 10g
We have recently migrated 9i database to 10g.During business hours we will reduce the parallel jobs running to 5 and during night hours we set to 20.
After migration to 10g we faced major performance impact.Rest of the parameter we kept same as oracle 9i except obsolete.
Would change of this parameter will impact this performance?
What are other parameter we should check?
Can anyone help me regardng the performance improvement.This causes major business impact.
Thanks
RaghavendraHi,
When does you database becomes perticularly slow? In the day time ot night time?
What are the scheduled job (apart from queues) on your database? Is there any relation between the scheduled jobs running and your database slowing down?
Is there a stats collection job? Is it taking same time as before or taking longer?
Run this SQL,
select s.username,b.sid, a.STATISTIC#, name, b.value
from v$sesstat b, v$statname a, v$session s
where a.STATISTIC# = b.STATISTIC# and ( name like '%physical%' or name like '%consist%' )
and b.sid = s.sid and s.program not like 'oracle@%'
order by 2,4
Do you know about the views I have used in there? You can figure out the session with extensive read, write and select activities from here. Also, you will need to apply your logic there.
Best luck. -
Rec/client parameter & Performance Impact
Hi all,
We have been asked by our audit team to set the parameter Rec/client=300 (our production client) in our production system.
But when we read few forums & notes, we feel that setting this parameter Rec/client=300 will definetly impact the performance.
So before setting this parameters we need to evaluate the performance impact in our ECC 6.0 system by setting this parameter, can anyone help us to evaluate the performace impact of this parameter settings in our below system
- ECC 6.0 / oracle 10g / HPUX - 64 bit / 3500 users / 2.5 terabyte data
Thanks
SenthilHello
Normally only customizing tables should have the logging flag. You can verify it in SE13 -> <table> -> Log data changes.
To list all tables with logging on, you can use this select statement:
SQL> select tabname, protokoll from sapr3.dd09l where protokoll = 'X';
As long as only so called customizing tables are logged, you should be fine. If you have some heavy traffic Z* tables, then two things might happen:
- performance might suffer
- the logging table DBTABLOG will explode
So please make sure only the necessary tables are logged and if possible test on the QAS system, if the logging leads to performance problems.
Best regards
Michael -
Use_current_session = FALSE does not run my job correctly
We have a custom scheduler that invokes jobs based on schedules/conditions. Until now, the jobs were all kicked off in the same session. Since the record set to be processed is increasing, we want the jobs submitted in parallel.
So the main job is split into several discrete jobs & run them in different sessions (dbms_scheduler.run_job with use_current_session = FALSE). The programs & jobs get created successfully.
The program has around 12 arguments defined.
The jobs run; however error out with "ORA-06502: PL/SQL: numeric or value error ORA-06502: PL/SQL: numeric or value error: character to number conversion error" *(DBA_SCHEDULER_JOB_RUN_DETAILS)*
If I run the jobs with this parameter = TRUE the jobs run successfully. Any pointers greatly appreciated.
Here are additional details..
DB: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
dba_scheduler_global_attribute
MAX_JOB_SLAVE_PROCESSES
LOG_HISTORY 30
DEFAULT_TIMEZONE US/Pacific
LAST_OBSERVED_EVENT
EVENT_EXPIRY_TIME
CURRENT_OPEN_WINDOW WEEKEND_WINDOW
v$parameter where name like '%process%'
processes 150
gcs_server_processes 0
db_writer_processes 1
log_archive_max_processes 2
job_queue_processes 20
aq_tm_processes 0
Thanks
Kiran.Hi,
This error seems clear,
character to number conversion error : at "XXA.XXX_ANP_ENGINE_MASTER_PKG", line 24
This is application code which the scheduler did run but the application code is throwing the error.
You will have to debug the issue occurring at line 24 of package "XXA.XXX_ANP_ENGINE_MASTER_PKG". You may be relying on something in your session which is not available in a background session - so the job fails when run in the background.
Hope this helps,
Ravi. -
Where the value of systimestamp/sysdate comes from and dbms_scheduler
I saw bunch of other posts but I could find the post that exactly explaining about where the value returned as systimestamp/sysdate comes from or impacted or I’m missing something and need some help.
Here is my situation
I have an access to this db (let me call db A) and when I access it, I get following result. I don’t have full access to this db so I cannot experiment a lot here.
SYSTIMESTAMP CURRENT_TIMESTAMP LOCALTIMESTAMP DBTIMEZONE SESSIONTIMEZONE
27-MAR-13 02.31.55.041411 AM +00:00 26-MAR-13 07.31.55.041416 PM -07:00 26-MAR-13 07.31.55.041416 PM +00:00 -07:00
I’m in PST timezone.
I have my db which I have full access as well as its host.
I can make result like db A on my db if I started up db and its listener while TZ environment variable equal to UTC.
Now I saw in other post that someone was trying to retrieve systimestamp value in a job executed via dbms_scheduler.run_job.
So I did that in two ways. 1 with use_current_session = true and 2 is false for the same.
On my db, results are the same (both returns time in UTC) but on db A, I got UTC time when use_current_session = true and PST when use_current_session = false.
So questions are:
What could be the difference in setup between my db and db A?
Is there a query, logfile, or anything I should check to find out what can be the difference?
Any clue about where to check will be appreciated as well and please let me know if there is some additional information necessary to provide me some help on this.
I tried to find the cause with my db and I could see the same result as db A which is to see UTC time if use_current_session = true and PST time if use_current_session = false by bringing up the db listener after I set TZ environment variable equal to PST8PDT. However this causes systimestamp from sqlplus session become also a PST time.
The reason I’m playing around with the setup and checking systimestamp value is because we are facing the situation where everywhere except pl/sql job submitted by enterprise scheduler service is pointing wrong timezone (PST instead of UTC) and I’ve been searching the solution or clue for where to look at.Hi Stephen,
I think your first thought about using a javascript timer, call an APEX application process to get the new value and finally set it in the page 0 item would be the way I would take. :)
+"Also, the message shown may vary depending on who is logged in, i.e. the user session. More than user is logged-in at the same time."+
In case you use an application process this shouldn't be any problem.
Some useful links: [Carl Backstrom's example|http://apex.oracle.com/pls/otn/f?p=11933:11]
[My example application includes similar ways of using js and application processes|http://apex.oracle.com/pls/otn/f?p=65555:1]
Best regards,
Tobias
[http://apex-at-work.blogspot.com/|http://apex-at-work.blogspot.com/] -
Stored Proc running twice using DBMS_Scheduler
Hello all,
I have a vb front end that calls a main stored proc which submits scheduler jobs to execute several stored procs asynchronously. Everything is working, except the part that the several stored procs are running twice. In the troubleshooting, I have eliminated the front end from being the culprit and the stored procs themselves. Essentially, when I call the stored proc using dbms_scheduler.create_job, it runs twice, even manually. I am about at wits end trying to figure out why: Using Oracle 11gR2
I started off setting up the programs
begin
--create program
dbms_scheduler.create_program
( program_name => 'prog_name'
,program_type => 'STORED_PROCEDURE'
,program_action => 'usp_sub_proc_1'
,number_of_arguments => 8
,enabled => FALSE
dbms_scheduler.DEFINE_PROGRAM_ARGUMENT
( program_name=> 'prog_name'
,argument_position=>1
,argument_name => 'name'
,argument_type=>'VARCHAR2'
/*the remaining 7 arguments are in code but not display for space reasons*/
dbms_scheduler.enable('prog_name');
end;Then the main stored proc executes this code:
declare v_job_name varchar2(100);
v_1 varchar(50) := 'All';
v_2 varchar(50) := 'All';
v_3 varchar(50) := 'All';
v_4 varchar(50) := 'All';
v_5 varchar(50) := 'TEST';
i_6 integer := 1;
v_7 varchar(50) := 'TEST_NE';
ts_8 timestamp := current_timestamp;
begin
v_job_name := 'uj_dmo_1';
dbms_scheduler.create_job (v_job_name
,program_name => 'prog_name'
,job_class => 'UCLASS_1'
,auto_drop => TRUE
--set parameters
dbms_scheduler.set_job_argument_value(v_job_name,1, v_1);
dbms_scheduler.set_job_argument_value(v_job_name,2, v_2);
dbms_scheduler.set_job_argument_value(v_job_name,3, v_3);
dbms_scheduler.set_job_argument_value(v_job_name,4, v_4);
dbms_scheduler.set_job_argument_value(v_job_name,5, v_5);
dbms_scheduler.set_job_argument_value(v_job_name,6, to_char(i_6));
dbms_scheduler.set_job_argument_value(v_job_name,7, v_7);
dbms_scheduler.set_job_argument_value(v_job_name ,8, to_char(ts_8));
--enable job
dbms_scheduler.enable(v_job_name);
--execute job
dbms_scheduler.run_job(job_name => v_job_name , use_current_session => FALSE);
end;
...And this is where I get the double execution of the job, but I am just not seeing it in my syntax, dba_scheduler_jobs, logging, etc. Any help is greatly appreciated, thanks!!Well apparently I will not win any Captain Obvious awards;
With 34MCA2K2's response with "what doesn't work" for some reason turned the light on. After some more testing here is what I found.
This code works as expected :
Exhibit A
begin
dbms_scheduler.create_job (job_name =>'TESTER'
,job_type => 'PLSQL_BLOCK'
,job_action => 'declare test1 integer := 1; begin test1 := test1 + 5; end;'
,auto_drop => True
/*dbms_scheduler.enable('TESTER'); */
dbms_scheduler.run_job(job_name => 'TESTER', use_current_session =>FALSE);
end;As does this:
Exhibit B
begin
dbms_scheduler.create_job (job_name =>'TESTER'
,job_type => 'PLSQL_BLOCK'
,job_action => 'declare test1 integer := 1; begin test1 := test1 + 5; end;'
,auto_drop => True
dbms_scheduler.enable('TESTER');
/*dbms_scheduler.run_job(job_name => 'TESTER', use_current_session =>FALSE); */
end;Exhibit A will create the job and is visible in the schedulerjobs view, and the RUN_JOB will execute it even when not enabled, but the pl/sql will not drop the job.
Exhibit B will create the job and once enabled, executes the job and then drops from schedulerjobs view.
Therefore, my desired results for running the jobs once asynchronously and dropping immediately is....
begin
v_job_name := 'uj_dmo_1';
dbms_scheduler.create_job (v_job_name
,program_name => 'prog_name'
,job_class => 'UCLASS_1'
,auto_drop => TRUE
--set parameters
dbms_scheduler.set_job_argument_value(v_job_name,1, v_1);
dbms_scheduler.set_job_argument_value(v_job_name,2, v_2);
dbms_scheduler.set_job_argument_value(v_job_name,3, v_3);
dbms_scheduler.set_job_argument_value(v_job_name,4, v_4);
dbms_scheduler.set_job_argument_value(v_job_name,5, v_5);
dbms_scheduler.set_job_argument_value(v_job_name,6, to_char(i_6));
dbms_scheduler.set_job_argument_value(v_job_name,7, v_7);
dbms_scheduler.set_job_argument_value(v_job_name ,8, to_char(ts_8));
/*enable job*/
dbms_scheduler.enable(v_job_name);
/*execute job (Do not execute the code below, it will lead to multiple executions)
dbms_scheduler.run_job(job_name => v_job_name , use_current_session => FALSE); */
end;
Maybe you are looking for
-
ABAP API MDM vs Standard MDM !!!
Maybe the expression that I am using is not the best one and hope that someone can give me any clarifications. What I am intending is to know: 1) If using ABAP API is the best way to implement MDM purposes or if hes an alternative to implement M
-
Why does the retail store only carry 5400rpm drives in mbp 17?
Just wondering why the stores carry the mbp 17's but only with a 5400rpm drive? I realize I can order it and change the drive options, but if they carried more options IN store they would sell more (I think at least). A 7200 rpm drive option @ 500gb
-
Calling Form on another Database
Hi What would be the best method to open a form in a different application, on a different instance (same DB version - 10g2)? Would it not be logical for the Open_Form to have username, password, and connect string parameters along with the 'session'
-
I don't have iTunes Radio on my Mac
I have a Mac OSX 10.6.8 and iTunes 11.1.1 and live in the US. When I go into my Music Library, I do not see an option for Radio. I see Songs - Albums - Artists - Genres - Videos - Internet - Match. Am I looking in the right place? I think I have look
-
...And I Thought it Would Never Happe
I've had my black zen micro for six months now and I've been reading about the well known headphone jack problem, although I just brushed you all off as being careless :P!!!!!!!! But nope, boy was wrong ! Just walking to work one day I started to get