Friday, March 23, 2012
Job schedule success/failure
scripts. How can I get the job to report failure if step 2 fails but step 4
doesn't?Stephanie wrote:
> I have a job that has 4 steps, all of which have to run. They are
> all T-SQL scripts. How can I get the job to report failure if step 2
> fails but step 4 doesn't?
Are you saying you want the job to continue should one of the steps fail
or are you saying you want all the steps to run regardless of success
and have the job report failure if any of the steps fail. If the latter,
then how will you resolve running the failed step?
David Gugick
Quest Software
www.imceda.com
www.quest.com|||I want all steps to run regardless of the status of a particular step but I
want failure of the job as a whole to be based on failure of any one of the
steps. If a step fails, I will worry about that later. But I'd like all
steps to run no matter what and I'd like to get an alert if any of the steps
fail as opposed to just the last step.
"David Gugick" wrote:
> Stephanie wrote:
> Are you saying you want the job to continue should one of the steps fail
> or are you saying you want all the steps to run regardless of success
> and have the job report failure if any of the steps fail. If the latter,
> then how will you resolve running the failed step?
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
>|||Stephanie wrote:
> I want all steps to run regardless of the status of a particular step
> but I want failure of the job as a whole to be based on failure of
> any one of the steps. If a step fails, I will worry about that
> later. But I'd like all steps to run no matter what and I'd like to
> get an alert if any of the steps fail as opposed to just the last
> step.
You can check the "Append output to step history" for each step. In the
morning, examine the job history and show step detail. If there were any
failed steps, you'll see them there. Make sure each step is created to
proceed to the next step on failure or success.
select
j.name,
h.*
From
msdb..sysjobs j inner join
msdb..sysjobhistory h
On
j.job_id = h.job_id
and
j.name = N'<job_name>'
and
h.sql_message_id > 0
Order By
j.name,
h.run_date,
h.run_time
-- OR
Exec msdb..sp_help_jobhistory @.job_name = N'<job_name>', @.run_status = 0
David Gugick
Quest Software
www.imceda.com
www.quest.comsql
Wednesday, March 21, 2012
Job Names Created for Subscriptions
I'm new to Reporting Services and have just created my first data-driven
subscription for a report. In the SQL Enterprise Manager, the job name seems
to take the shape of a GUID. Is there a way around this so administration is
easier and these names are "human readable"?
Thanks in advance!
Kind regards - FredI'd also like to know the answer to this. The DBAs here likes to keep a
close eye on the jobs and they seem really annoyed by these GUIDs. I pointed
out that they could see it was a Reporting Services job and they could sort
on that column to put them all together but they didn't really consider that
a good solution.sql
Job History report
Hello all,
I need to create a report on a certain Job on my server. It should look exactly like the "View History" window.
to do that, i need to find a way to group the logged steps by the job executions. The problem is that in the sysjobhistory table there's only a instance_id field that runs incrementally, with no way to identify the execution…
any ideas?
You'll need to join so sysjobs and sysoperators if you want the Job Name and Operators that were emailed, net sent or paged.
You might be able to group the run_date and run_time together and use this for your "key" to group the job steps together. Note: run_time is in a 24 hour format and is not left zero filled (i.e. 10001 is 1:00:01 am, 152531 is 15:25:31 pm).
convert(varchar(8), run_date) + right('000000' + convert(varchar(6), run_time), 6) -->> will give you the date and hhmmss the step executed (i.e. 20061225010001).
You could parse the results (maybe using hours and/or minutes) to group the steps together.
The above is a quick and dirty and depending upon how often and how long your jobs run, may not work.
Since the format of job history is consitent with step_id of 0 as the job completion step, you can write a stored procedure and use a cursor to group the steps (read all the steps and "break" each time a step_id of 0 is encountered).
|||
Thanks,
The first way you wrote will not work since you cannot group on Running Date & Time - this group will not identify all the steps in a certain run in the same group.
I also thought of the second way, but it seemed too costly.
How does the "view job history" window know how to separate the job executions?
|||Liran, that is why I wrote that the first step "may not work". If your job ran once each hour, started at 1 minute past the hour and ran for less than 59 minutes every time, the first method would work since each step would have the same date and hour time stamp. Obviously this won't work if your job starts at 59 minutes after the hour and runs for more than one minute or runs for more than one hour.
Not sure how the "view job history" works but would imagine it does a similar activity as what I described for writing a stored procedure. Since you can't have the same job name executing at the same time on the same server, the starting date/time of the job and each of it's steps will be in chronological order; doesn't matter if the job runs more than one our or spans over multiple days.
Another option might be to add the duration (from step_id = 0) to the start date/time to get the ending date/time of the job (NOT the steps). You could then choose any of the rows in sysjobhistory that fall between the start date/time and the calculated ending date/time of the job.
You said you had an idea, why don't you describe it and we might be able to expand upon it...
|||
OK, Now I understood what you meant, but this method is not relevant to me since this job runs for more then 1 hour with 1 min between each run…
About the second Idea, I meant I also thought of the second idea you wrote (with the procedure and cursor) but it seems to me too costly to be executed every time the report is viewed…
Thanks, I just thought there's somewhere a "job running instance id" that I'm overlooking…
|||Pls chek the following post..It may help you
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1033004&SiteID=1
Monday, February 20, 2012
JDBC issues on infoview (Tomcat)
I'm experiencing an issue with a report which was originally designed for use with CR 7.5 but then, for security reason, we had to adapt it for use with CRXI.
Basically, when updating the datasource settings, using the native oracle driver available on the Crystal report application, I get an "unrecognised characterset" error message.
A colleague suggested that this is probably an application issue as if instead of the native Oracle connectivity, I update the datasource to use a JDBC connection, I do get results printed on the screen.
However when I load the modified and saved template into infoview, I get a "Failed to open connection" error.
I've been looking into both the tomcat and businessobject documentation but couldn't find anything to help me.
Does anyone has a clue on what do I need to look at in order to fix this issue?
Thanks a lot
LaurenceForgot to mention, BusinessObject is installed under tomcat on a unix machine...|||Open the report and do verify database and try.
Also search for your solution here
http://support.businessobjects.com/