Showing posts with label job. Show all posts
Showing posts with label job. Show all posts

Wednesday, March 21, 2012

How to find the in Progress job in MSDB database

Hello,
I am try to find which job is in progress.
Then I start a job A. run a statement like:
select * from sysjobhistory where job_id = 'A' and
run_status = 4
it return nothing, even I know the job it is running.
Can anybody tell me how to get information about those job
in progress from MSDB database?
Thanks in advance...Don't feel bad about not finding it. It isn't in the database. It is
actually in the shared memory between SQL Agent and SQL Server. I don't
know of any way to access it either.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
"Harry G" <anonymous@.discussions.microsoft.com> wrote in message
news:04ad01c3d6f7$aa1624f0$a101280a@.phx.gbl...
> Hello,
> I am try to find which job is in progress.
> Then I start a job A. run a statement like:
> select * from sysjobhistory where job_id = 'A' and
> run_status = 4
> it return nothing, even I know the job it is running.
> Can anybody tell me how to get information about those job
> in progress from MSDB database?
> Thanks in advance...|||Hi,
Please execute the procedure
exec msdb..sp_help_job @.job_id = 0x3F2224EAAFD7A9418A4643AF5C020379,
@.job_aspect = N'job'
(replcae the jobid with your job id)
current_execution_status =1 then Job executing
current_execution_status =4 then not Running
Thanks
Hari
MCDBA
"Harry G" <anonymous@.discussions.microsoft.com> wrote in message
news:04ad01c3d6f7$aa1624f0$a101280a@.phx.gbl...
> Hello,
> I am try to find which job is in progress.
> Then I start a job A. run a statement like:
> select * from sysjobhistory where job_id = 'A' and
> run_status = 4
> it return nothing, even I know the job it is running.
> Can anybody tell me how to get information about those job
> in progress from MSDB database?
> Thanks in advance...

How to find the in Progress job in MSDB database

Hello,
I am try to find which job is in progress.
Then I start a job A. run a statement like:
select * from sysjobhistory where job_id = 'A' and
run_status = 4
it return nothing, even I know the job it is running.
Can anybody tell me how to get information about those job
in progress from MSDB database?
Thanks in advance...Don't feel bad about not finding it. It isn't in the database. It is
actually in the shared memory between SQL Agent and SQL Server. I don't
know of any way to access it either.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
"Harry G" <anonymous@.discussions.microsoft.com> wrote in message
news:04ad01c3d6f7$aa1624f0$a101280a@.phx.gbl...
quote:

> Hello,
> I am try to find which job is in progress.
> Then I start a job A. run a statement like:
> select * from sysjobhistory where job_id = 'A' and
> run_status = 4
> it return nothing, even I know the job it is running.
> Can anybody tell me how to get information about those job
> in progress from MSDB database?
> Thanks in advance...
|||Hi,
Please execute the procedure
exec msdb..sp_help_job @.job_id = 0x3F2224EAAFD7A9418A4643AF5C020379,
@.job_aspect = N'job'
(replcae the jobid with your job id)
current_execution_status =1 then Job executing
current_execution_status =4 then not Running
Thanks
Hari
MCDBA
"Harry G" <anonymous@.discussions.microsoft.com> wrote in message
news:04ad01c3d6f7$aa1624f0$a101280a@.phx.gbl...
quote:

> Hello,
> I am try to find which job is in progress.
> Then I start a job A. run a statement like:
> select * from sysjobhistory where job_id = 'A' and
> run_status = 4
> it return nothing, even I know the job it is running.
> Can anybody tell me how to get information about those job
> in progress from MSDB database?
> Thanks in advance...

Monday, March 12, 2012

How to find out the job/report that is currently running?

How do I find out the report that is currently being run? I have a scenario where some users run a report without knowing the amount of data that will be pulled by it... In such a case, it bogs down the server and doesn't let me access the Report Manager application.

How can I find out what is the report that is currently being run? I know I can get that information from the Show Jobs link fromm Site Settings in Report Manager. But in this case, I am not even able to login to the Report Manager. The memory (8 gigs) in the app server is fully maxed out and it doesn't log me in to the Report Manger.

I ran a query against the ExecutionLog table in the ReportServer database that logs all the executions. But it looks like the data to this table gets logged only after the report execution is completed. There is no way to tell what is being executed right now. I also checked the table RunningJobs in the ReportServer database, but there are no records in that table.

Can someone help?

Thanks.

can someone help?|||

I am unable to find information on the web related to this. Can someone help?

Thanks for your response.

|||In the ReportServer database there is a RunningJobs table which hold this data.|||I have mentioned in my post that this table did not contain any records when I checked. Any possible scenarios/cases as to when such a thing could occur?

How to find out the job/report that is currently running?

How do I find out the report that is currently being run? I have a scenario where some users run a report without knowing the amount of data that will be pulled by it... In such a case, it bogs down the server and doesn't let me access the Report Manager application.

