DonatShell
Server IP : 180.180.241.3  /  Your IP : 216.73.216.252
Web Server : Microsoft-IIS/7.5
System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586
User : IUSR ( 0)
PHP Version : 5.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Program Files/Microsoft SQL Server/MSSQL11.MSSQLSERVER/MSSQL/Binn/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /Program Files/Microsoft SQL Server/MSSQL11.MSSQLSERVER/MSSQL/Binn/mssqlsystemresource.ldf
c)9o8701./3==CSSSSSSScccmw)Ud}Kޟ&@@?v%OqnZlogu\{.mssqlsystemresource                                                                                                                                                                                                                          &nA"A"
kaW@<(±*=W@<(±co4rtH5y34WQCu\{.mssqlsystemresource                                                                                                                                                                                                                          &nq2q2kaW@<(±*=W@<(±co4rtH5y34WQC@u\{.mssqlsystemresource                                                                                                                                                                                                                          &nq2q2kaW@<(±*=W@<(±co4rtH5y34WQCu\{.mssqlsystemresource                                                                                                                                                                                                                          &nA"A"
kaW@<(±*=W@<(±cA"4rtH5y34WQCQCI` #KL.p0`KkF
K5-=
KARc6ASAT
AU
AV
AW	
AX
AYAZ	
A[


A\
A]
A^

A_
A`AaAbAcAd
AeAf
AgAhAiAjAkAlAmAn Ao!Ap"JII@HpGFEE0D`CBA@ @P?>=<<@;p:98807`6543 3P210P00RL6l0074o$08%LF3ςFShrinkFile8F8F0
9;%>cK))
01./3==CSSSSSSScccmw)Ud}Kޟ&@
@@?v%OqnZlog01./3==CSSSSSSScccmw)Ud}Kޟ&@@?v%OqnZlog0
>;$
P8F8ς0^?pVƼLF3ЂFFileSize>?FK

aj@@?F%%?0@]$P?F?Ђ0"A!
5-=
AR#ASAATA
AUA
AVA
AWA
AXAAYA	AZA
	
A[A

A\A
A]A

A^A

A_A
A`AAaAAbAAcAAdA
AeAAfA
AgAAhAAiAAjAAkAAlAAmAAnAAoAApA `XF0` P@p0
`
	 	P@p0RO0ςFShrinkFile8F8F0PO`A"YA"03==CSSSSSSScccmw)Ud}Kޟ&@
@@?v%OqnZlogQٕUQLF3!F(DBMgr::ChangeDBState>QF	cC!$@0R}	^E>QF	cQr:0ChangeDBState>QF	cC!$@0zSn^VQ@RF(%Q0r:0ChangeDBState>QF	cC!$@0T)QPQFQ!0r:0ChangeDBState>QF	cC!$@0HUʷ>LF3QF,CREATE/ALTER PROCEDURE>UF=P>UFt"
!"P00=PP Psp_autostats"
P*>UF]"&!"&&=P&sp_autostats"
ƹ̠>UF"&!
"&&=P&sp_autostats"
K9~>UFz"&!"
=P"
[>UF<&<
0=P 
8create procedure sys.sp_autostats
	@tblname 	nvarchar(776),
	@flagc		varchar(10)=null,
	@indname	sysname=null
as
begin
	declare	@fag		bit,	-- no recompute
			@permit		bit,	-- locked after permission check?
			@tabid		int,
			@objtype	varchar(2)

	--  Check flag
	set @flag = (case lower(@flagc)
		when 'on' 	then 0
		when 'off' 	then 1
		end)
	if @flag is null AND @flagc is NOT null
    begin
		raiserror(17000,-1,-1)
       	return (1)
    end

	-- set NORECOMPUTE mask
	select @permit = 1

	-- Check we are executing in the correct database
	declare @db sysname
	select @db = parsename(@tblname, 3)

	if (@db is NOTnull AND @db <> db_name())
	begin
		raiserror(15387,-1,-1)
		return (1)
	end

	-- VERIFY WE HAVE A USER-TABLE/INDEXED-VIEW BY THIS NAME IN THE DATABASE
	select @tabid = object_id, @objtype = type from sys.objects
		where object_id = object_id(@tblname, 'local') and (type = 'U' or type = 'V' or type = 'IT')
	if (@tabid is null) OR
		(
			@objtype = 'V' AND
			(ObjectProperty(@tabid, 'IsIndexed') = 0 OR
			ObjectProperty(@tabid, 'IsMSShipped') = 1)
		)
	begin
		raiserror(15390,-1,-1,@tblname)
		return @@error
	end
	
	-- PRINT or UPDATE status?
	if (@flag is null)
	begin
		-- Display global settings (sp_dboption)
		--
		PRINT 'Global statistics settings for ' + quotename(db_name(), '[') + ':'
		PRINT '  Automatic update statistics: ' + (case when DatabasePropertyEx(db_name(), 'IsAutoUpdateStatistics') = 1 then 'ON' else 'OFF' end)
		PRINT '  Automatic create statistics: ' + (case when DatabasePropertyEx(db_name(), 'IsAutoCreateStatistics') = 1 then 'ON' else 'OFF' end)
		PRINT ''

	-- Display the current status of the index(s)
		--
		PRINT 'settings for table ' + quotename(@tblname, '[')
		PRINT ''
		select 'Index Name' = quotename(s.name, '['),
		       'AUTOSTATS' = case s.no_recompute
				when 1 then 'OFF'
				else 'ON'
			end,
		       'Last Updated' = stats_date(@tabid, s.stats_id)
		from sys.stats s
		where s.object_id = @tabid AND		-- Table
			case 					-- Match name
				when @indname is null then 1
				when @indname = s.name then 1
				else 0
			end = 1
	end
	else
	begin
		BEGIN TRANSACTION

		-- Lock the table schema and check permissions
		EXEC %%Object(MultiName = @tblname).LockMatchID(ID = @tabid, Exclusive = 1, BindInternal = 1)
		if (@@error <> 0)
		begin
			COMMIT TRANSACTION
			raiserror(15165,-1,-1,@tblname)
			return @@error
		end
	
		-- Flip the status bits
		if (@indname is null)	-- Match all index
		begin
			declare ms_crs_autostat cursor local static for
				select	s.name
				from sys.stats s left outer join sys.indexes i on s.object_id] = i.[object_id] and s.[stats_id] = i.[index_id]
				where s.[object_id] = @tabid and isnull(i.is_hypothetical, 0) = 0
			
			open ms_crs_autostat

			fetch next from ms_crs_autostat into @indname

			while @@fetch_status = 0
			begin
				EXEC %%StatisticsEx(ObjectID = @tabid, Name = @indname).SetNoRecompute(Value = @flag)
				fetch next from ms_crs_autostat into @indname
			end
			deallocate ms_crs_autostat
		end
		else
		begin
			if exists(select *
				from sys.stats
				whereobject_id = @tabid and name = @indname)
				EXEC %%StatisticsEx(ObjectID = @tabid, Name = @indname).SetNoRecompute(Value = @flag)
			else
			begin
				COMMIT TRANSACTION
				raiserror(15323,-1,-1,@tblname)
				return @@error
			end
		end

		COMMIT TRANSACTION

	end

	return(0) -- sp_autostats
end
<
'8ө>UFk)
!)E0-=PE@tblname)
x />UF) )"6=P"@tblname)
ɮs>U	Fk)U)A0-=P
A@flagc)
L)>U
F)U	)6=P@flagc)
s>UFk)U
)E0-=PE@indname)
aX̟>UF)U)"6=P"@indname)
s>U
Ft"U"=P"
P*>UFt"U"=P"
P*PUFUQXX0X0 [
	
 l aLF3N_F,CREATE/ALTER PROCEDURE>aFz>aFt"U"T00zP NNTsp_updatestats"
<LÃg>>aF]"" "*=&z*sp_updatetats"
eww>aF^!" &"*s&z*sp_updatestats"
v{
C>aFz"U"
z"

^
>aF<J < 0z 8
create procedure sys.sp_updatestats
	@resample char(8)='NO'
as
	
	declare @dbsid varbinary(85)
	
	select@dbsid = owner_sid
		from sys.databases
		where name = db_name()

	-- Check the user sysadmin
	if not is_srvrolemember('sysadmin') = 1 and suser_sid() <> @dbsid
	begin
		raiserror(15247,-1,-1)
		return (1)
	end
	-- cannot execute against R/O databases  
	if DATABASEPROPERTYEX(db_name(), 'Updateability')=N'READ_ONLY'
	begin
		raiserror(15635,-1,-1,N'sp_updatestats')
		return (1)
	end

	if upper(@resample)<>'RESAMPLE' and upper(@resample)<>'NO'
	begin
		raiserror(14138, -1, -1, @resample)
		return (1)
	end

	-- required so it can update stats on ICC/IVs
	set ansi_warnings on
	set ansi_padding on
	set arithabort on
	set concat_null_yields_null on
	set numeric_roundabort off

	declare @exec_stmt nvarchar(4000)		-- "UPDATE STATISTICS [sysname].[sysname] [sysname] WITH RESAMPLE NORECOMPUTE"
	declare @exec_stmt_head nvarchar(4000)	-- "UPDATE STATISTICS [sysname].[sysname] "
	declare @options nvarchar(100)			-- "RESAMPLE NORECOMPUTE"

	declare @index_names cursor

	declare @ind_nae sysname
	declare @ind_id int
	declare @ind_rowmodctr int
	declare @updated_count int
	declare @skipped_count int

	declare @sch_id int
	declare @schema_name sysname
	declare @table_name sysname
	declare @table_id int
	declare @table_type char(2)
	declare @schema_table_name nvarchar(640) -- assuming sysname is 128 chars, 5x that, so it's > 128*4+4

	declare @compatlvl tinyint

	declare ms_crs_tnames cursor local fast_forward read_only for
		select name, object_id, schema_id, type from sys.bjects o
		where o.type = 'U' or o.type = 'IT'
	open ms_crs_tnames
	fetch next from ms_crs_tnames into @table_name, @table_id, @sch_id, @table_type

	-- determine compatibility level
	select @compatlvl = cmptlevel from sys.sysdatabases where name = db_name()

	while (@@fetch_status <> -1) -- fetch successful
	begin
		-- generate fully qualified quoted name
		select @schema_name = schema_name(@sch_id)
		select @schema_table_name = quotename(@schema_name, '[') +'.'+ quotename(rtrim(@table_name), [')

		-- check for table with disabled clustered index
		if (1 = isnull((select is_disabled from sys.indexes where object_id = @table_id and index_id = 1), 0))
		begin
			-- raiserror('Table ''%s'': cannot perform the operation on the table because its clustered index is disabled', -1, -1, @tablename)
			raiserror(15654, -1, -1, @schema_table_name)
		end
		else
		begin
			-- filter out local temp tables and Hekaton tables
			-- Note that OBJECTPROPERTY returns NULL on type="IT" tables, thus we nly call it on type='U' tables
			if ((@@fetch_status <> -2) and 
			   (substring(@table_name, 1, 1) <> '#') and		-- temp tables
			   ((@table_type<>'U') or (0 = OBJECTPROPERTY(@table_id, 'TableIsInMemory'))))	-- Hekaton tables
			begin
				-- reset counters for this table
				select @updated_count = 0
				select @skipped_count = 0

				-- print status message
				--raiserror('Updating %s', -1, -1, @schema_table_name)
				raiserror(15650, -1, -1, @schema_table_name)

				-- initial statementpreparation: UPDATE STATISTICS [schema].[name]
				select @exec_stmt_head = 'UPDATE STATISTICS ' + @schema_table_name + ' '

				-- using another cursor to iterate through
				-- indices and stats (user and auto-created)
				set @index_names = cursor local fast_forward read_only for
					select name, indid, rowmodctr from sys.sysindexes
					where id = @table_id and indid > 0 and indexproperty(id, name, 'ishypothetical') = 0
					order by indid

				open @index_names
				fetch @index_names into ind_name, @ind_id, @ind_rowmodctr

				-- if there are no stats, skip update
				if @@fetch_status < 0
					--raiserror('    %d indexes/statistics have been updated, %d did not require update.', -1, -1, @updated_count, @skipped_count)
					raiserror(15651, -1, -1, @updated_count, @skipped_count)
				else 
				begin
					while @@fetch_status >= 0
					begin
						-- create quoted index name
						declare @ind_name_quoted nvarchar(258)
						select @ind_name_quoted = quotename(@ind_name, '[')

					-- reset options
						select @options = ''

						declare @is_ver_current bit
						select @is_ver_current = stats_ver_current(@table_id, @ind_id)

						-- note that <> 0 should work against old and new rowmodctr logic (when it is always > 0)
						-- also, force a refresh if the stats blob version is not current
						if ((@ind_rowmodctr <> 0) or ((@is_ver_current is not null) and (@is_ver_current = 0)))
						begin
							select @exec_stmt = @exec_stmt_head + @ind_name_quoted

							- add resample if needed
							if (upper(@resample)='RESAMPLE') select @options = 'RESAMPLE '
							
							if (@compatlvl >= 90)
								-- put norecompute if local properties are set to AUTOSTATS = OFF
								-- note that ind name is unique within the object
								if ((select no_recompute from sys.stats where object_id = @table_id and name = @ind_name) = 1)
								begin
									if (len(@options) > 0) select @options = @options + ', NORECOMPUTE'
									else select @options = 'NORECOMPUTE'
								end

							if (len(@options) > 0)
								select @exec_stmt = @exec_stmt + ' WITH ' + @options

							--print @exec_stmt
							exec (@exec_stmt)
							--raiserror('    %s has been updated...', -1, -1, @ind_name_quoted)
							raiserror(15652, -1, -1, @ind_name_quoted)
							select @updated_count = @updated_count + 1
						end
						else
						begin
							--raiserror('    %s, update is not necessary...', -1, -1, @ind_name_quoted)
							raiserror(15653, -1, -1, @ind_name_quoted)
							select @skipped_count = @skipped_count + 1
						end
						fetch @index_names into @ind_name, @ind_id, @ind_rowmodctr
					end
					--raiserror('    %d index(es)/statistic(s) have been updated, %d did not require update/disabled.', -1, -1, @updated_count, @skipped_count)
					raiserror(15651, -1, -1, @updated_count, @skipped_count)
				end
				deallocate @index_names
			end
		end
		print ' '
		fetch next from ms_crs_tnames into @table_name, @table_id, @sch_id, @table_type
	end
	raiserrr(15005,-1,-1)
	deallocate ms_crs_tnames
	return(0) -- sp_updatestats
<
}Yn>aFc) 	)G0-zG@resample)
c7>aFk)U
)$6z$@resample)
"
T>a	Ft"a"z"
<LÃg>a
Ft"a
"z"
<LÃgPaFNa_h((0o

-	@ o'om
 s,. qL'̾LF3fF,CREATE/ALTER PROCEDURE>qF>qFi%"!"T00P Tsp_createstats"
q>>qF] "U"*=&*sp_createtats"
!@>qF"U"*s&*sp_createstats"
-2d%>qFz"a"
"
Gބ>qF<cKc
 Dz
 @qF<PqF<m sys.>q	F<q	<Af e&me<>q
F<q
<Ah
create procedure sys.sp_createstats
	@indexonly		char(9)= 'NO',     -- Optional 'INDEXONLY' text - if present, then only the columns
					-- covered by indexes are subject of statistics creation
	@fullscan		char(9)= 'NO',      -- Optional 'FULLSCAN' text - if present, then the statistics
					- will be created with full scan rather than sampling
	@norecompute	char(12)= 'NO'      -- Optional 'NORECOMPUTE' text - if present, then statistics
				-- will not be updated automatically
as

	--	NOTE: This sp will create statistics for *all* columns of all tables
	--	which the user has the privilege to create stats on (sysadmin, dbo, owner).
	--	The following columns are not considered
	--	- first column of an index
	--	- column which already has statistics
	--	- XML column
	--	- filestream clumn
	--	- sparse column in a wide-table (a table with a sparse column set)
	--	- nondeterministic computed columns
	--  - imprecise computed columns

	declare @sysadmin int
			,@dbname sysname
	select @indexonly = UPPER (@indexonly collate Latin1_General_CI_AS)

	-- Validate input options
	if (@indexonly not in ('INDEXONLY', 'NO') OR
		UPPER(@fullscan) not in ('FULLSCAN', 'NO') OR
		UPPER(@norecompute) not in ('NORECOMPUTE', 'NO'))
	begin
		raiserror(15600,-1,-1, 'sys.sp_createstats')
		retrn @@error
	end
		
	-- remember dbname
  	select @dbname = db_name()

	-- create temporary table (column, index position)
	create table #colpostab
	(	col_name  sysname collate catalog_default,
		col_pos	  int,
	)

	set nocount on

	-- required for sp_createstats so it can create stats on on ICC/IVs
	set ansi_warnings on
	set ansi_padding on
	set arithabort on
	set concat_null_yields_null on
	set numeric_roundabort off

	declare @exec_stmt nvarchar(4000)
	declare @tablename sysname
	dclare @columnname sysname
	--declare @shortcolumnname sysname
	declare @indexname sysname
	declare @uid int
	declare @indid smallint
	declare @position smallint
	declare @table_id  int
	declare @table_type char(2)
	declare @schema_name sysname
	declare @numcols int   -- number of eligible columns found
	declare @msg nvarchar(388) -- adding two more chars for msg with 15654
	declare @twopart_tablename nvarchar(517)
	declare @timestamp varchar(17)
	declare @wide_table bit

	declare @tablename_eader varchar(267)

	declare ms_crs_tnames cursor local static for
		select o.name, o.object_id, s.principal_id, s.name, o.type
		from sys.objects o
		join sys.schemas s on s.schema_id = o.schema_id
		where o.type = 'U' or o.type = 'IT'

	select @numcols = 0
	-- cannot execute against R/O databases  
	if DATABASEPROPERTYEX(db_name(),N'Updateability')=N'READ_ONLY'
	begin
		raiserror(15635,-1,-1,N'sp_createstats')
		return (1)
	end

	open ms_crs_tnames
	fetch next from ms_crs_tnames into @talename, @table_id, @uid, @schema_name, @table_type

	while (@@fetch_status <> -1)
	begin
		-- check for table with disabled clustered index
		if (1 = isnull((select is_disabled from sys.indexes where object_id = @table_id and index_id = 1), 0))
		begin
			-- raiserror('Table ''%s'': cannot perform the operation on the table because its clustered index is disabled', -1, -1, @tablename)
			-- note that we cannot use '%s' in the sqlerrorcodes.h as the same error is reused by sp_create|updatestats and hey have
			-- different formatting styles. This style is consistent with the rest of the messages in this SP
			select @msg = ''''+ @dbname +'.'+ @schema_name +'.'+ @tablename + ''''
			raiserror(15654, -1, -1,  @msg)
		end
		else
		begin
			-- filter out local temp tables, Hekaton tables, and tables for which current user has no permissions
			-- Note that OBJECTPROPERTY returns NULL on type="IT" tables, thus we only call it on type='U' tables
			if (
			   (@@fetch_status <> -2) and 
			   (sbstring(@tablename, 1, 1) <> '#') and -- temp tables
			   ((@table_type<>'U') or (0 = OBJECTPROPERTY(@table_id, 'TableIsInMemory'))) and -- Hekaton table
			   ((is_member('db_owner')=1) or (is_member('ddl_admin')=1) or (is_member(user_name(@uid))=1) or (user_id() = @uid))) -- permissions
			begin
				select @wide_table = objectproperty(@table_id, 'tablehascolumnset')
			
				-- these are all columns for which the statistics will be created
				declare ms_crs_cnames cursor local for select c.name fom sys.columns c
					where c.object_id = @table_id
					and (type_name(c.system_type_id) not in ('xml'))
					and c.name not in (select col_name from #colpostab where col_pos = 1)
					and ((c.name in (select col_name from #colpostab)) or (@indexonly <> 'INDEXONLY'))
					and (@wide_table=0 or is_sparse=0)
					and (is_filestream=0)
					and (is_computed = 0 
						or (is_computed = 1 
							and columnproperty(@table_id, c.name, 'isdeterministic') = 1
							and columnproperty(@table_id, c.name 'isprecise') = 1))

				-- populate temporary table of all (column, index position) tuples for this table
				truncate table #colpostab

				-- for each index on the table, loop though all columns and insert rows
				-- open cursor over indexes
				declare ms_crs_ind cursor local static for
					select stats_id, name from sys.stats
						where object_id = @table_id order by stats_id

				select @twopart_tablename = quotename( @schema_name , '[')+'.' + quotename( @tablename, '[')

				open ms_rs_ind
				fetch ms_crs_ind into @indid , @indexname

				-- if an index exists
				while @@fetch_status >= 0
				begin
					-- if the index is not disabled and not a columnstore or if there is no entry in sys.indexes for current @indid 
					-- (we are looking at a statistic not an index) then we need to include the columns of that statistic in #colpostab
					if not exists (select * from sys.indexes where object_id = @table_id and index_id = @indid and (is_disabled = 1 or type in (5, 6)))
					bgin
						-- every index has at least one column at position 1
						insert into #colpostab values (index_col(@twopart_tablename,@indid,1),1)
						-- now try position 2 and beyond....
						select @columnname = index_col(@twopart_tablename, @indid, 2)
						select @position = 2
						while (@columnname is not null )
							begin
								insert into #colpostab values (@columnname,@position)
								select @position = @position +1
								select @columnname = index_col(@twopart_tablename, @indid, position)
							end
					end
					-- next index
					fetch ms_crs_ind into @indid , @indexname

				end
				close ms_crs_ind
				deallocate ms_crs_ind

				-- now go over all columns which are eligible for creating statistics
				-- and are not first columns of any index
				-- optionaly we test if they are covered by some index (as non-leading)
				

				open ms_crs_cnames

				fetch next from ms_crs_cnames into @columnname
				if @@fetch_status < 0
				begin
					select @msg = @dbnam +'.'+ @schema_name +'.'+ @tablename
					raiserror(15013,-1,-1,@msg)
				end
				else
				begin
					select @msg = @dbname +'.'+ @schema_name +'.'+ @tablename
					raiserror(15018, -1, -1, @msg)
				end

				while @@fetch_status >= 0
				begin
					select @numcols = @numcols +1
					-- use the column name as the name for the statistics as well
					select @exec_stmt = 'CREATE STATISTICS ' +  quotename(@columnname, '[')  + ' ON ' +
					quotename( @schema_name ,'[')+'.' + quotename( @tablenam, '[')+'('+ quotename( @columnname, '[')+')'
					-- determining the correct suffix
					if ((UPPER(@fullscan) = 'FULLSCAN') AND (UPPER(@norecompute) = 'NORECOMPUTE'))
						select @exec_stmt = @exec_stmt + ' WITH FULLSCAN, NORECOMPUTE'
					else if (UPPER(@fullscan) = 'FULLSCAN') select @exec_stmt = @exec_stmt + ' WITH FULLSCAN'
					else if (UPPER(@norecompute) = 'NORECOMPUTE') select @exec_stmt = @exec_stmt + ' WITH NORECOMPUTE'
					EXEC (@exec_stmt)
					--print 'Statement='+@exec_stmt
					if(@@error = 0)  -- otherwise the CREATE STATS will give a me>qF}<R<Ae&<>qF}<q<Assage
						print '     ' + @columnname
					fetch next from ms_crs_cnames into @columnname
				end
				close ms_crs_cnames
				deallocate ms_crs_cnames
			end
		end
		fetch next from ms_crs_tnames into @tablename, @table_id, @uid, @schema_name, @tabletype
	end

	print ' '
	raiserror(15020,-1,-1,@numcols)

	deallocate ms_crs_tnames

	if (object_id('[#colpostab]') is not null)
	begin
		drop table [#colpostab]
	end

	return(0) -- sp_createstats
>q
F;< -<D0 D8e&h>!}<
7+_>qFbL)!
)I0-	I@indexonly)
η>qF&K)!)&6&@indexonly)
|͕>qFbM)q)G0-	G@fullscan)
.=V>qF&K)q)$6$@fullscan)
ccm>qFN)q)M0-M@norecompute)
Z>qF&M)q)*6*@norecompute)
lI2>qFi%"q""
q>qFi%"q""
qPqFqf,+(+*)`)(0('&$@$ ((0b_ ee@ec,rutbheuo-s.QLF3mFINVOKEALTF=P>Ft"a"$"=P"
P*>Fk)U)
=P>)
x / >Fk))t=P
)
L)>Fk))ra=P)
aX̟>Ft""
=P"
P*>PFm 0880F<PqF<|i/LF3pFINVOKEALTFz>Ft""$N"z"
<LÃg>Fc)a)
z>)
c7 >Ft""
tz"
<LÃg
LPFpr080)
aX̟>Ft""
=P"
P*>PFm 0880F<PqF<{C	LF3sFINVOKEALTF>Fi%"q"$""
q>FbL)q)
>)
η >FbM))t")
.=VP>FbN))r)
Z>Fi%""
"
q>PFs 0880F<PqF<2(*.)7A"5-=HA"8)5!-!=I)N"5-=o""
5-="B+!&"B	"B	
"B
"B"kB
"B
"B"B"	2B"
B"B")O5Q-Q=)B)B)B)B)B)B)B)B)B)	B)
B ) B!)B")
B #)B!$)B"%)J"5-=f""'<h5j-q=$(<O)<-=@K<:@,<:@-<:@.<:@/<@0<`A"MF(0'`&%$# #P"! @p0` P@p0
`
	 	P@p0FbM)q)G0-	G@fullscan)
