Showing posts with label jobs. Show all posts
Showing posts with label jobs. Show all posts

Thursday, March 22, 2012

ASP Code to Monitor Scheduled SQL Jobs via the web

Hi Guys,

I'm Hoping some one could help me out, I'm in need of creating a web interface to monitor scheduled SQL Jobs, both on sql 2000 & 2005.

I'm new to asp, Can anyone point me in the right direction.Really appreciate it.

Regards

This should get you started for SQL2005.

<%@. Page Language="VB" EnableTheming="False" %><%@. ImportNamespace="System.Data" %><%@. ImportNamespace="System.Data.SqlClient" %><!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server">Protected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs)If Not Page.IsPostBackThen JobHistory_GridView.DataSource = FJobHistory_GridView() JobHistory_GridView.DataBind()End If End Sub Function FJobHistory_GridView()As System.Data.IDataReaderDim SelectConnAs New SqlConnection("SQL_Server_ConnectionString_With_User_That_Can_Access_MSDB_Database")Dim SelectCmdAs New SqlCommand() SelectCmd.CommandText ="msdb.dbo.sp_help_jobactivity" SelectCmd.CommandType = CommandType.StoredProcedure SelectCmd.Connection = SelectConn SelectConn.Open()Dim dataReaderAs IDataReader = SelectCmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection)Return dataReaderEnd Function </script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>SQL Job History</title></head><body> <form id="form1" runat="server"> <div> <asp:GridView ID="JobHistory_GridView" runat="server" AutoGenerateColumns="True"> </asp:GridView> </div> </form></body></html>
|||

Thanks a mil Brad,

This will def come in handy, I'm new at this company, i've noticed that they already have a web interface set up to monitor sql jobs, at present it is setup to monitor jobs on sql 2000, I need to now get this working with sql2005, I've configured everything neccessary on the config & aspx pages. I get a connection to sql 2005, I know this because as part of the monitoring tool you are able to view proccesser info as well, I can view this information of the the sql 2005 server however it does not display the jobs. (Just Blank)

Any idea why this might be? I could post the code if that would help.

Thanks again for your assistance.

BR

|||

Try this for the gridview instead

 <asp:GridView ID="JobHistory_GridView" runat="server" AutoGenerateColumns="False" DataKeyNames="session_id,job_id"> <Columns> <asp:BoundField DataField="session_id" HeaderText="session_id"ReadOnly="True" /> <asp:BoundField DataField="job_id" HeaderText="job_id"ReadOnly="True" /> <asp:BoundField DataField="job_name" HeaderText="job_name" /> <asp:BoundField DataField="run_requested_date" HeaderText="run_requested_date" /> <asp:BoundField DataField="run_requested_source" HeaderText="run_requested_source" /> <asp:BoundField DataField="queued_date" HeaderText="queued_date" /> <asp:BoundField DataField="start_execution_date" HeaderText="start_execution_date" /> <asp:BoundField DataField="last_executed_step_id" HeaderText="last_executed_step_id" /> <asp:BoundField DataField="last_executed_step_date" HeaderText="last_executed_step_date" /> <asp:BoundField DataField="stop_execution_date" HeaderText="stop_execution_date" /> <asp:BoundField DataField="next_scheduled_run_date" HeaderText="next_scheduled_run_date" /> <asp:BoundField DataField="job_history_id" HeaderText="job_history_id" /> <asp:BoundField DataField="message" HeaderText="message" /> <asp:BoundField DataField="run_status" HeaderText="run_status" /> <asp:BoundField DataField="operator_id_emailed" HeaderText="operator_id_emailed" /> <asp:BoundField DataField="operator_id_netsent" HeaderText="operator_id_netsent" /> <asp:BoundField DataField="operator_id_paged" HeaderText="operator_id_paged" /> </Columns> </asp:GridView>
If that doesnt work, post your code.

Wednesday, March 7, 2012

AS dont process cubes

Hi,

my english is very bad, so i try to explain....

We have a MOLAP structure and several jobs executing SSIS packages. This jobs yesterday and today don′t finished , just stay executing without error messages and the cubes not up to date. I stop and restart AS instance and the cubes is up to date. But i can not do this every time. I see in Event viewer and dont have any error messages. I see in other forun to disable proactive caching...is this correct ?...wich problems i can have doing this ?...and what i can do to resolve this problem ?..

Thanks

To clarify, you have a cube with MOLAP partitions. Do you have proactive caching enabled? Are you using SSIS to process your cubes?

Thanks,
Bryan

