LiCongMingDeShujuku / Find-The-Recovery-Model-Of-All-Databases

查找所有数据库的恢复模型

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLEVER DATA GIT REPO

查找所有数据库的恢复模型哟用的·SQL

Find The Recovery Model Of All Databases With SQL

发布-日期: 2014年4月23日 (评论)

#

Contents

中文

用这个简单脚本可以查找你的所有数据库的状态。 它将显示恢复模型,状态以及数据库是否处于只读(Read Only)模式。

English

Find the status of all your databases with this little script. This will show you the Recovery Model, State, and if the Databases is in Read Only mode.


Logic

use master;
set nocount on
select
‘database’ = db_name(database_id)
, ‘status’ = state_desc
, ‘recovery model’ = recovery_model_desc
, ‘ready only?’ = case is_read_only
when ‘0’ then ‘Nope’
when ‘1’ then ‘Yes’ end
from
sys.databases
where
db_name(database_id) not in ( ‘master’, ‘msdb’, ‘model’, ‘tempdb’ ) order by
db_name(database_id) asc

WorksEveryTime

Build-Info

Build Quality Build History
Build-Status
Coverage
Nuget
Build history

Author

  • 李聪明的数据库 Lee's Clever Data
  • Mike的数据库宝典 Mikes Database Collection
  • 李聪明的数据库 "Lee Songming"

Gist Twitter Wordpress


License

LicenseCCSA

Lee Songming

About

查找所有数据库的恢复模型