.=V>qF&K)q)$6$@fullscan)
ccm>R*0:70A"5-=HA"8rt2M20HA"8,UQLF3уF(DBMgr::ChangeDBState>F	cR$@0]E>F	cr:0ChangeDBState>F	cR$@0z
UUQ@F+%0r:0ChangeDBState>F	cR$@0#QPFу0r:0ChangeDBState>F	cR$@08	
q/LF3F"CREATE/ALTER VIEWaeFUpT>Ft""p00UpTV pdm_exec_query_optimizer_info"
11>F)" "F&UpTFd_exec_query_optimizer_info"
Wz>F" "F&UpTFdm_exec_query_optimizer_info"
F>Fz"q"
UpT"
#1>FQ<<0UpT 8CREATE VIEW sys.dm_exec_query_optimizer_info AS
	SELECT *
	FROM OpenRowSet(TABLE OPTIMIZERINFO)
<
e>F4)!)C0-UpT@@Ccounter)
30*>FV)a	) 6UpT counter)
>?>	F5))I0-UpTIoccurrence)
,>
FW)	)&6UpT&occurrence)
7
_>F6)
)?0-UpT>>5?value)
*G>FX))6UpTvalue)
C">
Ft""UpT"
11>Ft""UpT"
11PFHP(xPhP0
m
d0LF3.FINVOKEALTFUpT>Ft""$.UpT"
11 >F4))_nUpT)
30*>F5))xcUpTo)
,fo>F6))UpT)
*Gc_q>Ft""
FUpT"
11"PF.0880<0UpT 8CREATE VIEW sys.dm_exec_query_optimizer_info A*l'(I'LF3F"CREATE/ALTER VIEWFFy>Ft""^00yV ^dm_qn_subscriptions"
=>F;""4&y4dm_qn_subcriptions"
Fx('
,>F)""4&y4dm_qn_subscriptions"
=bH>Fz""
pTy""
Ӣ/b9APLF3FFSplitPage2F+< -
s.
+ery_op2F<4 
IM