|||

Yes..i have a cube with MOLAP partitions, but proactive caching is disabled and SSIS process the cubes.

But in some cases only stop and restart AS to process de cubes, and the job with ssis package stay runing ..stay runing..stay runing and dont do anything....i start the profile and the command to begin the cube shows up, but stay...stay..stay....can you help me ?....thanks a lot

|||

It's very hard to say what is happening with the cube. So, I would recommend some experimentation. Does the cube process when done manually in BIDS or in SSMS? Do parts of the olap database process while other parts hang?

There have been some posts and blogs indicating this happens when a resource limitation is being hit. I would think you would see something in the error logs regarding this, but maybe not. One of the recommendations from this was to break apart the processsing job into a series of steps. This might help as well.

Another poster on SQL Junkies is complaining of the same issue. You may want to reach out to him/her to see if the problem has been resolved:

http://groups.google.com/group/microsoft.public.sqlserver.datawarehouse/browse_thread/thread/77d4f542ff7d288a/307dfc5dc1bcdfc3#307dfc5dc1bcdfc3

Finally, I would recommend making sure you are on SP2.

Good luck,
Bryan

Friday, February 24, 2012

Article

Tech firms defend moving U.S. jobs overseas (http://www.msnbc.msn.com/default.aspx?id=3899043&p1=0)
Any thoughts or comments?In seven years the world's leading computing companies will be Chinese and Indian.

Goodbye Microsoft. Goodbye IBM.

Thanks for all the fish.|||I hope not. I've seen their work :)|||This is really sad for the U.S. computer science students who will find the jobs harder and harder in the future.|||if you live in the west (i.e. rich economy) my advice is: forget being a programmer, that's a dead end

become a tech writer good at translating business requirements into programming specs

business doesn't just farm out the jobs without direction and supervision

the low-paid tech workers in the third world aren't mind readers, and before they can build anything, they need to be told what it is

clarity in writing the specs will be an extremely valuable skill|||Originally posted by r937
if you live in the west (i.e. rich economy) my advice is: forget being a programmer, that's a dead end

become a tech writer good at translating business requirements into programming specs

business doesn't just farm out the jobs without direction and supervision

the low-paid tech workers in the third world aren't mind readers, and before they can build anything, they need to be told what it is

clarity in writing the specs will be an extremely valuable skill

True...but you still need to know garbage when you see it...and we deal with a lot of close/off shore...and let me tell you...

over thinking a problem...whoah...to the nth degree...

everything is a rocketship that doesn't meet spec...want to show how clever...uh, but it doesn't do what we asked for...

clarity? Across time zone, language and cultural barriers...

ok, if you say so...

Sure, here you go...all of our private medical bills...alread cases of overseas blackmail...in the paper the other day...

Sure, here transcript our private grand jury hearings...

ect

http://comment.cio.com/comments/13801.html

http://209.157.64.200/focus/f-news/1023655/posts

http://www.cio.com/archive/121503/itwork.html|||[shot in foot]
And the best part is we sit here and give out answers...for free
[/shot in foot]

dooooooh|||...after 25 yrs in this business I've learned one thing...

...you must be a chameleon...adapt or die!! It really is a shame that some college produced another twit with an MBA giving birth to yet another brain f#rt. Then the rest just read it on the latest edition of
an airline magazine...

...most don't realize their mistake until it's too late (e.g. outsourcing)|||Originally posted by rocket39
...after 25 yrs in this business I've learned one thing...

Got me beat by 2 years...

...most don't realize their mistake until it's too late (e.g. outsourcing)

I'm not so sure...the instability in the world, coupled with the inability to meet deadlines are making persauvie arguments...

And the Upper managment backlash against IT (because they made them feel stupid, IT's budget over runs, ect) pale in effeciency and market share...

There's only so much cost to cut....|||Hm. The theory is quality matters more than cost?

You need to understand deflationary economics. As more and more jobs get exported theres two primary effects. Firstly overall the workforce deskills over time. Secondly, because there are fewer jobs, theres less money in the economy, meaning overall people buy fewer things. The fall in demand for stuff, forces the price of stuff down, so in order to still make profit from making stuff, companies export even more jobs in order to get costs down. This is a self-reinforcing downward spiral.

Conversely, in the places the jobs get imported to, the increase in salaried workers means overall theres more money in the economy, meaning the demand to buy stuff rises. As Chinese people understand the culture, language and alphabet of China infinitely better than any westerner, the profitability of local Chinese enterprises rises.

The key measure of time in computing is the technology refresh cycle, which in the US and EU has been lengthened by the dotcom recession. Conversely in the job importing countries, technology refresh is accelerating to the benefit of local suppliers. India is investing very heavily in Linux based solutions because it gives them a financial out of paying tax to Wintel. Over two technology refresh cycles, the balance of innovation will reach the catastrophe pivot and the lead in computing innovation will have left the US and left it permanently. The combined markets of China, India and Asia-Pacific outweigh all the US and EU put together.

There needs to be a re-alignment in corporate thinking regarding the purpose and function of the western Company if the 21st Century is not to be the Asia-Pacific Century. Its the quality of US and western management that needs to change, not the price of jobs.|||Originally posted by Brett Kaiser
Got me beat by 2 years... 32 years here

downsized (not outsourced) four times

and currently, ahem, unemployed and looking for contracting work|||...so I guess what you're saying is I should learn to deal Blackjack?

...in order for management to change then our learning institutions need to change first. Since the current dogma has been generated by college professors the change would have to start there, and since our education system has become a wink-and-nod organization without any real objection how will this change come about. Our colleges are more concerned with turning out "well rounded" individuals without focusing on the technical skills they should be teaching. It is no wonder that students in other countries are so much more advanced. As a parent of several yutes I know how frustrating this can be since the current high school generation has been coddled beyond belief. These young individuals now believe that they "deserve" everything. What they really need is a large dose of reality...|||It is ironic that our demand for profit and low-cost everything (some would call this greed) has created our current situation. How many of us have shopped for the cheapest dvd player or computer (as evidenced by the success of wal-mart) ... Not realizing that our own consumerism would consume our jobs. Maybe it is time for the people in developed countries (especially in the U.S.) to evaluate what is important in life. If we keep measuring everything by the bottom-line - then we will be treated like the bottom-line. Just a few of my "deep thoughts".|||Originally posted by HanafiH
Hm. The theory is quality matters more than cost?

You need to understand deflationary economics. As more and more jobs get exported theres two primary effects. Firstly overall the workforce deskills over time. Secondly, because there are fewer jobs, theres less money in the economy, meaning overall people buy fewer things. The fall in demand for stuff, forces the price of stuff down, so in order to still make profit from making stuff, companies export even more jobs in order to get costs down. This is a self-reinforcing downward spiral.

Conversely, in the places the jobs get imported to, the increase in salaried workers means overall theres more money in the economy, meaning the demand to buy stuff rises. As Chinese people understand the culture, language and alphabet of China infinitely better than any westerner, the profitability of local Chinese enterprises rises.

The key measure of time in computing is the technology refresh cycle, which in the US and EU has been lengthened by the dotcom recession. Conversely in the job importing countries, technology refresh is accelerating to the benefit of local suppliers. India is investing very heavily in Linux based solutions because it gives them a financial out of paying tax to Wintel. Over two technology refresh cycles, the balance of innovation will reach the catastrophe pivot and the lead in computing innovation will have left the US and left it permanently. The combined markets of China, India and Asia-Pacific outweigh all the US and EU put together.

There needs to be a re-alignment in corporate thinking regarding the purpose and function of the western Company if the 21st Century is not to be the Asia-Pacific Century. Its the quality of US and western management that needs to change, not the price of jobs.

Whoah...impressive...seems like you're forecasting a good distance into the future there...too many variables to predicate I would dare to say...

What college course did they teach that in?

What happens per say, if India and pakistan go at it?

And what if India starts to get the upper hand, and oh, I do not know, China weighs in on the side of pakistan ( I think they have a treaty)?

How would you feel about the security of your data then?

Also, ALL of these countries are outside the jurasdiction of the US goverment and therefore outside it's rules and regs AND prosecution...

Lots of vairables...

Always in motion is the future *

* Yoda reference|||What happens per say, if India and pakistan go at it?

Well, for sure memory prices for computers would jump through the roof.|||By all accounts, if India and Pakistan "go at it" in any meaningful way, India will border on Afghanistan, and pretty quick, too.

Well, this has happened to the Steel industry, the Shoe industry in Boston, and the Textile industry in the northeast as a whole. Ironically, the textile industry moved to the American South, and the shoe industry made a short layover in Italy, before heading on to Asia. The one business truth you can get out of this is that companies will do business as cheaply as possible.

As for the candidates proposals...

Kerry's proposal of making call centers announce where the call center is before continuing the call? What exactly is that supposed to do? Take up another 10 - 20 seconds of time, while I wait for an answer to a possibly production down problem? Does it help me to know where the guy is, so long as the guy helping me is competent? Besides that, if a company does business in say India, and is selling its helpdesk services to a company in America, would they truly be bound by such a law? The employee and direct employer are both in India.

Dean: This is a bit unrelated. Moving a "headquarters" to the off-shore for tax reasons is not the same as outsourcing. In some extreme cases, the off-shore "headquarters" consists of one person to answer the phone and connect people to the building (in America) where the CEO actually works.

As for me, my direct experiences with off-shore help have been mixed at best. Just the same as my experiences with the college-hire newbs that this company keeps calling programmers.|||Originally posted by MCrowley
By all accounts, if India and Pakistan "go at it" in any meaningful way, India will border on Afghanistan, and pretty quick, too.

Ahhhh but don't forget China....

Other nice points though

I blame congress (hey why not)...I would blame Clinton, but...

Maybe Hilary will do for now...|||who the heck are Kerry and Dean?

i think i know who Hilary is -- isn't she that Lizzy McGuire babe?

man, is she ever hot, but whoa, she's already chunky, i wonder how big around the middle she's gonna be when she hits thirty...|||Howard Dean and John Kerry..the Democratic front runners for President...

Hilary Clinton...and if you like'em plump...she's you're gal

Slick willy ain't get'n any...

and GW! Wants to let the Canadians and Mexicans in on extended work Visa's...

There you go...

Just stay up with current events (hint: The English went back home ;-) )

Thursday, February 9, 2012

Are Steps 1 and 3 of a replication agent job important?

Hello,
I am creating a custom job that will publish several publications to
subscribers. I will NOT be using the auto-generated jobs created by SQL
Server to perform these tasks, and instead I am performing this activity in
my custom job. I copied the job steps from the SQL generated jobs over to
mine.
However, I noticed that for every replication task, each job generated has 3
steps. Usually, they include something like the following steps:
1. Snapshot Agent startup message.
2. Run agent.
3. Detect nonlogged agent shutdown.
Because my custom job is very complex, I would prefer not to include steps 1
and 3 of every task as they dont seem to do anything important besides
logging. Before I remove them, I would like to ask for your feedback and/or
find out if I should keep these tasks there for any reason.
What will I miss out on if I remove them?
Johnny
I'd have to imagine you could get by without them... test it out and see
what happens.
"Johnny" <Johnny@.discussions.microsoft.com> wrote in message
news:E6274B37-FFBE-4A5A-9453-A2DDD4FB15A9@.microsoft.com...
> Hello,
> I am creating a custom job that will publish several publications to
> subscribers. I will NOT be using the auto-generated jobs created by SQL
> Server to perform these tasks, and instead I am performing this activity
> in
> my custom job. I copied the job steps from the SQL generated jobs over to
> mine.
> However, I noticed that for every replication task, each job generated has
> 3
> steps. Usually, they include something like the following steps:
> 1. Snapshot Agent startup message.
> 2. Run agent.
> 3. Detect nonlogged agent shutdown.
> Because my custom job is very complex, I would prefer not to include steps
> 1
> and 3 of every task as they dont seem to do anything important besides
> logging. Before I remove them, I would like to ask for your feedback
> and/or
> find out if I should keep these tasks there for any reason.
> What will I miss out on if I remove them?
> Johnny
>
|||I did test it out before and after and everything seems to work perfectly as
step 1 & 3 are simply logging startup and error messages. This works for both
the snapshot & distribution agents.
Johnny
"ChrisR" wrote:

> I'd have to imagine you could get by without them... test it out and see
> what happens.
>
> "Johnny" <Johnny@.discussions.microsoft.com> wrote in message
> news:E6274B37-FFBE-4A5A-9453-A2DDD4FB15A9@.microsoft.com...
>
>
|||The first job step adds a message to the history table. The last step is
used to detect if the agent shut down (gpf'd) without an error message.
It is advisable to include these job steps.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Johnny" <Johnny@.discussions.microsoft.com> wrote in message
news:3567799D-ACF3-4CF9-9329-6EC74CCFF89E@.microsoft.com...
> I did test it out before and after and everything seems to work perfectly
as
> step 1 & 3 are simply logging startup and error messages. This works for
both[vbcol=seagreen]
> the snapshot & distribution agents.
> Johnny
>
> "ChrisR" wrote:
SQL[vbcol=seagreen]
activity[vbcol=seagreen]
to[vbcol=seagreen]
has[vbcol=seagreen]
steps[vbcol=seagreen]