Job not running in 11.1.0.6.0 but running in 9.2.0.6.0
I have job which is running in oracle 9.2.0.6.0 but not running in 11.1.0.6.0
Job is that i have submitted is
declare
l_job number;
begin
dbms_job.submit( l_job,
'BEGIN DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => ''UV_DICOM'', TABNAME => ''STUDY'',ESTIMATE_PERCENT => 100, METHOD_OPT => ''for all columns size skewonly for columns (STATUS)'',CASCADE => TRUE, DEGREE => 4); END;',
SYSDATE,
'SYSDATE+1');
end;
I didn't under stand why?
Kanchana Devasurendra wrote:
Check you aq_tm_processes parameter. if the value is set to zero then set it to 1. Then try it againEeeh?
From docs
http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/initparams008.htm
AQ_TM_PROCESSES controls time monitoring on queue messages and controls processing of messages with delay and expiration properties specified.
You do not need to specify a value for this parameter because Oracle Database automatically determines the number of processes and autotunes them, as necessary.
Therefore, Oracle highly recommends that you leave the AQ_TM_PROCESSES parameter unspecified and let the system autotune.
Regards
Peter
Similar Messages
-
Convert Spool to PDF and mail for the jobs not run in background.
Dear All,
I need to convert the spool job into pdf and mail as attachment for job not run in background.
I am printing the bills using the program SD70AV3A to print the bills in a batch using the SUBMIT.
But i am not using the spool options since its going to into waiting state in spool...and i need to change the printer properties to G
to get the printer to print the reports as these jobs run in backgroud....but this solution is not acceptable solution.
SUBMIT SD70AV3A
WITH RG_KSCHL-LOW = 'ZRR'
WITH RG_NACHA-LOW = '1'
WITH PM_VERMO = '2'
WITH PM_NSORT = '1'
WITH RG_VBELN IN range.
* TO SAP-SPOOL
* SPOOL PARAMETERS print_parameters
* WITHOUT SPOOL DYNPRO
* VIA JOB name NUMBER number
* AND RETURN.
so how do i get the spool number from the above after the job is submitted....and then convert into pdf and mail
please suggest some solution. I have searched on net but most the solutions are say to run the job as background job...
i have also looked into the program RSTXPDFT4 but it asks for the spool id ....how can i get spool id for the job that has been completed.
please suggest some solution.
Thanks
Bhargava.Hi,
Spool to PDF : FM 'CONVERT_ABAPSOOLJOB_2_PDF'
Table TSP01 to get spool number
You ,may need to convert OTF to PDF: FM CONVERT_OTF
and the to binary : FM 'SMCS_XSTRING_TO_BINARY'
To send mail use class: cl_document _bcs.
Regards,
Maria João Rocha -
Cron job not running - script uses rsync, ssh (with id_rsa)
Does anyone know how to get cron to run a rsync/ssh script which uses id_rsa for passwordless logins?
I have a backup script I have slaved for months over that works wonderfully when running it from the command line.
It uses rsync and connects with SSH (passwordless using ssh keys). I have setup id_rsa and id_rsa.pub for passwordless logins (this is my user account, and connects using root@ to the server)
As stated all works find when run from the command line. But when I setup a cron job to run this file (exact same line I run from the command line) it does not execute. Actually, it does run, as I have an email notifiction which sends to me. It is just the rsync/ssh part that does not run.
I have spent days and days trying to figure it out. No error messages occur, nothing. Took me a while to find out cron is emailing the user account on Lion the messages (not to a proper email address).
The error shows a permission denied, which I believe to be the cron user cannot use the id_rsa/ssh connection.
Cron is running the script as my user, the same I use on the command line. I even tried copying the id_rsa to the root user .ssh folder in case cron is running as root but that does not work either.
So does anyone know how to get cron to run this rsync/ssh script which used id_rsa for passwordless logins?
Thanks a lotYES! Got it working, finally!
So the issue is indeed cron/launchd not being able to access the ssh-agent which holds the key.
So this is the solution...
Download keychain for Mac:
http://www.funtoo.org/wiki/Keychain
Then once its installed and configured, the script to run needs this added to the top:
eval `keychain --noask --eval id_rsa` || exit 1
Note I am using id_rsa whereas keychains instructions refer to id_dsa so I just changed it and it works OK.
When the script runs the first time it asks for the key password. Then it works from then on.
What I do not know yet is will I need to re-enter the password when I logoff/logon again. That will cause an issue as I auto restart the Mac every day which means if I am off for a few days backup will stop (can you see the madness in this issue!). -
Hi
I am using linux 5.x
uname -r
2.6.18-348.16.1.0.1.el5PAE
I have 2 crontab jobs set up as following .
cat backup_confluence.sh
#!/bin/bash
# bash shell script to backup confluence backups to bccpfr
# Schedule this script after the backups are performed that day
# Setup the environment for the bourne-again shell
. ./.bash_profile
# Copy the daily backups for confluence
find /usr/share/confluence/data/backups -mtime -1 \! -type d -exec ls {} \; -exec scp {} bccpfr:/usr/backup/confluence \;
second
cat backup_jira.sh
#!/bin/bash
# bash shell script to backup jira backups to bccpfr
# Schedule this script after the backups are performed that day
# Setup the environment for the bourne-again shell
. ./.bash_profile
# Copy the daily backups for jira
find /usr/share/jira/backups -mtime -1 \! -type d -exec ls {} \; -exec scp {} bccpfr:/usr/backup/jira \;
cron as following
$ crontab -l
13 06 * * * /home/lsg/backup_jira.sh
18 06 * * * /home/lsg/backup_confluence.sh
Issue
Both the above .sh are running properly when executed manually but they are not running automatically at the given time crontab job.
Kindly help me on this issue.
many thanks
JIs your crontask not running at all or is the scheduled task failing?
Hey Tommy I sent you some replies yesterday; don't know what happened to them. Yes I can see that crond runs every ten minutes. Also when I created the crontab file using the command you sent here I could see that it was running every minute by looking at root mail in /var/log.
Do you have execute permission set on the scripts?
Yes
Any info in /var/log/messages or e-mail?
Output from mail-
From root@razorback Tue Feb 11 08:19:01 2014
Return-Path: <root@razorback>
Received: from razorback (localhost [127.0.0.1])
by razorback (8.13.8/8.13.8) with ESMTP id s1BEJ154018231
for <root@razorback>; Tue, 11 Feb 2014 08:19:01 -0600
Received: (from root@localhost)
by razorback (8.13.8/8.13.8/Submit) id s1BEJ1rh018198;
Tue, 11 Feb 2014 08:19:01 -0600
Date: Tue, 11 Feb 2014 08:19:01 -0600
Message-Id: <201402111419.s1BEJ1rh018198@razorback>
From: root@razorback (Cron Daemon)
To: root@razorback
Subject: Cron <root@razorback> $(date) >> /tmp/cronout
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
/bin/sh: Tue: command not found
From root@razorback Tue Feb 11 08:20:02 2014
Return-Path: <root@razorback>
Received: from razorback (localhost [127.0.0.1])
by razorback (8.13.8/8.13.8) with ESMTP id s1BEK2BD018267
for <root@razorback>; Tue, 11 Feb 2014 08:20:02 -0600
Received: (from root@localhost)
by razorback (8.13.8/8.13.8/Submit) id s1BEK1mT018238;
Tue, 11 Feb 2014 08:20:01 -0600
Date: Tue, 11 Feb 2014 08:20:01 -0600
Message-Id: <201402111420.s1BEK1mT018238@razorback>
From: root@razorback (Cron Daemon)
To: root@razorback
Subject: Cron <root@razorback> $(date) >> /tmp/cronout
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
/bin/sh: Tue: command not found -
Oracle Job not running properly
Hi All,
I am facing an issue with oracle jobs.
I have writtent the script of a job scheduled to be executed automatically after 2 seconds.It works on a table and dequeue the data in that table.
Now the job is not able to execute for next time.If i execute the job immediately then also it does not run for next time.
so where could be the problem...
Please give me pointers.
Thanks in advance :)
Thanks n Regards
Arunuser10280915 wrote:
Hi All,
I am facing an issue with oracle jobs.
I have writtent the script of a job scheduled to be executed automatically after 2 seconds.It works on a table and dequeue the data in that table.
Now the job is not able to execute for next time.If i execute the job immediately then also it does not run for next time.
so where could be the problem...
Please give me pointers.
Thanks in advance :)
Thanks n Regards
ArunThings that you'll need.
1. JOB_QUEUE_PROCESSES to be non-zero
2. A commit after submitting the job
3. The job not to be broken.
4. don't schedule very frequently (say <5s) if the os is Linux :( ).
I'd check in the above order.
Niall -
Job not running on expected time
Hi,
Please see the job details
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
*( job => X*
*,what => 'BEGIN INVS_RIM_DATA_LOAD(''01A'',''RIMADMIN'',TRUNC(SYSDATE)); END;'*
*,next_date => to_date('15/08/2011 23:09:00','dd/mm/yyyy hh24:mi:ss')*
*,interval => 'TRUNC(SYSDATE+1)+23.15/24'*
*,no_parse => TRUE*
SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
END;
commit;
For taking the cold backup, db is shut down on every Friday 11:00PM and open by 02:30 PM Saturday. So job expected to run on Friday night will be running by Saturday 02:30AM. It is ok for us. But problem is job is not running on Saturday night.
When checked on Sunday morning the user_jobs shows details as
Last_date : 13-Aug-2011 02:30:14 AM
Next_Date : 14-Aug-2011 11:09:00 PM
Issue we are facing is job is not running on 13-Aug 11:09:00 PM
Please help me to fix this issue.Well, it runs on the expected time (for me). This is your interval: TRUNC(SYSDATE+1)+23.15/24
If the last job run at 13-Aug-2011 02:30:14 AM, then the next one should be:
= TRUNC( '13-Aug-2011 02:30:14 AM' + 1 ) + 23.15/24
= TRUNC( '14-Aug-2011 02:30:14 AM' ) + 23.15/24
= '14-Aug-2011' + 23.15/24
= '14-Aug-2011 11:09:00 PM'
You can create an additional job which will work at Saturday nights. This is the easiest fix I can think.
Regards
Gokhan Atil -
SQL Server Agent Jobs- Not running
Team,
We have a production database hosted on SQL Server 2008R2 SP2(10.50.4000). We have application jobs which are scheduled and basically have packages called from this job. These jobs were running all good till yesterday and it has stopped working since yesterday
even though its enabled. Manual runs are successful. Other jobs are running fine.
Checked the Owner of these jobs and the account is SQL Server account which is a proxy account. It had enforce password policy. I have removed that and reset the password to original. However it didnt work.
The last change on this server was windows patching which was performed last week. Apart from that the SQL Server agent service was changed. This is a clustered environment.
The last resort is restart the agent, however would like to get some inputs before I perform this action.
Please let me know your valuable inputs.
Regards,
SharathIf job is not executed at all, that is, there are no entries in the job history, check:
1) The job is enabled.
2) The schedule(s) is enabled.
3) The scdedule does not have an end date has has passed.
4) And that all other conditions on the schedule says that the job should run.
Erland Sommarskog, SQL Server MVP, [email protected] -
DPM 2012 R2 Upgrade - Scheduled jobs not running
Hi,
We're having an issue after upgrading to DPM 2012 R2 where the scheduled jobs are not running.
We're running Server 2012 R2 with SQL Server 2008 R2 SP2.
Looking at SQL jobs, if we run the job step we get an error.
Message
[136] Job 18822c3e-8fe 7-47a2-bb6e-0feccecc2952 reported: The process could not be created for step 1 of job 0xA746B176EAD99943A14A57DAF684829F (reason: %1 is not a valid Win32 application)
However, if we place quotes around the triggerjob.exe path in the SQL default job step:
"C:\Program Files\Microsoft System Center 2012 R2\DPM\DPM\bin\TriggerJob.exe" 9b30d213-b836-4b9e-97c2-db03c3eb39d7 18822c3e-8fe7-47a2-bb6e-0feccecc2952 server.domainname.com
It is successful.
We've already uninstalled DPM 2012 R2 and re-installed, restored the database and run dpmsync -sync with the same result. We've checked the DCOM Config Launch and Activation Permissions for Microsoft System Center 2012 R2 Data Protection Manager Service
and has full access.
Has anyone else had this issue and been able to resolve it?
Any help would be greatly appreciated.Hi,
The below blog may assist with troubleshooting your issue.
http://blogs.technet.com/b/dpm/archive/2014/10/08/how-to-troubleshoot-scheduled-backup-job-failures-in-dpm-2012.aspx
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually
answer your question. This can be beneficial to other community members reading the thread. Regards, Dwayne Jackson II. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights." -
Job not running in DBA_Jobs
Hi,
We have a job set in dba_jobs.
Suddenly after 31st mar-2011 the job is not running
The job of 31st mar 2011 is still in active state and exists in the database
The details of the job are as follows:
SELECT r.sid, r.job, r.this_date, r.this_sec, SUBSTR(what,1,40) what
FROM dba_jobs_running r,dba_jobs j
WHERE r.job = j.job;
SID JOB THIS_DATE THIS_SEC
439 65709 31-MAR-11 06:31:54
A OS process also exists
oracle 11130 1 0 Mar 31 ? 1:51 ora_j000_GAT
SQL> select status, to_char(logon_time,'dd-mm-yyyy:hh24:mi:ss') from v$session where sid=439;
STATUS TO_CHAR(LOGON_TIME,
ACTIVE 31-03-2011:06:31:29
SQL> select THIS_DATE,NEXT_DATE from dba_jobs where job=65709;
THIS_DATE NEXT_DATE
31-MAR-11 31-MAR-11
In long running SQL
439 SELECT TO_CHAR(HPEOP_EIN) EMPLID, NVL(HP GAT_OWNER 31-03-11:06:31:29 ACTIVE
EOP_GRADE,' ') JOBCODE, NVL(HPEOP_PREFER
RED_PHONE,' ') BT_PREFERRED_COMMS, NVL(H
The jobs usually take 1-5 mins
Can you please advice what needs to be done
What could have happened.Can you kill the job from the OS?
Then stop the job from running : set it to broken
Find out why it doesn't stop this time: look in code and data.
If you are confident it will not happen again schedule the job again. -
Jobs not running anymore since midnight
All my jobs that run minutely, half minutely, 10 minutely, hourly are all last run tonight before midnight.
Next run date was set to the correct time after midnight but they did not start.
Its a rac database under 64bit windows, 10.2.0.3.
Its acutally two databases and on one stopping and starting instances one by one helped.
On the other one the jobs (at least did run, or at least the next run data got updated) by the starting and stopping instances, but they still do not run at there regular intervals.
Currently i am trying with one job, disabling, enabling, changing the schedule, it runs occassionaly but not ever half minute as it should.
I did all the checks, no jobs running, there are not too many sessions, the job_queue parameters are correct....
There is nothing in the alert log, only thing i can find is:
jsksGetCurWindowId:1 got error 27468
in the cjq0 logfile.
Any further ideas or sugestions ?Do you use Oracle Scheduler (DBMS_SCHEDULER)?
If yes...
select * from DBA_SCHEDULER_GLOBAL_ATTRIBUTE where attribute_name='CURRENT_OPEN_WINDOW';
What do you find "Window group"?
If you find and then close it...
Example:
SQL> select * from DBA_SCHEDULER_GLOBAL_ATTRIBUTE where attribute_name='CURRENT_OPEN_WINDOW';
ATTRIBUTE_NAME VALUE
CURRENT_OPEN_WINDOW WEEKNIGHT_WINDOW
SQL> exec DBMS_SCHEDULER.close_window ('WEEKNIGHT_WINDOW');
If you use dbms_job, then try
SQL> show parameter job_queue_processes
NAME TYPE VALUE
job_queue_processes integer 50
SQL> alter system set job_queue_processes=0;
SQL> alter system set job_queue_processes=50;
surachart
http://surachart.blogspot.com -
the user execute the abap job and execute in background, but it is not running. He execute many times, but still sit in schedule state, do you know why? there is no error in SM21, will it be authority issues? how to check? thanks
It looks like it is an authorization issue. Ask them to do that again and immediately in another session, run SU54. This will show all the authorization checks that the user went through and tells you if it failed.
Alternatively, they can just go to SM37 and try to release it. If it comes back with a message, you will know.
Srinivas -
Hi All,
A background job has been scheduled to run every minute.It was working fine but a few days back it did not get scheduled for 2 hours . Any suggestions as to why this might have happened.
TIA.
VartikaHi Manik,
The job started working fine after 2 hours. It was only for 2 hrs that it did not work. How to check if the userid was locked or not during that period.
Thanks
Vartika -
Infopackage loads 0 record in process chain as BG job not running correctly
Hi Experts,
I have scheduled a daily process chain for Purchasing.
The infopackage in the process chain loads 0 records from R/3 and shows green status but data is available in R/3. Its a FULL update.
But when I load the data manually the infopackage fetchs the record form R/3.
When I checked the background job in R/3 that loaded 0 records, the job gets finished abruptly without fetchig any data.
Please find the job log below:
Job started
Step 001 started (program SBIE0001, variant &0000000210024, user ID RFCUSR)
DATASOURCE = ZPUR_S600
Current Values for Selected Profile Parameters *
abap/heap_area_nondia......... 0 *
abap/heap_area_total.......... 0 *
abap/heaplimit................ 40894464 *
zcsa/installed_languages...... ED *
zcsa/system_language.......... E *
ztta/max_memreq_MB............ 2047 *
ztta/roll_area................ 3000320 *
ztta/roll_extension........... 2000683008 *
Job finished
But the background job for the request when I run the infopackage manually calls a function BW_BTE_CALL_BW204010_E (BTE) and fetches the record from R/3.
Please find the job log that fetches the record when run manually.
Job started
Step 001 started (program SBIE0001, variant &0000000210036, user ID RFCUSR)
DATASOURCE = ZPUR_S600
Current Values for Selected Profile Parameters *
abap/heap_area_nondia......... 0 *
abap/heap_area_total.......... 41230008320 *
abap/heaplimit................ 40000000 *
zcsa/installed_languages...... DE *
zcsa/system_language.......... E *
ztta/max_memreq_MB............ 2047 *
ztta/roll_area................ 3000000 *
ztta/roll_extension........... 2000000000 *
Call customer enhancement BW_BTE_CALL_BW204010_E (BTE) with 26,596 records
Result of customer enhancement: 26,596 records
Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 26,596 records
Result of customer enhancement: 26,596 records
Asynchronous send of data package 000001 in task 0002 (1 parallel tasks)
Call customer enhancement BW_BTE_CALL_BW204010_E (BTE) with 26,596 records
Result of customer enhancement: 26,596 records
Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 26,596 records
Result of customer enhancement: 26,596 records
Asynchronous send of data package 000002 in task 0004 (1 parallel tasks)
Call customer enhancement BW_BTE_CALL_BW204010_E (BTE) with 1,062 records
Result of customer enhancement: 1,062 records
Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 1,062 records
Result of customer enhancement: 1,062 records
Asynchronous send of data package 000003 in task 0006 (1 parallel tasks)
tRFC: Data Package = 000001, TID = , Duration = 000001, ARFCSTATE =
tRFC: Start = 20110217 054648, End = 20110217 054649
tRFC: Data Package = 000003, TID = , Duration = 000000, ARFCSTATE =
tRFC: Start = 20110217 054652, End = 20110217 054652
tRFC: Data Package = 000002, TID = , Duration = 000001, ARFCSTATE =
tRFC: Start = 20110217 054651, End = 20110217 054652
Job finished
Kindly help me on this issue as why the job run through process chain is not fetchibg any records.
Regards,
IndhujaHi Prasanth,
If the background jobs are not availbale when IP is triggered then the BG job will ot be executed and the IDOCs will get struck.
Once we push the IDOc only the BG job will be executed until then the PC will wait with yellow status.
Hence this is not the issue with the non availability of BG WP.
Also for last one week this issue was happening but today the job executed successfully through the Process chain itself.
Then it shows this is not the issue with PC also.
The job is executed using RFCUSR.
Please suggest what would be the possible cause for this issue.
Regards,
Indhuja
Edited by: Induja Rajkamal on Feb 23, 2011 11:48 AM -
Copy Jobs Not Running with Firmware 4.1.102.29716
I have two ix4-300d NAS units and I use Copy Jobs to regularly transfer files oner the network. Since I upgraded both systems to the latest firmware, my Copy Jobs give error message "The Copy Job has unexpectedly stopped".
The firmware upgrade went smoothly and otherwise the units are functioning normally. I can access the remote ix4 manually but the Copy Jobs no longer run.Tech Support had me revert to the earlier firmware, 4.0.8. Did that last night. Still getting copy job errors but they are "connection refused" rather than "copy job unexpectedly stopped". The problem is that, in reverting to the old firmware, the user information is messed up badly so the NAS is really not workable. (No data is lost if you remove the drives before updating the firmware.) I resinstalled back to v 4.1.102 and at least it's functional except for copy jobs. I have not heard back today from tech support today and I don't know if they are aware that others are having the same problem.
I may try switching from rsync to ftp for file transfer. This should work provided I can change the port from 21/22 as they are in use for other systems. It seems the rsync server has a problem in 4.1.102. -
Job not running - Failed Initialization
Hi all,
I am using Oracle enterprise manager 10g installed on windows xp sp2
I have scheduled many jobs which ll send automatic mails extracting data from the databse 10g according to the query.
But for one of the jobs its giving an error
Problem - Failed Initialization.
Error log
Step aborted because parameter values were too large:ORA-06502: PL/SQL: numeric or value error: character string buffer too small
The SQL script for this Job is exceeding 4000 bytes .... will this be a problem?
Is there a rule that we cant have a sql script(datatype for this textfield is varchar2 ? ) more than 4000 bytes?
Thanks in advance....Hi,
I am using the datatypes correctly in my code.....
But I need to know whether OEM will support only codes(SQL scripts) which are 4000 bytes ?
The SQL script of the Job for which I am getting the error is
DECLARE
l_mailhost VARCHAR2(64);
l_from VARCHAR2(64);
l_mail_conn UTL_SMTP.connection;
header1 varchar2(4000);
footer varchar2(4000);
ip VARCHAR2(64);
wishes VARCHAR2(64);
st VARCHAR2(4000);
st1 VARCHAR2(4000);
st31 VARCHAR2(1000);
st32 VARCHAR2(1000);
st41 VARCHAR2(1000);
st42 VARCHAR2(1000);
st51 VARCHAR2(1000);
st52 VARCHAR2(1000);
st61 VARCHAR2(1000);
st62 VARCHAR2(1000);
st71 VARCHAR2(1000);
st72 VARCHAR2(1000);
st81 VARCHAR2(1000);
st82 VARCHAR2(1000);
cm VARCHAR2(64):=to_char(sysdate,'MONTH');
cy NUMBER:=EXTRACT(YEAR FROM systimestamp);
l_subject VARCHAR2(4000):=cm||cy||' SERVICE ANNIVERSARY CONGRATULATIONS!';
PROCEDURE send_header(name VARCHAR2, header VARCHAR2) AS
BEGIN
utl_smtp.write_data(l_mail_conn,name ||':'|| header || UTL_TCP.CRLF);
END;
BEGIN
select VALUE into l_mailhost from PSA_PARAMETERS where PROC_ID = 61 and DATA_TYPE = 'mailhost';
select VALUE into l_from from PSA_PARAMETERS where PROC_ID = 61 and DATA_TYPE = 'fromemail';
select VALUE into ip from PSA_PARAMETERS where PROC_ID = 61 and DATA_TYPE = 'ip';
select VALUE into header1 from PSA_PARAMETERS where PROC_ID = 63 and DATA_TYPE = 'header';
select VALUE into footer from PSA_PARAMETERS where PROC_ID = 63 and DATA_TYPE = 'footer';
for c1 in (select a.FIRST_NAME ||' '||a.last_name as name, a.JOIN_DATE, a.STERLING_EXPERIENCE as exp from PSA_RESOURCE_MANAGER a
where to_char(sysdate,'month') = to_char(JOIN_DATE,'month')
and a.ACTIVE_FLAG = 'Y') loop
if mod(c1.exp,12) = 11 then
c1.exp := c1.exp + 1;
end if;
st1:='
'||'<font color="green">Completing '|| c1.exp/12||' years at SCI this '||cm||'</font>
if c1.exp/12=3 then
begin
st31:=st1;
st32:=st32||c1.NAME||' |';
end;
end if;
if c1.exp/12=4 then
begin
st41:=st1;
st42:=st42||c1.NAME||' |';
end;
end if;
if c1.exp/12=5 then
begin
st51:=st1;
st52:=st52||c1.NAME||' |';
end;
end if;
if c1.exp/12=6 then
begin
st61:=st1;
st62:=st62||c1.NAME||' |';
end;
end if;
if c1.exp/12=7 then
begin
st71:=st1;
st72:=st72||c1.NAME||' |';
end;
end if;
if c1.exp/12=8 then
begin
st81:=st1;
st82:=st82||c1.NAME||' |';
end;
end if;
end loop;
st := st31||st32||st41||st42||st51||st52||st61||st62||st71||st72||st81||st82;
if st is not null then
begin
for c1 in (SELECT a.OFFICIAL_MAIL_ID AS "email" from PSA_RESOURCE_MANAGER a
where a.ACTIVE_FLAG = 'Y' or a.PSID = 7264) loop
wishes := to_char(sysdate,'MON');
l_mail_conn := UTL_SMTP.open_connection((ip), 25);
UTL_SMTP.helo(l_mail_conn, ip);
UTL_SMTP.mail(l_mail_conn, l_from);
UTL_SMTP.rcpt(l_mail_conn,c1."email");
utl_smtp.open_data(l_mail_conn);
utl_smtp.write_data(l_mail_conn, 'From: ' || l_from || utl_tcp.crlf);
utl_smtp.write_data(l_mail_conn, 'To: ' || c1."email" || utl_tcp.crlf);
utl_smtp.write_data(l_mail_conn, 'Subject: ' || l_subject || utl_tcp.crlf);
utl_smtp.write_data(l_mail_conn, 'Content-Type: text/html' || utl_tcp.crlf);
utl_smtp.write_data(l_mail_conn, utl_tcp.crlf || '<html>
<body>
<head>
<style type="text/css">
h1.pos_abs
{position:absolute;
left:10px;
top:10px;}
h2.pos_abs
{position:absolute;
left:700px;
top:10px;}
</style>
</head>
<body>
<h1 class="pos_abs">
<img src="\\opsserver-dt\html_mails\birthday\gdc.bmp" width="400" height="100" />
</h1>
<h2 class="pos_abs">
<img src="\\opsserver-dt\html_mails\birthday\sterling_logo.bmp" width="250" height="60" />
</h2>
<p><b>
<img src="\\opsserver-dt\html_mails\anniversary\'||wishes||'.bmp" align="left" width="320" height="280"/>
<p style="font-family: Serif;color:blue;size:medium">'||
st||'
</p>
</b>
</p>
<p style="font-family:courier new; color:red">Note: Please right click on the image boxes to download the images if you are unable to see them.
</style></p><p>
<i>'||
footer||'</i>
</p>
</body>
</html>
utl_smtp.close_data(l_mail_conn);
UTL_SMTP.quit(l_mail_conn);
end loop;
end;
end if;
END;
The above code will send a mail to all the mail id in the table "PSA_RESOURCE_MANAGER" containing details of those records with experience from 3yrs
(calculated from joining date)....... in a month (equated to sysdate month).
HTML is used for formatting the mail and adding a picture........
PS: I am also running another job which will send mail containing data of those records whose Birthday falls in the sysdate month and it is running successfully and this code is 3000bytes.
Thank You
Maybe you are looking for
-
MacBook Pro just shut down without notice. It had about 40% of the battery life. It will not turn back on and I noticed when plugged in the little light on the power cord is blinking orange, not a solid green like normal. Anyone have this issue befo
-
Anaglyph (cyan-red glasses) 3D in Acrobat 3D?
Hi everyone, I'd like to know if there'd be a way to see 3d content in a pdf 3d file with anaglyph 3d with red-cyan glasses in real time. Is there some code that we could enter in the 3d file to unable that or is there a plugin or something that coul
-
HT4848 Can't find "installation information for this machine"
I have a brand new Mac Mini that came with Mountain Lion Server pre-installed. After having some difficulty(s) migrating from Snow Leopard I wish to revert to a clean re-install and start over. When I attempt to do this I get "Could not find installa
-
WMTA - Output type for Inbound Deliveries
I am looking at the output control requirement in WMTA for Inbound Deliveries by considering vendor address Scenario: Domestic Vendors : Trigger WMTA (ie send immediately) as soon as Inbound Delivery is created and International Vendors: Same Output
-
Aperture won't import an Aperture library
I have Aperture updated and installed on my macbook pro and my iMac. On vacation, I imported the photos to my MBP for review and editing. I have done this many times in the past. I can export the Projects or the Folder of my vacation pics to an Ap