2	FQ< 
4
Q>
F<qc
C@co
@F<PF<Q>?2
F<
7

>F<e0} K8create proc sys.sp_fulltext_catalog
    @ftcat      sysname,        -- full-text catalog name
    @action     varchar(20),    -- create | drop | | rebuild | ...
    @path       nvarchar(101) = null    -- optional file path for create (max of 100 chars!!!)
as
    declare @objname sysname,
            @tabname    nvarchar(517),
            @schemaname nvarchar(517)

    declare @execstring nvarchar (4000)

    set nocount on

    -- sp_fulltext_catalog willrun under read committed isolation level --
    set transaction isolation level READ COMMITTED

    -- CHECK PERMISSIONS (must be a dbowner) --
    if (is_member('db_owner') = 0)
    begin
        raiserror(15247,-1,-1)
        return 1
    end

    if (db_name() in ('master','tempdb','model'))
    begin
        raiserror(9966, -1, -1)
        return 1
    end

    -- VALIDATE PARAMS --
    if @action is null
        OR @action not in ('create','drop','start_full','start_incremental','sto','rebuild')
        OR @ftcat is null OR datalength(@ftcat) = 0 -- allow spaces in the name, but not a 0-length string
        OR (@path is not null and @action <> 'create')
        OR (len(@path) > 100)
    begin
        raiserror(15600,-1,-1,'sys.sp_fulltext_catalog')
        return 1
    end

    -- DISALLOW USER TRANSACTION --
    set implicit_transactions off
    if @@trancount > 0
    begin
        raiserror(15002,-1,-1,'sys.sp_fulltext_catalog')
        return 1
    end

    declar @ftcatid smallint
    select @ftcatid = fulltext_catalog_id from sys.fulltext_catalogs where name = @ftcat
    if @action not in ('create', 'drop') and @ftcatid is null
    begin
		declare @curdbname sysname
		select @curdbname = db_name()
		declare @curdbnamelen int
		select @curdbnamelen = LEN(@curdbname)
		raiserror(7641,-1,-1,@ftcat, @curdbnamelen, @curdbname)
        return 1
    end

    if @action = 'create'
    begin
        -- CREATE FULLTEXT CATALOG --
        select @execstring ='CREATE FULLTEXT CATALOG '
            + quotename( @ftcat, '[')
            + CASE
                when @path is null then ''
                else ' IN PATH '''+REPLACE(@path ,N'''',N'''''')+''''
              END

        EXEC (@execstring)
    end

    if @action = 'drop'
    begin
        -- build  DROP FULLTEXT CATALOG --
        select @execstring = 'DROP FULLTEXT CATALOG '
            + quotename( @ftcat, '[')

        EXEC (@execstring)
    end


    if @action = 'start_full'
   begin
        -- FIND all the table and start full crawl --
        declare ms_crs_ftind cursor static local for
            select T.name, schema_name(T.schema_id)
            from  sys.fulltext_indexes as FT join sys.objects as T on(FT.object_id = T.object_id)
            where FT.fulltext_catalog_id = @ftcatid
        open ms_crs_ftind
        fetch ms_crs_ftind into @tabname,@schemaname
        while @@fetch_status >= 0
        begin
            select @execstring = 'ALTER FULLTEXT INDEX ON'
                + quotename(@schemaname,'[')+'.'+quotename(@tabname,'[') + ' START FULL POPULATION '
            EXEC (@execstring)

            fetch ms_crs_ftind into @tabname,@schemaname
        end

        deallocate ms_crs_ftind
    end

    if @action = 'start_incremental'
    begin
        -- FIND all the table and start full crawl --
        declare ms_crs_ftind cursor static local for
            select T.name, schema_name(T.schema_id)
            from  sys.fulltext_indexes as FTjoin sys.objects as T on(FT.object_id = T.object_id)
            where FT.fulltext_catalog_id = @ftcatid
        open ms_crs_ftind
        fetch ms_crs_ftind into @tabname,@schemaname
        while @@fetch_status >= 0
        begin
            select @execstring = 'ALTER FULLTEXT INDEX ON '
                + quotename(@schemaname,'[')+'.'+quotename(@tabname,'[') + ' START INCREMENTAL POPULATION '
            EXEC (@execstring)

            fetch ms_crs_ftind into @tabname,@schemaname
        end

        deallocate ms_crs_ftind
    end

    if @action = 'stop'
    begin
        -- FIND all the table and start full crawl --
        declare ms_crs_ftind cursor static local for
            select T.name, schema_name(T.schema_id)
            from  sys.fulltext_indexes as FT join sys.objects as T on(FT.object_id = T.object_id)
            where FT.fulltext_catalog_id = @ftcatid
        open ms_crs_ftind
        fetch ms_crs_ftind into @tabname,@schemaname
        while @@fetch_status >= 0
        begin
            select @execstring = 'ALTER FULLTEXT INDEX ON '
                + quotename(@schemaname,'[')+'.'+quotename(@tabname,'[') + ' STOP POPULATION '
            EXEC (@execstring)

            fetch ms_crs_ftind into @tabname,@schemaname
        end

        deallocate ms_crs_ftind
    end

    if @action = 'rebuild'
    begin
        -- REBUILD FULLTEXT CATALOG --
        select @execstring = 'ALTER FULLTEXT CATALOG '
            + quotename( @ftcat, '[') +' REBUILD '

        EXEC (@execstring)

    end

    return 0    -- sp_fulltext_catalog
<F<	MG>F<Q>FQ<
>F+<<}2F<2FQ2F<2F+<PF>F<<0y 8CREATE VIEW sys.dm_qn_subscriptions AS
	SELECT *
	FROM OpenRowSet(TABLE SYSNOTIFICATIONSUBS)
<
>F&))0-y88
9id)
eR>FH)
)6yid)
xQ>F'))K0-y88
Kdatabase_id)
jQ-v]>FH))(6y(database_id)
\>F());0-yUU;sid)
FsQ>FJ))6ysid)
CG=D>F)))G0-y88
Gobject_id)
8qh$> FJ))$6y$object_id)
{s>!F*) )C0-y==Ccreated)
Rt(>"FH)!) 6y created)
r}%>#F+)")C0-y88
Ctimeout)
@4p>>$FM)#) 6y timeout)
si>%F,)$)A0-y88
Astatus)
K_ۘ>&FM)%)6ystatus)
od>'Ft""y"
=>(Ft"("y"
=PF&H&%P%$($##X"!(!  `PHXx 88009<


    ep Ks(LF3FINVOKEALTFy>Ft")"$y"
= >F&)&)"y>)
eR;>F'))ity")
jQ-v]>>F())d_yc)
FsQ">F)))y")
8qh$P>F*))yg)
Rt(>F+))y)
@4p>
>	F,)	)y)
K_ۘc>
Ft""
y"
=PF
088880
7

>F<<
=LF3F"CREATE/ALTER VIEWFF
$>Fi*""|00
$V |dm_exec_query_transformation_stats"
6*\];>F*""R
$Rdm_exec_query_transformation_stats"

Tza+)>F""R&
$Rdm_exec_query_transformation_stats"
5=LQ)>Fz""

$"
8>F<<0
$ 8REATE VIEW sys.dm_exec_query_transformation_stats AS
	SELECT *
	FROM OpenRowSet(TABLE SYSRULESTATS)
<
y>F) )=0-
$@4@=name)
YQ>F&h)q)6
$name)
1&0>	F))O0-
$Opromise_total.)
t  >
F&i)	),  6
$,promise_total)
r{  nvar>F)
)K!!0-
$>>5Kpromise_avg))
@name n>F&i))(ou6
$(promise_avg)
5Лte>
F))EED0-
$Epromisedr(')
x#jeg>F&k)
)"f 6
$"promisedmo)
y     r>F))UAR0-
$Ubuilt_substitutel',)
H`to>F&h))2al6
$2built_substitute
 )
l`t null>F))G  0-
$Gsucceeded
)
afrkAL>F&m))$ra6
$$succeeded)
gxqsp_ful>Fi*""   sel
$"
6*\]g_id f>Fi*""', dro
$"
6*\]begin
PFmelen @@

H	P (p0)
		raiserror(7641,-1,-1,@ftcat, @curdbnamelen, @curdbname)
        return 1
    end

    if @action = 'create'
    begin
        -- CREATE FULLTEXT CATALOG --
        select @execsC&"LF32FINVOKEALTF
$>Fi*""$2
$"
6*\] >F))ai
$s)
YQ;>F))

$c)
tsfo>F))
$)
@>F))t
$
)
x#j>F))