How can I find out what is the report that is currently being run? I know I can get that information from the Show Jobs link fromm Site Settings in Report Manager. But in this case, I am not even able to login to the Report Manager. The memory (8 gigs) in the app server is fully maxed out and it doesn't log me in to the Report Manger.

I ran a query against the ExecutionLog table in the ReportServer database that logs all the executions. But it looks like the data to this table gets logged only after the report execution is completed. There is no way to tell what is being executed right now. I also checked the table RunningJobs in the ReportServer database, but there are no records in that table.

Can someone help?

Thanks.

can someone help?|||

I am unable to find information on the web related to this. Can someone help?

Thanks for your response.

|||In the ReportServer database there is a RunningJobs table which hold this data.|||I have mentioned in my post that this table did not contain any records when I checked. Any possible scenarios/cases as to when such a thing could occur?

How to find out restore progress of the job

Hello,
I was wondering if there is a way to find out restore progress of the
job. If I run restore in QA, I can use STATS option to control restore
progress statistics but this information is not accessible when restore
executed as a part of a job.
Thanks,
Igor
Hi,
You can do it using a batch file and call the batch file inside the SQL
Agent -- Jobs (Command
1. Batch file should be:-
OSQL -Uuser -Ppassword -Sserver -d dbname -Q"backup database pubs to
pubsbak' with init, stats=10 -oc:\backup.log
2. Then schedule the batch using SQL Agent job with type as "Operating
system command".
3. During job you could open the c:\backup.log to get the status
I hope this will work out.. I have not tested this so far Probably you
could test and get back.
Thanks
Hari
SQL Server MVP
"Igor Marchenko" <igormarchenko@.hotmail.com> wrote in message
news:eRAVJRkOFHA.1500@.TK2MSFTNGP09.phx.gbl...
> Hello,
> I was wondering if there is a way to find out restore progress of the
> job. If I run restore in QA, I can use STATS option to control restore
> progress statistics but this information is not accessible when restore
> executed as a part of a job.
>
> Thanks,
> Igor
>
|||It worked nicely. Thanks a lot, Hari! I have found another way. When
scheduling a job in EM, you can specify Output file in Advanced tab of the
task. Stats progress is being logged into this file.
Igor
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OynaXakOFHA.3880@.tk2msftngp13.phx.gbl...
> Hi,
> You can do it using a batch file and call the batch file inside the SQL
> Agent -- Jobs (Command
> 1. Batch file should be:-
> OSQL -Uuser -Ppassword -Sserver -d dbname -Q"backup database pubs to
> pubsbak' with init, stats=10 -oc:\backup.log
> 2. Then schedule the batch using SQL Agent job with type as "Operating
> system command".
> 3. During job you could open the c:\backup.log to get the status
> I hope this will work out.. I have not tested this so far Probably you
> could test and get back.
> Thanks
> Hari
> SQL Server MVP
>
> "Igor Marchenko" <igormarchenko@.hotmail.com> wrote in message
> news:eRAVJRkOFHA.1500@.TK2MSFTNGP09.phx.gbl...
>

How to find out restore progress of the job

Hello,
I was wondering if there is a way to find out restore progress of the
job. If I run restore in QA, I can use STATS option to control restore
progress statistics but this information is not accessible when restore
executed as a part of a job.
Thanks,
IgorHi,
You can do it using a batch file and call the batch file inside the SQL
Agent -- Jobs (Command
1. Batch file should be:-
OSQL -Uuser -Ppassword -Sserver -d dbname -Q"backup database pubs to
pubsbak' with init, stats=10 -oc:\backup.log
2. Then schedule the batch using SQL Agent job with type as "Operating
system command".
3. During job you could open the c:\backup.log to get the status
I hope this will work out.. I have not tested this so far Probably you
could test and get back.
Thanks
Hari
SQL Server MVP
"Igor Marchenko" <igormarchenko@.hotmail.com> wrote in message
news:eRAVJRkOFHA.1500@.TK2MSFTNGP09.phx.gbl...
> Hello,
> I was wondering if there is a way to find out restore progress of the
> job. If I run restore in QA, I can use STATS option to control restore
> progress statistics but this information is not accessible when restore
> executed as a part of a job.
>
> Thanks,
> Igor
>|||It worked nicely. Thanks a lot, Hari! I have found another way. When
scheduling a job in EM, you can specify Output file in Advanced tab of the
task. Stats progress is being logged into this file.
Igor
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OynaXakOFHA.3880@.tk2msftngp13.phx.gbl...
> Hi,
> You can do it using a batch file and call the batch file inside the SQL
> Agent -- Jobs (Command
> 1. Batch file should be:-
> OSQL -Uuser -Ppassword -Sserver -d dbname -Q"backup database pubs to
> pubsbak' with init, stats=10 -oc:\backup.log
> 2. Then schedule the batch using SQL Agent job with type as "Operating
> system command".
> 3. During job you could open the c:\backup.log to get the status
> I hope this will work out.. I have not tested this so far Probably you
> could test and get back.
> Thanks
> Hari
> SQL Server MVP
>
> "Igor Marchenko" <igormarchenko@.hotmail.com> wrote in message
> news:eRAVJRkOFHA.1500@.TK2MSFTNGP09.phx.gbl...
>

How to find out restore progress of the job

Hello,
I was wondering if there is a way to find out restore progress of the
job. If I run restore in QA, I can use STATS option to control restore
progress statistics but this information is not accessible when restore
executed as a part of a job.
Thanks,
IgorHi,
You can do it using a batch file and call the batch file inside the SQL
Agent -- Jobs (Command
1. Batch file should be:-
OSQL -Uuser -Ppassword -Sserver -d dbname -Q"backup database pubs to
pubsbak' with init, stats=10 -oc:\backup.log
2. Then schedule the batch using SQL Agent job with type as "Operating
system command".
3. During job you could open the c:\backup.log to get the status
I hope this will work out.. I have not tested this so far :) Probably you
could test and get back.
Thanks
Hari
SQL Server MVP
"Igor Marchenko" <igormarchenko@.hotmail.com> wrote in message
news:eRAVJRkOFHA.1500@.TK2MSFTNGP09.phx.gbl...
> Hello,
> I was wondering if there is a way to find out restore progress of the
> job. If I run restore in QA, I can use STATS option to control restore
> progress statistics but this information is not accessible when restore
> executed as a part of a job.
>
> Thanks,
> Igor
>|||It worked nicely. Thanks a lot, Hari! I have found another way. When
scheduling a job in EM, you can specify Output file in Advanced tab of the
task. Stats progress is being logged into this file.
Igor
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OynaXakOFHA.3880@.tk2msftngp13.phx.gbl...
> Hi,
> You can do it using a batch file and call the batch file inside the SQL
> Agent -- Jobs (Command
> 1. Batch file should be:-
> OSQL -Uuser -Ppassword -Sserver -d dbname -Q"backup database pubs to
> pubsbak' with init, stats=10 -oc:\backup.log
> 2. Then schedule the batch using SQL Agent job with type as "Operating
> system command".
> 3. During job you could open the c:\backup.log to get the status
> I hope this will work out.. I have not tested this so far :) Probably you
> could test and get back.
> Thanks
> Hari
> SQL Server MVP
>
> "Igor Marchenko" <igormarchenko@.hotmail.com> wrote in message
> news:eRAVJRkOFHA.1500@.TK2MSFTNGP09.phx.gbl...
>> Hello,
>> I was wondering if there is a way to find out restore progress of the
>> job. If I run restore in QA, I can use STATS option to control restore
>> progress statistics but this information is not accessible when restore
>> executed as a part of a job.
>>
>> Thanks,
>> Igor
>

Sunday, February 19, 2012

How to filter a table to another by T-SQL

I have 2 tables: table one is for all the data, table two is filtered data
from table one. I want to shedule this job and do it every night, i.e. every
end of the day (00:00), I want to use a sheduled T-Sql statement to get all
today's data from table one and insert those meet the criteria into table
two.
I don't know how to:
1. Where to schedule such kind of a job?
2. What T-SQL should I use? SELECT INTO seems like not be able to add
records to a existing table."JL" <ljmagzine@.hotmail.com> wrote in message
news:O0kCcf00DHA.3216@.TK2MSFTNGP11.phx.gbl...
> I have 2 tables: table one is for all the data, table two is filtered data
> from table one. I want to shedule this job and do it every night, i.e.
every
> end of the day (00:00), I want to use a sheduled T-Sql statement to get
all
> today's data from table one and insert those meet the criteria into table
> two.
> I don't know how to:
> 1. Where to schedule such kind of a job?
> 2. What T-SQL should I use? SELECT INTO seems like not be able to add
> records to a existing table.
>
Sql Server Agent can schedule the job.
Make it a TSQL job, and run something like
"
delete from table2
insert into table2
select * from table1
where col=1234
"
David|||Hi,
1. Where to schedule such kind of a job?
Use SQL Agent to Schedule the Job. But Ensure that SQL Agent service
runs all the time. Go to
How to:
1. Select Enterprise manager
2. Choose Management
3. Select SQL Server Agent option
4. Select Jobs
5. Right click above jobs and create new Job
6. There in step option you can create a TSQL Job and use schedule
option to schedule the Job
2. What T-SQL should I use? SELECT INTO seems like not be able to add
records to a existing table.
Use Insert into Select statement , the statement looks like
Insert into table2(columns) select column1,col2 from table1 where
conditions.....
The above statement you can incorporate inside your job ...Step.
Thanks
Hari
MCDBA
"JL" <ljmagzine@.hotmail.com> wrote in message
news:O0kCcf00DHA.3216@.TK2MSFTNGP11.phx.gbl...
> I have 2 tables: table one is for all the data, table two is filtered data
> from table one. I want to shedule this job and do it every night, i.e.
every
> end of the day (00:00), I want to use a sheduled T-Sql statement to get
all
> today's data from table one and insert those meet the criteria into table
> two.
> I don't know how to:
> 1. Where to schedule such kind of a job?
> 2. What T-SQL should I use? SELECT INTO seems like not be able to add
> records to a existing table.
>