November 11, 2011 at 10:08 am
can any one provide me the query to fetch the below information
Obtain the following information:
list of backup jobs (full vs Differential/ sqlsafe vs native)
Time the jobs run
What drives are used
View the history of the job and give % of failures in the last week.
Thanks
DBA
November 11, 2011 at 10:12 am
MSDB - sysjobs, sysjobhistory and the sysbackup* tables.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 11, 2011 at 11:32 am
Have you looked in the scripts section of SSC?
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
November 11, 2011 at 11:46 am
Here is a resource for instance that could be helpful.
There is also this one:
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
November 11, 2011 at 12:30 pm
yes but i couldn't get
November 11, 2011 at 12:42 pm
smileswithharish86 (11/11/2011)
yes but i couldn't get
couldn't get what?
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
November 11, 2011 at 1:04 pm
any script related to this
November 11, 2011 at 1:24 pm
smileswithharish86 (11/11/2011)
any script related to this
K, did you look at the scripts in the links I provided?
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
November 11, 2011 at 1:29 pm
yup that is really good but it's giving the information about database backup
i need the success and failure details of backup jobs
November 11, 2011 at 1:57 pm
have you queried the tables that Gail provided?
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
November 11, 2011 at 2:19 pm
ya i am sending you the query
use msdb
select j.name ,
j.description location,
--h.run_date
CONVERT(CHAR(10), CAST(STR(h.run_date,8, 0) AS dateTIME), 111) RunDate,
case h.run_status when 0 then 'failed'
when 1 then 'Succeded'
when 2 then 'Retry'
when 3 then 'Cancelled'
when 4 then 'In Progress'
end as ExecutionStatus
from sysjobs j inner join sysjobhistory h on h.job_id=j.job_id
where name like'%backup%' and name not like '%user trans%' and enabled=1
and h.run_date > convert(getdate()-7
but i have 2 problems in my query
1)not able to map the drive where backups are placing by the job.
2)scheduled information like" occurs once on monday"
can you please let me know , if you have a way to map these
November 11, 2011 at 2:22 pm
yes and also find the query
use msdb
select j.name ,
j.description location,
--h.run_date
CONVERT(CHAR(10), CAST(STR(h.run_date,8, 0) AS dateTIME), 111) RunDate,
case h.run_status when 0 then 'failed'
when 1 then 'Succeded'
when 2 then 'Retry'
when 3 then 'Cancelled'
when 4 then 'In Progress'
end as ExecutionStatus
from sysjobs j inner join sysjobhistory h on h.job_id=j.job_id
where name like'%backup%' and name not like '%user trans%' and enabled=1
and h.run_date > convert(getdate()-7
here i have 2 prob
1)i am not able to map the disk where the backup job are being generated by the job --
2)i need schedule details like "occurs once on monday at sometime"
can you please let me know, if you know any way to do this
November 11, 2011 at 3:39 pm
the sysbackup* tables (there are a few of them), sysscheduled (hard to decode, not well documented)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 15, 2011 at 2:44 am
Backup path can be found from msdb.dbo.backupmediafamily.
For Schedule related info refer to
http://solihinho.wordpress.com/2009/01/01/query-for-listing-sql-server-job-schedule/
Requires you to create 3 functions on master database
Regards,
Raj
Viewing 14 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic. Login to reply