$>)
H`>F))E VEW 
$er)
afrk AS
	>	Fi*""

$"
6*\]PF2e88880>F&h)q)6
$name)
1&0>	F))O0-
$;n:<'-LF3F"CREATE/ALTER VIEWFFU}>Ft ""p00U}V pdm_exec_background_job_queue"
200>F)""F&U}Fd_exec_background_job_queueo"
r6=C>F""F&U}Fdm_exec_background_job_queue"
B[V>Fz ""
U}"
~">F<a<H0U} 8CREATE VIEW sys.dm_exec_background_job_queue AS
	SELECT *
	FROM OpenRowSet(TABLE DM_EXEC_BACKGROUND_JOB_QUEUE)
<
ue>
c')>
c')6);>Fc)	)K0-U}==Ktime_queued)
\G>Fu)')(6U}(time_queued)
ȕ6  >Fc))A  0-U}88
Ajob_id  )
iT>
Fu))6U}job_idr)
FLF3FFSplitPage2F)] 

o2Fc)

$
c2F)!
)
#jeg6F)Je>F)
c, r>F)c,
@
(6F
l)7e
@F)6cJePF()c-2F()&

(>F()dGC?GEAEE?GE;K?AIGGUICCMGQ?A?AKKKKKKCQGCIS=AAEMOIIOEMISKGS??UcIEGGIE[[GMWaOYSq{uKKS_KUKSEKOI]QUCA0-zG@resample0-XCkeyword0-X88
?colid0-X88
GunusedPid0-XEdocidmaxdbn0-X88
Adupseq be0-XEdocidminC&-XEdoccount   0-X?docid 0-X	88
Gdoclength 0-X
88
Eocccount = 0-X88
;occ-0-X88
KinternalPidt0-X88
?@dbid
0-X88
A@objid ta0-X88
I@compleveloca0-7G@rolename 0-v%88
Gobject_id=0-v%44Uprocedure_numberrs_0-v%@Idefinitione @0-,+@C@cookie 0-Ckeyword,0-@@Mdisplay_termC (0-88
Gcolumn_ide0-Qdocument_countart0-88
?@dbidr0-88
A@objid fo0-VJ?@name 0-VJbbPA@valueobj0-VJK@level0type
0-VJK@level0namen0-VJK@level1typee0-VJK@level1namen0-VJK@level2type 0-VJK@level2name,0-9bC@dbnamed0-9b00Q@new_cmptlevelull0-dG@acctname 0-d
C@option.0-d
I@privileged)
0-sxxSpermission_name 0-s=typeile0-sxA@levelng 0-sA@permsnam0-$E@devtype EX0-$M@logicalname
  0-$O@physicalnamei0-$44I@cntrltypexec0-$(I@devstatus +'0-$$Oag_replica_idl0-$$Eag_db_id0-Mrecovery_lsn0-00Isync_state0-

hhS@createNewState0-

88
K@newstateid0-

88
G@parentid0-

88
S@phraseIdOrNull0-

?@term0-

88
?@lcid0-

hhU@newStateCreated0-

hhc@duplicateThesaurusRuleO0-Y
I@functname0-YE@dllname0-_G@rolename0-_G@password0-7$$Ireplica_id0-7$$Egroup_idda0-788
[replica_metadata_id0-74[replica_server_name0-7UUGowner_sid0-74Mendpoint_urlF0-700Wavailability_mode0-7xxaavailability_mode_desc0-7	00Ofailover_modei0-7
xxYfailover_mode_desc0-788
Ssession_timeout0-700qprimary_role_allow_connectionscr0-7
x4x{primary_role_allow_connections_desc0-700usecondary_role_allow_connections-0-7x4xsecondary_role_allow_connections_desc0-7==Kcreate_date0-7==Kmodify_date0-788
Sbackup_priority0-74_read_only_routing_url0-Z88
Kdatabase_id0-Z88
Uencryption_state
0-Z==Kcreate_date0-Z==Sregenerate_date0-Z==Kmodify_date#0-Z==Eset_date0-Z==Kopened_date0-Z4Okey_algorithm0-Z	88
Ikey_length0-Z
]encryptor_thumbprint0-Z4Qencryptor_type0-Z;;Upercent_complete0-әC@action0-әbbPA@value<Fc)(b>Fc)(>F)c(>Fo))z(2F()2 F)2!Fc)2"F)PF>Fc)")K0-U}88
Kdatabase_id)
EX>%Fu))(6U}(database_id)
3_P<>&Fc)%)I0-U}̀88
Iobject_id1)
}5->'Fw)&)&6U}&object_id1)
H^>(Fc)')I0-U}88
Iobject_id2)
^}!>)Fx)()&6U}&object_d2)
„v>*Fc	)))I0-U}88
Iobject_id3)
dp>+Fy)*)&6U}&object_id3)
i>,Fc
)+)I0-U}88
Iobject_id4)
>-Fz),)&6U}&object_id4)
ƫh>.Fc)-)I0-U}88
Ierror_code)
`w>/Fv).)&6U}&error_code)
Q&>0Fc)/)M0-U}	44Mrequest_type)
u{>1F|)0)*6U}	*request_type)
>2Fc
)1)K0-U}
44Kretry_count)

[A>3F})2)(U}
(retry_count)
MN.>4Fc)3)K0-U}44Kin_progress)
0>5Fw)4)(6U}(in_progress)
i>6Fc)5)I0-U}44Isession_id)
Ⱦ>7F)6)&6U}&session_id)
{>8Ft ""U}"
200>9Ft "9"U}"
200PF9(98(876@655x43@322X10 0/.`.-(-x, ,++x+@+**0*)
p
8
		X		x0xP`hP0x6\io0Ko
m*
<g$LF3FINVOKEALTFU}>Ft ":"$U}"
200 >Fc)7)qeU})
\G>Fc))xcU}o)
iTueo>Fc))U})
EXc_b>Fc))FU})
}5->Fc))U}<)
^}!U}>Fc	))ECT*
U}et)
dpUND_JO>	Fc
)	)U})
\
>
Fc)
)U}>)
`w>Fc))U}	e)
u{)>Fc
))U}
)

[Aued>
Fc)
)U}-)
0>Fc))FU})
Ⱦ>Ft ""
FU}"
200PF888888802Fc)

$
c2F)!
)
#jeg6F)Je>F)
c, r>F)c,
@
(6F
l)7e
@"$
5LF3F"CREATE/ALTER VIEWFF>
t("6">FtP""|00V |dm_exec_background_job_qeue_stats"

FI
i>F*""R&Rdm_exec_background_job_queue_stats"
f?>F""R5&Rdm_exec_background_job_queue_stats"
71]b<>FzQ""
"
FƏ
U}>Fq<'<
0 8CREATE VIEW sys.dm_exec_background_job_queue_stats AS
	SELECT *
	FROM OpenRowSet(TABLE DM_EXEC_BACKGROUND_JOB_QUEUE_STATS)
<
AzF}>	F7:)O)O0-88
Oqueue_max_len)
{>
F%)I)6,queue_max_len)
7M,[>F7;)
)Q0-88
Qenqueued_count))
Uj¢>F%)).6.enqueued_count)
r ߅>
F7<))O0-88
Ostarted_count)
>'>F%)
),6,started_count)
d>F7=))K0-88
Kended_count)
	tK>F%))(
6(ended_count)
;͖>F7>))W0-88
Wfailed_lock_count)
8b>F%))464failed_lock_count)
cGCAEE>F7?))YA0-88
Yfailed_other_countE)
حLljk-z>F%))666failed_other_countr)
6E>F7@))[0-88
[failed_giveup_count)
!'gbn0->F%))868failed_giveup_count)
_=>F7A))g0-88
genqueue_failed_full_counto)
"~>F%))D6Denqueue_failed_full_count)
*t//x>F7B))q0-	88
qenqueue_failed_duplicate_count
)
QIVI>F%))N6	Nenqueue_failed_duplicate_countb)
P%r>F7C))Qb0-
88
Qelapsed_avg_mse @)
gf1>F%))6
.elapsed_avg_ms)
 x>F7D))Q0-88
Qelapsed_max_ms)
Hw=ent>F%)).d6.elapsed_max_ms)
&d>FtP""bb"

FIA> FtP" "el0t"

FIPFPXx
 `

	HP0P0K@level1namen0-VJK@level2type 0-VJK@level2name,0-9b.,uLF37 FINVOKEALTF>FtP"!"$7"

FI>F7:))0)
{>F7;))es")
Uj¢>>F7<))d_c)
>'_qu>F7=))")
	tK>F7>))"<)
8b>F7?))Ə
)
حLljk>	F7@)	)ys.m_e_j)
!'gLECT *>
F7A)
)
A)
"~>F7B))O	a)
QIV
>F7C))
q)
gf1n>
F7D)
)-)
Hw=>FtP""
>"

