Is there a way I can find out if my databases are being backed up daily on a
daily basis on a server ?
I want to be able to run a script and list all databases not being backed up
dailyHassan
If you build database maintenance plan and check all user database , you
are sure that all databases are being backed up
as well as theit log files (I assume with FULL recovery mode)
"Hassan" <Hassan@.hotmail.com> wrote in message
news:e5qgFV6AGHA.140@.TK2MSFTNGP12.phx.gbl...
> Is there a way I can find out if my databases are being backed up daily on
> a daily basis on a server ?
> I want to be able to run a script and list all databases not being backed
> up daily
>|||Something like
select d.name as [Database],
max(b.backup_finish_date) as [Last Backup],
case
when datediff(hh,isnull(max(b.backup_finish_date),'19000101'),getdate()) >
24
then 'N' else 'Y' end as [Recent Full Backup]
from master.dbo.sysdatabases d
left join msdb.dbo.backupset b
on d.name = b.database_name and b.type = 'D'
group by d.name
order by d.name
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Hassan" <Hassan@.hotmail.com> wrote in message
news:e5qgFV6AGHA.140@.TK2MSFTNGP12.phx.gbl...
> Is there a way I can find out if my databases are being backed up daily on
> a daily basis on a server ?
> I want to be able to run a script and list all databases not being backed
> up daily
>|||Hi
ALTER DATABASE DataBase SET RECOVERY FULL
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:ulbMSq8AGHA.3104@.TK2MSFTNGP12.phx.gbl...
> Something like
> select d.name as [Database],
> max(b.backup_finish_date) as [Last Backup],
> case
> when datediff(hh,isnull(max(b.backup_finish_date),'19000101'),getdate()) >
> 24
> then 'N' else 'Y' end as [Recent Full Backup]
> from master.dbo.sysdatabases d
> left join msdb.dbo.backupset b
> on d.name = b.database_name and b.type = 'D'
> group by d.name
> order by d.name
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:e5qgFV6AGHA.140@.TK2MSFTNGP12.phx.gbl...
>> Is there a way I can find out if my databases are being backed up daily
>> on a daily basis on a server ?
>> I want to be able to run a script and list all databases not being backed
>> up daily
>|||Sorry, wrong post
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:e1uO608AGHA.4036@.TK2MSFTNGP10.phx.gbl...
> Hi
> ALTER DATABASE DataBase SET RECOVERY FULL
>
> "Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
> news:ulbMSq8AGHA.3104@.TK2MSFTNGP12.phx.gbl...
>> Something like
>> select d.name as [Database],
>> max(b.backup_finish_date) as [Last Backup],
>> case
>> when datediff(hh,isnull(max(b.backup_finish_date),'19000101'),getdate())
>> > 24
>> then 'N' else 'Y' end as [Recent Full Backup]
>> from master.dbo.sysdatabases d
>> left join msdb.dbo.backupset b
>> on d.name = b.database_name and b.type = 'D'
>> group by d.name
>> order by d.name
>> --
>> HTH
>> Jasper Smith (SQL Server MVP)
>> http://www.sqldbatips.com
>> I support PASS - the definitive, global
>> community for SQL Server professionals -
>> http://www.sqlpass.org
>> "Hassan" <Hassan@.hotmail.com> wrote in message
>> news:e5qgFV6AGHA.140@.TK2MSFTNGP12.phx.gbl...
>> Is there a way I can find out if my databases are being backed up daily
>> on a daily basis on a server ?
>> I want to be able to run a script and list all databases not being
>> backed up daily
>>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment