Title: Can't Access Recurring Job
mivankovich - April 8, 2008 12:03 PM (GMT)
Hi,
I am unable to modify or hold a recurring job in recdef. When I key in the userid, I get a message, "User not on File". You can see the jobs running everyday and are in "Waiting Recovery" Status in the waiting jobs queeue and the user id.
But the userid cannot be found in laua.
It appears the user was deleted but the recurring jobs are still running.
Any thoughts???
OS - Windows NT
DB - SQL Server
Env - 8.0.3.7
Apps - 8.0.3.11
Many Thanks!
Mark
schroncd - April 8, 2008 12:19 PM (GMT)
Since I "don't do Windows" I'll give you the Unix answer. There is usually something similar for Lawson on Windows..
When a user is removed from the OS but not from Lawson the ID remains active in the GEN tables with all their associated jobs and printer assignments, etc... - but they are unavailable in laua, which in Unix reads /etc/passwd to get it's user list (different in 9.0)
There is a 'delusers' utility which will show you all the IDs currently in GEN and whether or not they exist as an OS ID. You can use 'delusers' to delete those users and reassign/remove their jobs just like if you had done it properly in laua before they were deleted from the OS.
g'luck!
mivankovich - April 8, 2008 12:31 PM (GMT)
Thanks, I come from a wonderful UNIX shop...working in lawson...I can see I'll have quite an adjustment.
Milo - April 8, 2008 09:13 PM (GMT)
Adjustment!?! HAH! Dave hasn't told you yet about MKS Toolkit! Let's see, which way do all the funny little slashes go? Do they go //// THIS way? Or do they go
\\\\ THIS way?? Or do they go \\\/// THIS way???
:nix:
Watch out for the slash direction -- always a LOT of fun when working in Windows! :rau:
mivankovich - April 9, 2008 11:34 AM (GMT)
You're not kidding! backwards indeed! I'll be posting more questions for you guyes in the future...I'm sure.
mivankovich - April 9, 2008 11:42 AM (GMT)
I fixed it. I had to do a combination of tasks to clean up the jobs. First, I had to modify the queuedjob table in GEN by dumping the table for each job (ALL 21,682 OF THEM) that was in waiting recovery status. Modified the status field, changing it to 63 (normal completion). Then used importdb to upload the file back into queuedjob table. Once this was completed I ran the jobinteg -d utility to clean up any bad or orphan job records.
Per Dave, I then used delusers and it appears there were a few orphan users (user IDs of 0). I deleted the orphan users (a weird NT000000## id) whose jobs were in the waiting queue. This user must have been deleted in the OS first then lawson (that's a no no). Once the user was deleted, the jobs associated with the user were deleted including the ones in recdef. Finally, I ran a listusermap -d to delete any undefined sids.
We now have no jobs in the waiting queue! Now I can monitor jobs much easier.
My previous manager (God bless him) had a great shell script that notified you when a job went into the waiting queue. I'll have to ask him for it. Is there a way with MKS toolkit to use unix shell scripts on the Windows platform? I sure hope it is possible...
Thanks again guys!
Milo - April 24, 2008 07:23 PM (GMT)
Here's my UNIX shell script to notify when a job's waiting in a queue. The key is the "jqstatus" command. You will have to adjust it to Windows.
______________________________________________________
# monitor_jobs.sh - for tracking jobs stuck in job scheduler
# mtsukroff 17-Jan-2008 Created
#----------------------------------------------
# This is the same as ".profile"
PATH=/usr/bin:/etc:/usr/sbin
# --- Adjust this CV for Test or Prod ---
# . cv lawtest
. cv lawprod
PATH=$PATH:/usr/local/bin://home/oracle/dba
export PATH
umask 000
export LD_LIBRARY_PATH
#-----------------------------------------------
TEMPFILE="/export/home/lawson/temp.txt"
# First see if anything's there
jqstatus -rw > $TEMPFILE
# If anything there, then email info
if [ -s $TEMPFILE ]
then
jqstatus -rwh > $TEMPFILE
mailx -s "Lawson Jobs Stuck in JobSchd" -r Lawson@emailaddress.com milo@emailaddress.com < $TEMPFILE
fi
# -- EOF -- #
======================================End=====
mivankovich - April 25, 2008 02:04 PM (GMT)
Thanks!
However, can't get mailx to work. How do I configure mailx to work on the windows server?
schroncd - April 28, 2008 04:50 PM (GMT)
Unfortunately mailx won't work for you on windows, but you might be able to use some windows based commandline mailer. Google can probably find one for you.
g'luck!
and if you DO get it to work, be sure to post it back here. There are lot's of Windows Lawson admins who I'm sure would appreciate it!
mivankovich - May 1, 2008 12:30 PM (GMT)
Hi,
I found a utility called BMAIL. It works great! however, the free version doesn't allow attachments, but you can specify an option that will e-mail the contents of a file in the body of the e-mail message.
I installed the executable in my lawson print directory and call it from within a shell script like this:
d:\\lawson\\apps\\print\\myusername\\bmail.exe -smtprelay.domain.com –a "$JOBNAME failed!" -b "NTID: $USERID UserName: $UNAME JobName: $JOBNAME Status: $STATUS" -t $MAILTO -f lawson@domain.com
options are listed by entering bmail -? on the command line.
It'll do!
Thanks,
Mark
Milo - May 5, 2008 09:46 PM (GMT)
Thanks for the info on bmail ... it should do you nicely.
BTW, my morning routine involves checking all 3 systems - Dev, Test and Prod - and determing if anything's stuck in the queues. But if there is no email, I need to know: Is that because all is well? Or has Lawson stopped running? So I have another script that always emails me a brief morning report, telling me things like, how much disk space is left; the date, time, and size of ladb.log; etc. As long as those standard messages are in my inbox in the morning, then I'm certain that there are no jobs stuck in the job queues.
schroncd - May 6, 2008 03:49 AM (GMT)
Of course we've been talking about a Windows system here, but it sounds like a good time for me to mention LEM (Lawson Evironment Monitor) again for those who may not have heard of it. It's Unix only so far, but it's FREE and open source - and you can find out about and download the latest version at
http://www,schronce.net/lawson/lem
mivankovich - May 9, 2008 07:11 PM (GMT)
THis is great! Would save many hours of scripting work...Very useful!
My co-workers from a previous job (unix shop) actually noticed this a while back but never installed it.
I know you don't do "Windoze", but would be great for us too. I've been able to get some basic shell scripts to work via mks toolkit. I wonder if several tweaks here and there would allow it to run on windows???
schroncd - May 9, 2008 07:33 PM (GMT)
I actually started the process of TRYING to produce a Windows version - what killed it was the lack of some of the basic Lawson commands in Windows - there is no "cv" to handle switching between multiple environments, which is key, and there were others missing or different as well so, since I "don't do Windoze", I dropped the project.
B U T
LEM is open source (uder the Apache 2 license) and there is nothing magic about the code, so I welcome anyone interested to download LEM and use that code to write a Windows version - I'll ever collaborate with you if you are sincere in your effort.