FIPF7 )08888880F7<))O0-88
00 j\LF3&F"CREATE/ALTER VIEWFFg>Fi	"
"f00gV fdm_db_index_usage_stats"
I#^H >F(""<&g<dm_dbindex_usage_stats"
Š(P>>F""<d&g<dm_db_index_usage_stats"
f$q>Fz""
g"
L>F<&<0g 8CREATE VIEW sys.dm_db_index_usage_stats AS
	SELECT database_id, object_d, index_id, 
		user_seeks, user_scans, user_lookups, user_updates, 
		last_user_seek, last_user_scan, last_user_lookup, last_user_update,
		system_seeks, system_scans, system_lookups, system_updates, 
		last_system_seek, last_system_scan, last_system_lookup, last_system_update
		FROM OpenRowSet(TABLE LOGINDEXSTATS)
	WHERE status = 0
<
\ǒԻ>F6?) 
)K
0-g44Kdatabase_id)
ƌq>Fe)U)(6g(database_id)
~;S>	F6@))G0-g88
Gobject_id)
Z0>
Ff)	)$6g$object_id)
W.Ҝ>F6A)
)Ee0-g88
Eindex_id)
䃔>Ff))"6g"index_id)
-Wf>
F6B))I0-gIuser_seeksF)
~>Fh)
)&)g&user_seeks)
L:>F6C))I0-gIuser_scans)
bߊ\r>Fh))&k6g&user_scansE)
`'>F6D))M0-gMuser_lookups)
>Fh))*6g*user_lookupsn)
Ƈ8mHE>F6E))M0-gMuser_updatesp_)
{}>Fk))*6g*user_updatese)
W1FIUunt>F6F))Q0-g==Qlast_user_seekqu)
A$ful>Fg)).6g.last_user_seek)
Zajce>F6G))Q0-g	==Qlast_user_scan)
(>Fg)).6g	.last_user_scan)
P>F6H))U_0-g
==Ulast_user_lookupC)
`>Fg))2l6g
2last_user_lookup)
26P%>F6I))Ua0-g==Ulast_user_update)
DZ>Fj))2e6g2last_user_update>)
8>F6J))Md0-gMsystem_seeks)
*>Fl))*6g*system_seeks)
VB-FKt>F6K))M0-g
Msystem_scans
)
Ӯ> Fl))*6g
*system_scansv)
Vn7>!F6L) )Q0-gQsystem_lookups)
3	]Q>"Fl)!).6g.system_lookups)
jB;>#F6M)")Q0-gQsystem_updatesS)
֨-Qnam>$Fo)#).-6gsystem_updatesA)
4gf&>%F6N)$)U0-g==Ulast_system_seek)
vZ5[8M>&Fg)%)26g2last_system_seek44)
{Ǯ>'F6O)&)U0-g==Ulast_system_scanO)
2:14i>(Fg)')2d6g2last_system_scan)
OAolsn>)F6P)()Ya0-g==Ylast_system_lookupe)
-z>*Fg)))66g6last_sytem_lookup
)
{1>+F6Q)*)Y0-g==Ylast_system_update)
+Bt
>,Fj)+)6d6g6last_system_updatec)
a{{h>-Fi	""@fung"
I#^H >.Fi	"."g"
I#^H namPF&x0@8`h(@@
h
(x
@
		P pP@0Egroup_idda0-788
[replica_metadata_id0-74[repls.6i_ LLF3*FINVOKEALTFg>Fi	"/"$g"
I#^H  >F6?),)g^H)
ƌ>F6@))dxgs)
Z0
Š>F6A))dg_)
䃔age>F6B))g)
~>F6C))g)
bߊ\r8>F6D))nde_idgks)
kups, >	F6E)	)_upategek)
{}m_look>
F6F)
)up,lasge
)
A$LE LOG>F6G))g	)
(
>F6H)))g
q)
`>
F6I)
)s_g)
DZ	>F6J))
g)
*id>F6K))g
)
Ӯct_>F6L)))g)
3	]
>F6M))g)
֨-Q)>F6N))>g)
vZ5[8>F6O))userg)
2:14>F6P))g_)
-z
>F6Q))-g)
+Bt>Fi	""
g"
I#^H PF*0
8
	8	888888880M0-gMuse&1[LF3Q0F"CREATE/ALTER VIEWFF>FN"&!"v00V QQvdm_db_missing_index_group_stats"
5j5ƌ>F)""L&Ldm_db_missing_index_group_stats"
Csג>F""L&Ldm_db_missing_index_group_stats"
/I
g>Fz""
C"
Z'W>F< <.0 .8CREATE VIEW sys.dm_db_mising_index_group_stats AS

	SELECT IdxS.index_id as group_handle,
		unique_compiles,

		-- stats for user queries
		user_seeks, user_scans, last_user_seek, last_user_scan,
		case 
			when (user_seeks + user_scans) > 0 
			then total_user_cost / (user_seeks + user_scans)
			else 0 
		end as avg_total_user_cost,
		case 
			when (user_seeks + user_scans) > 0
			then ceiling(total_user_impact / (user_seeks + user_scans) * 10000.0 - 0.5) / 100.0
			else 0 
		end as avg_user_impact,

		-- statsfor system queries
		system_seeks, system_scans, last_system_seek, last_system_scan,
		case 
			when (system_seeks + system_scans) > 0 
			then total_system_cost / (system_seeks + system_scans)
			else 0 
		end as avg_total_system_cost,
		case 
			when (system_seeks + system_scans) > 0
			then ceiling(total_system_impact / (system_seeks + system_scans) * 10000.0 - 0.5) / 100.0
			else 0 
		end as avg_system_impact

	FROM OpenRowset(TABLE LOGINDEXSTATS) IdxS
	WHERE IdxS.status <> 0
<
Vս>F)&!
)MM0-88
Mgroup_handle)

&>F )&!)*6*group_handle)
͉u>	F	))S0-Sunique_compiles)
<>
F 	)	)060unique_compiles)
TY֑>F
)
)I0-Iuser_seeks)
W>F 
))&	6&user_seeks0)
<T>
F))I)0-Iuser_scans)
+`k>F 
)
)&6&user_scans)
&>F))Q_0-==Qlast_user_seek)
ұ>F 	))6.last_user_seek)
u+==>F
))Q0-==Qlast_user_scan)
2%J
>F 	)).6.last_user_scan)
5==>F))[0->>5[avg_total_user_cost)
Nlas>F ))868avg_total_user_cost)

)>F))S
0->>5Savg_user_impact)
BK_us>F 	))06avg_user_impact)
7>F))M)0-	Msystem_seeks)
 v>F 
))*6	*system_seeks))
6!-g>F))M0-
Msystem_scans)
[P>F 
))*6
*system_scans))
63-g>F))U
0-==Ulast_system_seek)
eW\>F ))262last_system_seek)
E>F))U0-==Ulast_system_scan)
R;)s>F ))262last_system_scan-)
񏌂>F))_0-
>>5_avg_total_system_cost)
c9
%a> F ))<6
<avg_total_system_cost)
iyUla>!F) )W0->>5Wavg_system_impact)
>"F )!)464avg_system_impact)
\"Ula>#FN"""
5j5>$FN"$"OAl"
5j5PPFQ0pXp(x8XP

H

P	`0*Fg)))66g6'$0. s.	
'ө
LF3_4FINVOKEALT'F>'FN"%"$Q_"
5j5 >'F)")u_)

&>>'F	)')d_i)
<oup>'F
)'))
WLd>'F)')/
)
+`k>'F)'))
ұ<>'F
)')_inex_
)
2%J
d as g>'	F)'	), uer_er)
N
		ca>'
F)'
)sees +		)
BK_total>'F)')totl_u	us)
 v * 100>'F)')sysem 
te)
[P last_>'
F)'
)) >0 
_s)
eW\eeks +>'F)') (ssteem)
R;)eiling>'F)')
		el
s )
c9
%FROM O>'F)')
V)
>'FN"'"
M"
5j5)P'F_'4888888880le)
͉u>	F	))S0-Sunique_compiles)6d46
,LF3:F"CREATE/ALTER VIEWF,FvLF3;FF
SplitPage2,FM"!

M_2,Ft"

t	2,Fh" 

hi>,F"co
)@
k@,F"P,Fk"t0h2,	Fk",	5

k>,
Fk",
+TPhVt\Rbn^^`TvTNTtX\PRnRjPL^ZLXbfZb\\X|009bЀP *rTsp_dbcmptlevel00d P 4Pxp_logininfo00sIF'?hfn_translate_permissions00$P .rVsp_addumpdevice00V (q(qdm_hadr_internal_wsfc_ag_db_replicas00

P tsp_fulltext_thesaurus_add_term00YP _\sp_addextendedproc00_P BRsp_addapprole007V 
s+sbavailability_replicas00ZV ίndm_database_encryption_keys00әP ^sp_fulltext_service00V r%r^availability_groups00*тX j`sp_releaseschemalock00P Tsp_refreshview00P Gvsp_fulltext_load_thesaurus_file00cGIF>>Tfn_flltext_i400J|P ZNsp_bindruleu00IFTfn_fulltext_i200kXP H0H0tsp_SetSDSPublicInterfaceObject00V HRXdm_audit_actions00P \sp_approlepassword00#P ʦPsp_validlang00%HP rRsp_dropdevice>00>P nsp_check_removable_sysusers00'P ߳uRsp_helprotect00JP &&jsp_SetInternalTableAccess
00
V BBPindex_couns00L%V \zLuser_token00=HX ^sp_recompile_module00`IFаZfn_get_audit_file>00a`P P Lsp_adduser00uP Xsp_dbscriptlevel00GV \zbdm_fts_memor_buffers[00kV afdm_fts_index_population00V Zsecurable_classest001V Gfbdm_os_child_instances-00ǤP s\sp_check_removable00s̆P \sp_resign_database00V ޠ(system_components_surface_area_configuration00BP ]Xsp_addrolemember00V 7|dm_exec_background_job_queue_stats<,Ft(",k)>,Ft",hk>,
Fh",tk
>,FM","_9bk2,Fk",2,Fh",==2,Ft",
e2,FM",P,F,;_sy>,Fk""l00vV ldm_db_missing_index_groups"
oTrlHn>,F*""B&vBdm_db_missing_index_groupss"
܊K
>,F""B&vBdm_db_missing_index_groups_"
ǬM'm_c>Fz?""
v)"
YFB
>,F<< +<y0v 8CREATE VIEW sys.dm_db_missing_index_groups AS
	SELECT *
	FROM OpenRowset(TABLE MISSING_IDX_GROUPS)
v<
	B	9p>,F#)!)Y0-v88
Yindex_group_handle))
Rh>>,F$T) 3)66v6index_group_handle)
3PSV>,F$),)M5j0-v88
Mindex_handle)
dݬpLF3<FFSplitPage)2,F)'

loo2,F$),

$2,F%)

%6, F)f)>,!F),c4>,"F),"c4

{@{h
0-6,#F
)&f@f@,$F)6cfP,%F0)$%2,'F0),'
@
0`>,(F0),(W"*"*0$  &"$(&*:,6$>4&,<@&$:$(6(0:8<:&L$$JNFJH<B"$( ,& .* $&<0H(<@.@0H>V(&6"*6%H"@delfilr6%H*@logicalnameU6>"@autofixi6'*@grantorname6'@name6'0@permissionarea6'$@username6J @object6J @schema6
&data_pages_6
"index_id6
$object_id6
rows6
(total_pages6
&used_agesc6L%name6L%*principal_id_6L%sid6L%type6L%usage6`:@audit_record_offset6`,@file_pattern6`6@initial_file_nameo6`$action_id6`>additional_informationa6`4audit_file_offset6`
&class_type6`,database_name6`	<database_principal_id6`@database_principal_name6`&event_timei6`$file_name6`:is_column_permissiont6`$object_id6`(object_name6`6permission_bitmask6`(schema_name6`0sequenc_number6`:server_instance_name==6`8server_principal_id6`<server_principal_name6`:server_principal_sid6`&session_idt6`Lsession_server_principal_name6`$statement6`$succeeded6`Jtarget_database_principal_ii6`Ntarget_database_principal_nameh6`
Ftarget_server_principal_ido6`Jtarget_server_principal_name6`Htarget_server_principal_sid6`<user_defined_event_id6`Buser_defined_information6a`"@grpname6a`$@loginame6a`(@name_in_db6u @dbname6u,@script_entry6u@value>6G&bytes_used6G is_free6G.memory_address6Gname6G*percent_used6G pool_id6G$row_count6k&catalog_id6k	<completed_range_count6k
0completion_type6kHcompletion_type_description6k(database_id6k<incremental_timestamp6k@is_clustered_index_scan6k.memory_address6k
@outstanding_batch_count6k0population_type6kHpopulation_type_description6k>queued_population_typet6kVqueued_population_type_description6k(range_count6k&start_time
6kstatus6k6status_description6k"table_id6k*worker_count<,)F$U),0U(>,*F$),*%0v>,+F%), $-088>,,F),)$6%H0$@delfile2,-F0),)2,.F%),,2,/F$),+2,0F),-P,F,<>,F$U),0)*j6v*index_handle>)
6>,3Fk","v"
oTrlH>,4Fk",4"v"
oTrlHerrP,F,:/3(32 211X1 10x0 0//P8XXPhPHHX` H0)
u{>1F|)0)*6U}	*request_type)
>2Fc
)1)K0-U}
44Kretry_count)

[A>3F})2deepe,,ytu6GPy8LG3@GINVOKEALTGGv>GGk",5"$v"
oTrlHitP>GG#),)_v)
Rh>GG$)G)vi)
dݬ>GGk"G"
v"
oTrlHPGGG@8802,	Fk",	5

k>,
Fk",
+TPhVt\Rbn^^`TvTNTtX\PRnRjPL^ZLXbfZb\\X|009b
I+,LG3KGG*CREATE/ALTER FUNCTIONIG&>IGt","n00&IFKKndm_db_missing_index_columns"
+1,R>IG)","D&&Ddm_db_missing_index_columns"
6y9>IG","D&&Ddm_db_missing_index_columns"
3#{>IGz","
&
"
g,
>IG< <^0& 8CREATE FUNCTION sys.dm_db_missing_index_olumns (@handle int)
RETURNS TABLE
AS
	RETURN SELECT * 
		FROM OPENROWSET(TABLE MISSING_IDX_COLUMNS, @handle)
<
/(
log>IG$)
)Cn0-&88
C@handle)
h>IGF)8) 6& @handle)
{	Tw>I	G$)I)G-&88
Gcolumn_id)
ēPe>I
GG)I	)$r6&$column_id)
1<:NRsp>IG%)I
)K0-&@4@Kcolumn_name)
t>IGH)I)(6&(column_ame)
dx>I
G&)I)M0-&@4@Mcolumn_usage)
qp>IGI)I
)*6&*column_usagei)
: >IGt"I"rs&"
+1,F>IGt""P &"
+1,NspPIGKIGfulP
	`	 `8pX0H0H0tsp_SetSDSPublicInterfaceObject00V HRXdm_audit_actions00P \sp_approlepassword00#P In0c	OLG3eKGINVOKEALTOG&>OGt"I"$Ke"&"
+1,>OG$)I)_o&)
ēPe>>OG%)O)d_&i)
tlum>OG&)O)"&)
q_db>OG')O)&)
h">OGt"O"
&"
+1,POGeOKlumns 8880URNS TABLE
AS
	RETURN SELECT * 
		FROM OPENROWSET(TABLE MISSING_IDX_COLUMNS, @handle)
<
/(
log>IG$)
)Cn0-&88
C@handle)
h>IGF)8) 6& @handle)
{	Tw>I	G$)I)G*d24RiLG3QG"CREATE/ALTER VIEWGRGWQ)>RGt#"O"n00WQ)V ndm_db_missing_index_details&"
|e>RG*"I"D&WQ)Dd_db_missing_index_details"
%>RG"I"D&WQ)Ddm_db_missing_index_details"
Qf>RGz#"I"
WQ)"
0S/\>RG<<0WQ) 8CREATE VIEW sys.dm_db_missing_index_details AS
SELECT *
	FROM OpenRowset(TABLE MISSING_IDX_DETAILS)
<
=8(T>RG() )M0-WQ)88
Mindex_handle88)
K1-[>RG)I)*6WQ)*index_handle)
+4>R	G()R)K$0-WQ)44Kdatabase_id)
Dumn>R
G)R	)(6WQ)(database_id)
ckK_>RG()R
)G0-WQ)88
Gobject_id)
RI5n>RG)R)$H6WQ)$object_id)
C=icol>
G()R)U&0-WQ)@4@Uequality_columns)
jl͞a>RG)R
)26WQ)2equality_columnsc)
Vi>RG()R)Y0-WQ)@4@Yinequality_columnsG)
 +>RG)R)6p6WQ)6inequality_columns)
)lKLG3RGGpSplitPagebicI2RGo)#

o2RG()R

(2RG)G
s
0#>RG),#c-
g0@H
) @RG)PRG))(-ble2RG))R

)>RG))RcC?GEAEE?GE;K?AIGGUICCMGQ?A?AKKKKKKCQGCIS=AAEMOIIOEMISKGS??UcIEGGIE[[GMWaOYSquKKS_KUKSKEKOI]QUCA0-XCkeyword0-X88
?colid0-X88
GunusedPid0-XEdocidmaxL0-X88
Adupseq0-XEdocidmin0-XEdoccount00-X?docid0-X	88
Gdoclength0-X
88
Eocccount0-X88
;occ0-X88
KinternalPid0-X88
?@dbid0-X88
A@objide0-X88
I@complevelm0-7G@rolename0-v%88
Gobject_id0-v%44Uprocedure_numbera0-v%@Idefinition0-,+@C@cookie0-Ckeyword0-@@Mdisplay_term>0-88
Gcolumn_id0-Qdocument_count0-88
?@dbid0-88
A@objid0-VJ?@name0-VJbbPA@value0-VJK@level0type0-VJK@level0name0-VJK@level1type0-VJK@level1name0-VJK@level2type0-VJK@level2name0-9bC@dbname0-b00Q@new_cmptlevel0-dG@acctname0-d
C@option 0-d
I@privilegeING0-sxxSpermission_name0-s=type0-sxA@level-sA@perms)0-$E@devtypel0-$M@logicalname)0-$O@physicalnamee0-$44I@cntrltype0-$(I@devstatus0-$$Oag_replica_id0-$$Eag_db_id20-Mrecovery_lsn0-00Isync_state0-

hhS@createNewState0-

88
K@newstateid0-

88
G@parentid0-

88
S@phraseIdOrNull0-

?@term0-

88
?@lcid0-

hhU@newStateCreated0-

hhc@duplicateThesaurusRule0-Y
I@functnameH0-YE@dllnamer0-_G@rolename0-_G@password0-7$$Ireplica_id@0-7$$Egroup_idc0-788
[replica_metadata_id0-74[replica_server_name0-7UUGowner_sid0-74Mendpoint_url0-700Wavailability_mode0-7xxaavailability_mode_desci0-7	00Ofailover_mode0-7
xxYfailover_mode_desc`0-788
Ssession_timeout`0-700qprimary_role_allow_connectionsa0-7
x4x{primary_role_allow_connections_desc0-700usecondary_role_allow_connectionsi0-7x4xsecondary_role_allow_connections_desc0-7==Kcreate_date0-7==Kmodify_date0-788
Sbackup_priority0-74_read_only_routing_url0-Z88
Kdatabase_id0-Z88
Uencryption_state0-Z==Kcreate_date`0-Z==Sregenerate_date0-Z==Kmodify_date0-Z==Eset_date0-Z==Kopened_date0-Z4Okey_algorithm0-Z	88
Ikey_length0-Z
]encryptor_thumbprintu0-Z4Qencryptor_type0-Z;;Upercent_completep0-әC@action0-әbbPA@valuek	<RG()R)a>RG()R_)e_d>RG)R()cre>RGo)R)eX)can2RG))R
2RG)Rt2R G()R2R!Go)RpPRGRR>RG()R!)U0-WQ)@4@Uincluded_columns)
s.>R$G)R)26WQ)2included_columns_)
MR)>R%G()R$)G0-WQ)@4@Gstatement)
X3	">R&G)R%)$6WQ)$statement)
|H0>R'Gt#"R"WQ)"
|e>R(Gt#"R("2WQ)"
|ePRGRQ1@10@0//H.---H--,X,,+(
HX

H	p@PhP0j6v*index_handle>)
6>,3Fk","v"
oTrlH>,4Fk",4"v"
oTrlHerrP,F,:09{(R	m4l-WLG3VGINVOKEALTlGWQ)>lGt#"R)"$WQ)"
|e >lG()R&)alWQ))
K1-[>lG()l)bmWQ)i)
Ds>lG()l)WQ))
RI5mis>lG()l)GWQ))
jl͞>lG()l)WQ)<)
 +(WQ)>lG()l)CT 
	WQ)t()
s.ILS)
>l	G()l	)WQ)-)
X3	">l
Gt#"l"
WQ)"
|ePlGlV
+4088880G()R)K$0-WQ)44DoxZLG3O\G*CREATE/ALTER FUNCTIONoGm>oGk"G"d00mIFOOddm_db_stats_properties"
]Z)>oG."R":&m:d_db_stats_properties
"
La}>oG"R":Q)&m:dm_db_stats_properties"
Cx>oGzJ"R"
m>"
k:t>oGT<4<0m 8CREATE FUNCTION sys.dm_db_stats_properties (@object_id int, @stas_id int)
RETURNS TABLE
AS
	RETURN SELECT * FROM OPENROWSET(TABLE DM_DB_STATS_PROPERTIES, @object_id, @stats_id)
<
fQPQ)>oG7))I#0-m88
I@object_id
)
X`.>oG05),.)&46m&@object_id)
۹pc>o	G7)o)Ga0-m88
G@stats_id)
Dvn>o
G06)o	)$)6m$@stats_id)
#ܭ
>oG7)o
)G0-m88
Gobject_id)
<,>oG07)o)$6m$objct_id)
a>o
G7)o)E0-m88
Estats_id)
7c>oG08)o
)"t6m"stats_id
)
P.
c>oG7)o)M0-m**Mlast_updated)
io>oG07)o)*p6m*last_updatedo)
z+EXI
>oG7)o)=0-m=rows)
^>oG09)o)6mrows)
is>oG7)o)M-mMrows_sampled)
5[>oG0:)o)*6m*rows_sampledb)
3>oG7)o)?0-m88
?steps)
Q>oG0<)o)c6msteps)
~/KSK>oG7	)o)S0-mSunfiltered_rows)
pz>oG0=)o)06m0unfiltered_rows)
Rٻ>oG7
)o)]0-m]modification_counterdo)
tuF@>oG08)o):886m:modification_counter-)
dB`'>oGk"o"m"
]Z88>oGk"o"
m"
]ZidPoGOo\888 `
h8

X	(p@XH07G@rolename0-v%88
Gobject_id0-v%44Uprocedure_numbera0-v%@Idefinition0-,+@C@cookie0-Ckeywo0%etm&yqLG3j`GINVOKEALTyGm>yGk"o"$Oj"m"
]Z>yG7)o)ism
)
<,>yG7)y)bsmo)
7c">yG7)y)m)
%ios_p>yG7)y)Jm")
^m>yG7)y)<m)
5[ >yG7)y) in)
m
A)
OM OPE>y	G7	)y	)
QPm)
pz>y
G7
)y
)Im_)
tuF@
X`>yG7)y)4mm@)
X`.)>yG7)y)m)
Dvn>y
Gk"y"
m"
]ZPyGjy`8888880)G0-m88
Gobject_id)
<,>oG07)o)$6m$o2(*}P7+"5-=H*"8}) 5"-)=I})
N}"5-=o}"}"5
-=}"B&"B}	"B	}
"B
}"B}"B}
"B
}"B}"B}"	=B}"
B}"B}"})Q5S-Y=})
B})B})B})B})B})B})B})B})B})	B})
7B} )B}!)B}")
B }#)B!}$)B"}%)J}"5-=f}""}'<i5k-q=$}(<O})<-=@1<E@},<E@}-<E@}.<E@}/<@}0<`2G(0'`&%$# #P"! @p0` P@p0
`
	 	P@p0Kmodify_date0-Z==Eset_date0-Z==Kopened_date0-Z4Okey_algorithm0-Z	8R*:70+"5-=H*"8}xt}2}20H*"8}ҸUQLG3
G(DBMgr::ChangeDBState>G	c$@0k]E>G	c
r:0ChangeDBState>G	c$@0zVUQ@G.%
0
r:0ChangeDBState>G	c$@0V$QPG

0r:0ChangeDBState>G	c$@0%z/0'ؙL	G3ۄ	G"CREATE/ALTER VIEWae	G>	Gt"l"d00V ddm_db_task_space_usage"
3[<g>	G/"o":&:dm_dbtask_space_usage"
[E>	G"o":&:dm_db_task_space_usage"
qc>	Gz"o"
"
m.;Ih>	G<U<0@ 8CREATE VIEW sys.dm_db_task_space_usage AS
	SELECT *
	FROM OpenRowset(TBLE DM_DB_TASK_SPACE_USAGE)
<
͠s>	Gk))M0-Mtask_address)
SIs"&>	G)R')*6*task_address)
4T4>		Gk))Q0-hhQis_remote_task)
}]o>
	G)	).6.is_remote_task)
mF``>	Gk)
)I0-44Isession_id)
J16:c>	G))&6&session_id)
Ws>
	Gk))I0-88
Irequest_id)
rk>	G)
)&6&request_id)
.N2>	Gk))S0-88
Sexec_context_id)
Xj$>	G))060exec_context_id)
Ҏ>	Gk))K0-88
Kdatabase_id)
klDJ>	G))(6(database_id)
=3>	Gk))o0-€ouser_objects_alloc_page_count)
 /<>	G))L6Luser_objects_alloc_page_count)
"H%G>	Gk))s0-suser_objects_dealloc_page_count)
&*L>
)>
)6)R3L
G3܄	G	GSplitPage2
G),1

2
G)

2
G$),3

$>
G)c5
@
1@
G)P
G1)$2 
G1) X

1>!
G1)!$(HR@":4((" &0:"(" "$2*(*." &$(*(*,&".""0&:(&"..B(@" $(* ($    ($"$:&2 &*($(4(&::$(&,::2&"&.(&(&&&&*(&($(22*6$$&"""$( "$$&$2 $*. (((((( .$ &0&&"*,6-'$@loginame6-'(@name_in_db6ʈdHautomated_backup_preference6ʈdRautomated_backup_preference_desc6ʈd@failure_condiion_level6ʈd"group_id6ʈd:health_check_timeout6ʈdname6ʈd4resource_group_id6ʈd(resource_id6(@futureonly6"@objname67 @dbname6co&class_type6co0class_type_desc6co:securable_class_desc6)t"@efname6)t(@futureonly6)t"@objname6}#| @action6"index_id6$object_id6rowset6I<$2@accentsensitive6I<$@lcid6I<$*@querystring6I<$(@stoplistid6I<$*display_term6I<$.expansion_type6I<$"groupid6I<$ keyword6I<$&occurrence6I<$$phrase_id6I<$(source_term6I<$*special_term64B(@ProviderId64B*algorithm_id64B,algorithm_tag64Bkey_id64B&key_length64B"key_name64B.key_thumbprint64B"key_tpe6 E"batch_id6 E
0batch_timestamp6 E&catalog_id6 E:crawl_memory_address6 E(database_id6 E&doc_failed6 E"hr_batch6 E	.is_retry_batch6 E.memory_address6 EBmemregion_memory_address6 E
(retry_hints E@retry_hints_description6 E"table_id6& @handle6&$column_id6&(column_name6&*column_usage6+*@srvrolename6Y@ftcat6y created6y(database_id6yid6y$object_id6ysid6ystatu6y timeout6} @action6}@ftcat6}@path6O @ntname6E @dbName6E(@filegrowth6E$@filename6E"@maxsize6E@name6E@size6XZ$@typename6'
:read_only_replica_id6'
&replica_id6'
routing_priority6UpT counter6UpT&occurrence6UpTvalue6*@srvrolename6W(batch_count6W$fdhost_id6W(fdhost_name6W4fdhost_process_id6W(fdhost_type6W&max_thread6e:@current_compression6e:@deired_compression6e$@index_id6e(@index_name6e&@object_id6e,@sample_table6e:compress_current_ddl6e:compress_desired_ddl6e2create_index_ddl6e&is_primary6>h"ag_db_id6>h&ag_db_name6>hag_id>h.truncation_lsn6U}(database_id6U}&error_code6U}(in_progress6U}job_id6U}&object_id16U}&object_id26U}&object_id36U}&object_id46U}	*request_type6U}
(retry_count6U}&session_id6U}(time_ueued6z$@resample6WQ)(database_id6WQ)2equality_columns6WQ)2included_columns6WQ)*index_handle6WQ)6inequality_columns6WQ)$object_id6WQ)$statement6X&@complevel6X@dbid6X@objid6Xcolid6X"dccount6Xdocid6X"docidmax6X"docidmin6X	$doclength6Xdupseq6X(internalPid6X keyword6Xocc6X
"occcount6X$unusedPid67$@rolename6v%&definition6v%$object_id6v%2procedure_numbe6,+ @cookie6@dbid6@objid6$column_id6*display_term6.document_count6 keyword6VJ(@level0name6VJ(@level0type6VJ(@level1name6VJ(@level1type6VJ(@level2name6VJ(@level2type6VJ@name6VJ@value69b @dbname69b.@new_cmptlevel6d$@acctname6d @option6d&@privilege6s@level6s@perms6s0permission_name6stype6$&@cntrltype6$&@devstatus6$"@devtype6$*@loicalname6$,@physicalname<"
G)1>#
G)#$1>$
G$)1..@.Hhx0H0
(x
	0	p0x8P@0..@.Hhx0H0
(x
	0	pgroq6s2s6y_dt*A_0%]>%
G))&6-'1&@loginame2
G1)"2
G$)%2
G)$2
G)P
G܄>	G))P6Puser_objects_dealloc_page_count)
JU|>	Gk))w0-	winternal_objects_alloc_page_count)
jA.v@>	G))T6	Tinternal_objects_alloc_page_count)
#^nLx>		Gk)){0-
{internal_objects_dealloc_page_count)
^o>
	G)	)X6
Xinternal_objects_dealloc_page_count)
\q@>	Gt"""
3[<g>	Gt"""
3[<gP	Gۄ(`H0b	
?>c9))
01./3==CSSSSSSScccmw)Ud}Kޟ&@@?v%OqnZlog01./3==CSSSSSSScccmw)Ud}Kޟ&@@?v%OqnZlog)H0)S0-88
Sexec_context_id)
Xj$>	Gl

6LG3GINVOKEginG>Gt"
"$2"
3[<g>Gk)
))
SIs"&>Gk))))
}]ouse>Gk))|>)
J16:c>Gk))intej)
rkpag>Gk)))
Xj$>Gk))
>)
klDJ>	Gk)	)e)
 /<s_d>
Gk)
)G)
&*L>Gk))ae	)
jA.v@>>Gk))

)
^oLGG"SetFileSizeP>G?(
aj@>
Gt""
"
3[<gPGPG 8888880
L
G34
G"CREATE/ALTER VIEW
G#st>
Gi""d00#stV 44ddm_db_file_space_usage"
E3ev%O>
G("":&#st:dm_dbfile_space_usage"
zB2>
G"":&#st:dm_db_file_space_usage"
#7[>
Gz""
#st"
KWK>
Gw<!<0#st@ 8CREATE VIEW sys.dm_db_file_space_usage AS
	SELECT *
	FROM OpenRowset(TBLE DM_DB_FILE_SPACE_USAGE)
<
ߪ8>
G`>)] )K0-#st88
Kdatabase_id)
1D/3>
GOm)] ')(6#st(database_id)
w\"A>	
G`?))C0-#st44Cfile_id)
</m>

GOn)	) 6#st file_id)
i/wZ=>
G`@)
)M0-#st44Mfilegroup_id)
pt>
GOo))*6#st*filegroup_id)
5m>

G`A))U0-#stUtotal_page_count)
UC1>
GOp)
)26#st2total_page_count)
*H>
G`B))k0-#stkallocated_extent_page_count
)
*(>
GOm))H6#stHallocated_extent_page_count)
i!4_)!>
G`C))o0-#stounallocated_extent_page_count)
-)1>
GOr))L6#stLunallocated_extent_page_cout)
b 3?>
G`D))w0-#stwversion_store_reserved_page_count)
3am =l>
GOs))T6#stTversion_store_reserved_page_count)
´W+sus>
G`E))s0-#stsuser_object_reserved_page_count)
gh;>
GOs))P6#stPuser_object_reserved_page_count)
C>
G`F)){0-#st	{internal_object_reserved_page_count
)
C+>
GOq))X6#st	Xinternal_object_reserved_page_count)

z>
G`G))c0-#st
cmixed_extent_page_count)
-#=k":>
GOr))@"6#st
@mixed_etent_page_count)
eHh_(>
Gi""&#st"
E3e2 >
Gi""@o#st"
E3e@naP
G4nce(88
 p
	(	Hp8P@0erence_desc6ʈd@failure_xnA_&ށBLG3RGINVOKEginG#st>Gi""$4R2#st"
E3e>G`>))#st)
1D>G`?)))#st)
</muse>G`@))|>#st)
pt>G`A))inte#stj)
UC1pag>G`B))#st)
*(>G`C))
#st>)
-)1>	G`D)	)#ste)
3am =s_d>
G`E)
)G#st)
gh;>G`F))ae#st	)
C+>>G`G))#st

)
-#=k>
Gi""
"#st"
E3e>PGR8888880
Gt""
"
3[<gPGP\}8LG3G"CREATE/ALTER VIEWGBe>Gt""j00BeV jdm_db_session_space_usage""
M|>>G/""@#s&Be@d_db_session_space_usage"
FgD>G""@#s&Be@dm_db_session_space_usage"
1{wH>Gz""
#sBe""
{͐>>GQ<<st0Be@ 8CREATE VIEW sys.dm_db_session_space_usage  AS
	SELECT *
	FROM penRowset(TABLE DM_DB_SESSION_SPACE_USAGE)

<
|>>G<)O)I880-Be44Isession_id
)
|O>G1P))&6Be&session_id
)
p^:r>	G=))K440-Be88
Kdatabase_id)
R->
G1P)	)(l6Be(database_id)
@>G>)
)o0-Beouser_objects_alloc_page_count)
9W6!>G1R))L6BeLuser_objects_aloc_page_count)
fN5)>
G?))s)0-Besuser_objects_dealloc_page_count)
ŨZT>G1S)
)P6BePuser_objects_dealloc_page_count)
FKte>G@))0-Bewinternal_objects_alloc_page_count)
<eIX
>G1Q))T6BeTinternal_objects_alloc_page_count)
 8_co>GA)){0-Be{internal_objects_dealloc_page_count
)
K{>G1R))X6BeXinternal_objects_dealloc_page_count)
c!)>Gt""Be"
M|ion>Gt""us>Be"
M|PGsus
`
0P
		80HXH0e_count)
gh;>
GOs))P6#stPuser_object_reserved_page_count)
C>
G`F)){0-#st	{internal_object_reserved_page_counwlOm`eLG3GINVOKEginGBe>Gt""$2Be"
M|>G<))Be)
|O>G=)))Be)
R-use>G>))|>Be)
9W6!>G?))inteBej)
ŨZTpag>G@))Be)
<eIX>GA))
Be>)
K{>	Gt""
Be"
M|
3amPG88880)
gh;>G`F))ae#st	)
C+>>G`G))ͳLG3<G"CREATE/ALTER VIEWGj>Gt""
"b00jV <<bdm_db_log_space_usages"
+q짘
M>G*""8&j8dm_dblog_space_usage"
c`[v">G""8&j8dm_db_log_space_usage"
k"e>Gz"""
j"
gG%:">G<T-<0j@ 8CREATE VIEW sys.dm_db_log_space_usage AS
	SELECT *
	FROM OpenRowset(TABLE DM_DB_LOG_SPCE_USAGE)
<
"CE_USA>GY)	)K0-j88
Kdatabase_id)
CXt_id>G1m))(6j(database_id)
Zĩn>	GZ))c0-jctotal_log_size_in_bytese)
xmG
R>
G1n)	)@6j@total_log_size_in_bytes)
H,;7>G[)
)c0-jcused_log_space_in_bytes)
@>>G1o))@6j@used_log_spce_in_bytes)
{.N5>
G\))g0-j;;gused_log_space_in_percentp)
1α>G1p)
)D6jDused_log_space_in_percent)
QgNVe_c>Gt""")j"
+q짘>Gt"""oc_pj"
+q짘
PG<e

	0(`(@80cts_alloc_page_count)
 8_co>GA)){0-Be{internal_objects_dealloaA_	?LG3YGINVOKEginGj>Gt"""$<Y2j"
+q짘>GY))j)
CXt>GZ)))j)
xmGuse>G[))|>j)
@>G\))intejj)
1αpag>Gt"""
j"
+q짘
<eIPGY8880>)
K{>	Gt""
Be"
M|
3amPG88880)
gh;>G`F))ae#st	)
C+>>G`G))., pULG3G*CREATE/ALTER FUNCTIONG$(>Gh","r00$(IFrdm_db_index_operational_stats
"
ٵsQ>G)""Hb$(Hdm_db_index_operational_stats"
(d>G""Ha&$(Hdm_db_index_operational_stats"
(i
>Gzg""
$("
a<t<>G<<plo0$( p8create function sys.dm_db_index_perational_stats
	(
	@DatabaseId			SMALLINT	= 0,
	@TableId			INT 		= 0,
	@IndexId 			INT 		= -1,
	@PartitionNumber	INT			= 0
	)
returns table
as
	return select *
	from OpenRowset
			(	TABLE
				VIRTUALINDEXSTATS, 
				@DatabaseId, 
				@TableId, 
				@IndexId, 
				@PartitionNumber)

<
JKd>G<)6G)K0-$(44K@DatabaseIdc)
PR?ize>G'&)6H)(6$((@DatabaseId)
ɋ>	G<))E0-$(88
E@TableId)
f4xZ>
G'')	)"e6$("@TableId>)
Rs[o>G<)
)Eo0-$(88
E@IndexId)
I*_ᅬ>G''))"6$("@IndexIda)
;vy(ntp>
G<))U0-$(88
U@PartitionNumbere)
qhfN>G'()
)26$(2@PartitonNumber)
<OG>G<))K0-$(44Kdatabase_id)
nC2>G'*))(e6$((database_id)
m6W>G<))G0-$(88
Gobject_idl)
(!@n>G'+))$6$($object_id)
sxrna>G<))E
0-$(88
Eindex_id)
m+be>G'+))"6$("index_id)
Q">G<))U0-$(88
Upartition_numberun)
Hh;>G'-))26$(2partition_numberr)
mx
e_c>G<))W0-$(Wleaf_insert_countn)
wc>G',))46$(4leaf_insert_count)
4st	>G<))Wc0-$(Wleaf_delete_count)
0Y/Gt>G',))4p6$(4leaf_delete_count)
r>G<	))We-$(Wleaf_update_count)
	|2K>G'.))46$(4leaf_update_count)
W2o#st>G<
))U0-$(Uleaf_ghost_count)
z7r>G'-))n6$(2leaf_ghost_countd)
L/Nth_>G<))]0-$(	]nonleaf_insert_count@)
y6\> G'0)):6$(	:nonleaf_insert_counts)
ۮD!öo>!G<) )]@-$(
]nonleaf_delete_count}#|)
ri>"G'0)!):_6$(
:nonleaf_delete_countc)
_Prve>#G<
)")]0-$(]nonleaf_update_count)
`N2n>$G'2)#):y6$(:nonleaf_update_count)
B(Պd6I<$>%G<)$)_t0-$(_leaf_allocation_countB)
Xk.^dr>&G',)%)<y6$(<leaf_allocation_count)
kfumb>'G<)&)et0-$(
enonleaf_allocation_count E)
'Ehl>(G'1)')Bd6$(
Bnonleaf_allocation_counta)
oU.i>)G<)()_s0-$(_leaf_page_merge_count)
k>*G'0)))<6$(<leaf_page_merge_count)
eu_id>+G<)*)e_0-$(enonleaf_page_merge_count)
_>,G'5)+)B6$(Bnonleaf_page_merge_counta)
\ t>-G<),)Ua0-$(Urange_scan_countb)
&pH8xxXp h
@
h
0
	X(Hx`0e6E@name6E@size6XZ$@typename6'
:reapH8xxXp h
@
h
0
	X(A020io&#KL\m0`?;%&k
?;#5-=
?;$ARgASAT
AUAVAW	AX
AYAZ	A[


A\
A]
A^

A_
A`AaAbAcAd
AeAf
AgAhAiAjAkAlAmAn Ao!Ap"JII@HpGFEE0D`CBA@ @P?>=<<@;p:98807`6543 3P210P00RL6l007B/&08&Lk3&,kShrinkFile8k8k0
9]<>c;))
01./3==CSSSSSSScccmw)Ud}Kޟ&@@@?v%OqnZlog01./3==CSSSSSSScccmw)Ud}Kޟ&@@?v%OqnZlog0
>.
P8k&8,0^?=ǼL
k3&,
kFileSize>?
kV;
aj@@?
k%?&0@.P?
k&?,0"A
5-=
AR#ASAATA
AUAAVAAWAAXAAYA	AZA
	A[A

A\A
A]A

A^A

A_A
A`AAaAAbAAcAAdA
AeAAfA
AgAAhAAiAAjAAkAAlAAmAAnAAoAApA `&
k0` P@p0
`
	 	P@p0RO<00Pp/A"&A"0Q*\QLk3
o	zk(DBMgr::ChangeDBState>Qk	c2$@0R}_E>Qk	cQA"or:0ChangeDBState>Qk	c2$@0zS|^Q@Rk&Qo0A"or:0ChangeDBState>Qk	c2$@0TQPQkoQ	zo0r:0ChangeDBState>Qk	c2$@0Ug6Lk3wo)zkDROPOBJCaUk>Uk	"$"$yo"
qϜUk
,Uk
;>Uk(<<?0@ ?8CREAE VIEW sys.sac_state AS
	SELECT component_name,
		convert(sysname, N'mssqlsystemresource') collate catalog_default AS database_name,
		schema_name collate catalog_default AS schema_name,
		object_name collate catalog_default AS object_name,
		state, type
	FROM sys.obd_state
<
#v6<4;	c	>Uks)).6.component_name)
A56)U#>Uk4)#)Q0-4Qcomponent_name)
U6)U		>U
kt)U),6,database_name)
X0>Uk4)U
)O0-Odatabase_name)
aP\>U
kv)U)(6(schema_name)
M\k>Uk4)U
)K0-Kschema_name)
-
P>Uku)U)(6(object_name)
+Z>Uk4)U)K0-Kobject_name)
%>Ukw)U)6state)
L0>Uk4)U)?0-00?state)
/D<)>Ukx)U)6type)
Hf>Uk4)U)=0-=type)
p>UkF>"" & sac_state"
۷6"US
>UkM="Z" & sac_stae"
/pH6"U
>Uk	"2"
"
SG76"UO>Uk	"U"J00V yoJsac_state"
qϜ6"UUkPUk}oU)z

X h
H
	0	X 8p8h80tT3&(]@R.Lk3o8zk"CREATE/ALTER VIEWk]k>]k	"U"J00V ooJsac_state"
qϜ
6"U>]kF>"U"W & sac_state"
۷ys6"]S
>]kM="U" 
& sac_state"
/pH
	6"]
>]k	"U"
"
SG76"]OLk3o9zkkSplitPage2]k	<4;
-
	2]k(<U
a
()2]
k	<

	6]k<;>]k<]
c
>]k<]c

@

6]k
<8
@]k<6c;P]k
<(	0-2]k
<]
e

me>]k
<]?n|r<@ ?8CREATE VIEW sys.sac_state AS
	SLECT component_name,
		convert(sysname, N'mssqlsystemresource') collate catalog_default AS database_name,
		schema_name collate catalog_default AS schema_name,
		object_name collate catalog_default AS object_name,
		state, type
	FROM sys.obd_state
0
@ n8CREATE VIEW sys.master_key_passwords AS
	SELECT
		co.id AS credential_id,
		convert(uniqueidentifier, 
			stringtovarbinary(convert(varchar(128),
									SUBSTRING ( co.name, 
												charindex('_', co.name) + 1,
												charindex('_', co.name, charindex('_', co.name) + 1) - charindex('_', co.name) - 1)
			   )			   )		 ) AS family_guid
	FROM master.sys.sysclsobjs co
	LEFT JOIN master.sys.sysobjvalues ov ON ov.valclass = 28 AND ov.objid = co.id AND ov.subobjid = 0 AND ov.valnum = 1
	WHERE co.class = 57
		AND has_access('CR', 0) = 1 AND co.name LIKE '##DBMKEY_%'
0 |8CREATE VIEW sys.database_recovery_status AS
	SELECT d.id AS database_id,
		p.database_guid,
		p.family_guid,
		p.last_log_backup_lsn,
		p.recovery_fork_guid,
		p.first_recovery_fork_guid,
		p.fork_point_lsn
	FROM master.sys.sysdbreg d OUTER APPLY OpenRowset(TABLE DBRECOVER, d.id) p
	WHERE d.id < 0x7fff
		AND has_access('DB', d.id) = 1
0@ r8CREATE VIEW sys.database_mirroring AS
	SELECT d.id AS database_id,
		p.guid AS mirroring_guid,
		p.state AS mirroring_state, p.state_desc AS mirroring_state_desc,
		p.role AS mirroring_role, p.role_desc AS mirroring_role_desc,
		p.role_seqence AS mirroring_role_sequence,
		p.safety_level AS mirroring_safety_level,
		p.safety_level_desc AS mirroring_safety_level_desc,
		p.safety_sequence AS mirroring_safety_sequence,
		p.partner_name AS mirroring_partner_name,
		p.partner_instance AS mirroring_partner_instance,
		p.witness_name AS mirroring_witness_name,
		p.witness_state AS mirroring_witness_state,
		p.witness_state_desc AS mirroring_witness_state_desc,
		p.failover_lsn AS mirroring_failover_lsn,
		p.connection_timeout AS mirrorin_connection_timeout,
		p.redo_queue AS mirroring_redo_queue,
		p.redo_queue_type AS mirroring_redo_queue_type,
		p.end_of_log_lsn AS mirroring_end_of_log_lsn,
		p.safe_relication_lsn AS mirroring_replication_lsn
	FROM master.sys.sysdbreg d OUTER APPLY OpenRowset(TABLE DBMIRROR, d.id) p
	WHERE d.id < 0x7fff
		AND has_access('DB', d.id) = 1
0@ 8CREATE VIEW sys.credentials AS
	SELECT
		co.id AS credential_id,
		co.name,
		convert(nvarchar(4000), ov.value) as credentia_identity,
		co.created as create_date,
		co.modified as modify_date,
		n.name as target_type,
		r.indepid AS target_id
	FROM master.sys.sysclsobjs co
	LEFT JOIN master.sys.sysobjvalues ov ON ov.valclass = 28 AND ov.objid = co.id AND ov.subobjid = 0 AND ov.valnum = 1
	LEFT JOIN master.sys.syssingleobjrefs r ON r.depid = co.id AND r.class = co.intprop AND r.depsubid = 0	
	LEFT JOIN sys.syspalvalues n ON n.class = 'SRCL' AND n.value = co.intprop
	WHERE co.class = 57
		AND has_access('CR', 0) = 1
6<]l<]k(<]

D+>]k(<]	
>]k	<](
>]k	<]<
2]k
<]2]k	<]2k(<]2]k	<]P]ko]9z>]	k
<]<[0 [8CREATE VIEW sys.sac_state AS
	SELECT component_name,
		convert(sysname, N'mssqlsystemresource') collate catalog_default AS database_name,
		schema_name collate catalog_default AS schema_name,
		object_name collat catalog_default AS object_name,
		state, type
	FROM sys.obd_state
	UNION ALL
	SELECT convert(sysname, c.name) AS component_name,
		convert(sysname, N'master') collate catalog_default AS database_name,
		s.name collate catalog_default AS schema_name,
		o.name collate catalog_default AS object_name,
		convert(tinyint, convert(int, c.value) & 1) AS state,
		o.type
	FROM master.sys.sysobjkeycrypts k
	JOIN master.sys.sysschobjs o ON o.id = k.id
	JOIN master.sys.sysxlgns l ON l.type = 'M' AND substrng(l.sid, 13, 28) = k.thumbprint
	JOIN master.sys.configurations c ON c.name = substring(l.name, 3, len(l.name) - 4)
	LEFT JOIN master.sys.schemas s ON s.schema_id = o.nsid
	WHERE k.class = 1 AND k.type = 'INCP'
	UNION ALL
	SELECT convert(sysname, c.name) AS component_name,
		convert(sysname, N'msdb') collate catalog_default AS database_name,
		s.name collate catalog_default AS schema_name,
		o.name collate catalog_default AS object_name,
		convert(tinyint, convert(int, c.value) & 1) AS state,
		.type
	FROM msdb.sys.sysobjkeycrypts k
	JOIN msdb.sys.sysschobjs o ON o.id = k.id
	JOIN master.sys.sysxlgns l ON l.type = 'M' AND substring(l.sid, 13, 28) = k.thumbprint
	JOIN master.sys.configurations c ON c.name = substring(l.name, 3, len(l.name) - 4)
	LEFT JOIN msdb.sys.schemas s ON s.schema_id = o.nsid
	WHERE k.class = 1 AND k.type = 'INCP'
<
#v6<]l>]"k4)U)Q-4Qcomponent_name)
U>]$ks)U).6.component_name)
A5>]%k4)]$)O0-Odatabase_name)
aP\>]&kt)]%),6,database_name)
X0>]'k4)]&)K0-Kschema_name)
-
P>](kv)]')(6(schema_name)
M\k>])k4)]()K0-Kobject_name)
%>]*ku)]))(6(object_name)
+Z>]+k4)]*)?0-00?state)
/D<)>],kw)]+)6state)
L0>]-k4)],)=0-=type)
p6)]#	>].kx)]-)6type)
Hf6)]/#>]0k	"]""
qϜP]ko]8z%`%(%$p$#P#"("x! @ ph0(x8p(X` H0x@00oie]lgu

E 2(*(qfGJA")5+-1=fA"
q"?5A-A=q"
B2"":
Bq":
B	q":
B
q":
Bq""#Bq	":
B
q
":
Bq":
Bq"	
Bq
"
:
Bq"Bq"
q)5-=q)PBq)RBq)RBq)RBq)RBq)/RBq)/RBq)/RBq)/RBq)	/RBq)
fRBq)Bq)/RBq)
!RB q)RB!q )RB"q!)$R"q<5-=$q<NOq#<-=@?; <@q&<@q'<@q(<@q)<@q*<Nq%"5-=oq$"
7q,",5.-1=Hq-"
8q.)5-=Iq/)P`A""pk(0'`&%$# #P"! @p0` P@p0
`
	 	P@p0R*
:J0A")5+-1=fA"
qaxq2"pq20fA"
q

Anon7 - 2022
AnonSec Team