This commit is contained in:
2023-02-27 14:58:06 +01:00
parent 5874709908
commit f4c95e6b1a
5 changed files with 36 additions and 49 deletions

View File

@@ -3,19 +3,20 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# SQL Server Management Studio Solution File, Format Version 18.00 # SQL Server Management Studio Solution File, Format Version 18.00
VisualStudioVersion = 15.0.28307.421 VisualStudioVersion = 15.0.28307.421
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{4F2E2C19-372F-40D8-9FA7-9D2138C6997A}") = "OCTPDBA-496 - Validate ssl deactivation", "OCTPDBA-496 - Validate ssl deactivation.ssmssqlproj", "{3AB8C2C0-6783-43CD-9F30-78F0966B486C}" Project("{4F2E2C19-372F-40D8-9FA7-9D2138C6997A}") = "OCTPDBA-496 - Validate ssl deactivation", "OCTPDBA-496 - Validate ssl deactivation.ssmssqlproj", "{5BAB26B4-4998-4CEC-BC2D-825FCD5F458A}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Default|Default = Default|Default Default|Default = Default|Default
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3AB8C2C0-6783-43CD-9F30-78F0966B486C}.Default|Default.ActiveCfg = Default {C4B73EC2-307D-4DD9-8A9A-1862EC9FEB2F}.Default|Default.ActiveCfg = Default
{5BAB26B4-4998-4CEC-BC2D-825FCD5F458A}.Default|Default.ActiveCfg = Default
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F7E7AE51-7FDB-4972-A3D6-580431955D1B} SolutionGuid = {A7761159-6DEB-4E51-AD11-AFB60B2E7049}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -15,16 +15,34 @@
<ConnectionProtocol>NotSpecified</ConnectionProtocol> <ConnectionProtocol>NotSpecified</ConnectionProtocol>
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName> <ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
</ConnectionNode> </ConnectionNode>
<ConnectionNode Name="suncent:CENTRALINFRA\ua208700">
<Created>2023-02-27T09:13:34.556097+01:00</Created>
<Type>SQL</Type>
<Server>suncent</Server>
<UserName />
<Authentication>Windows Authentication</Authentication>
<InitialDB />
<LoginTimeout>30</LoginTimeout>
<ExecutionTimeout>0</ExecutionTimeout>
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
</ConnectionNode>
</Items> </Items>
</LogicalFolder> </LogicalFolder>
<LogicalFolder Name="Queries" Type="0" Sorted="true"> <LogicalFolder Name="Queries" Type="0" Sorted="true">
<Items> <Items>
<FileNode Name="check sql server logs.sql"> <FileNode Name="check sql server logs.sql">
<AssociatedConnectionMoniker /> <AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:suncent:True</AssociatedConnectionMoniker>
<AssociatedConnSrvName /> <AssociatedConnSrvName>suncent</AssociatedConnSrvName>
<AssociatedConnUserName /> <AssociatedConnUserName />
<FullPath>check sql server logs.sql</FullPath> <FullPath>check sql server logs.sql</FullPath>
</FileNode> </FileNode>
<FileNode Name="EXPLOIT - broker stats.sql">
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:suncent:True</AssociatedConnectionMoniker>
<AssociatedConnSrvName>suncent</AssociatedConnSrvName>
<AssociatedConnUserName />
<FullPath>EXPLOIT - broker stats.sql</FullPath>
</FileNode>
<FileNode Name="last backups.sql"> <FileNode Name="last backups.sql">
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:hcimon:True</AssociatedConnectionMoniker> <AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:hcimon:True</AssociatedConnectionMoniker>
<AssociatedConnSrvName>hcimon</AssociatedConnSrvName> <AssociatedConnSrvName>hcimon</AssociatedConnSrvName>
@@ -34,7 +52,14 @@
</Items> </Items>
</LogicalFolder> </LogicalFolder>
<LogicalFolder Name="Miscellaneous" Type="3" Sorted="true"> <LogicalFolder Name="Miscellaneous" Type="3" Sorted="true">
<Items /> <Items>
<FileNode Name="todo.txt">
<AssociatedConnectionMoniker />
<AssociatedConnSrvName />
<AssociatedConnUserName />
<FullPath>todo.txt</FullPath>
</FileNode>
</Items>
</LogicalFolder> </LogicalFolder>
</Items> </Items>
</SqlWorkbenchSqlProject> </SqlWorkbenchSqlProject>

View File

@@ -1,42 +0,0 @@
WITH LastBackUp AS
(
SELECT bs.database_name,
bs.backup_size,
bs.backup_start_date,
bmf.physical_device_name,
bs.[name],
Position = ROW_NUMBER() OVER( PARTITION BY bs.database_name ORDER BY bs.backup_start_date DESC )
FROM msdb.dbo.backupmediafamily bmf
JOIN msdb.dbo.backupmediaset bms ON bmf.media_set_id = bms.media_set_id
JOIN msdb.dbo.backupset bs ON bms.media_set_id = bs.media_set_id
WHERE bs.[type] = 'D'
AND bs.is_copy_only = 0
)
,lastBkpYesterday AS (
SELECT bs.database_name,
bs.backup_size,
bs.backup_start_date,
bmf.physical_device_name,
bs.[name],
Position = ROW_NUMBER() OVER( PARTITION BY bs.database_name ORDER BY bs.backup_start_date DESC )
FROM msdb.dbo.backupmediafamily bmf
JOIN msdb.dbo.backupmediaset bms ON bmf.media_set_id = bms.media_set_id
JOIN msdb.dbo.backupset bs ON bms.media_set_id = bs.media_set_id
WHERE bs.[type] = 'D'
AND bs.is_copy_only = 0
AND bs.backup_start_date < DATEADD(DAY, -1, CAST(CURRENT_TIMESTAMP AS DATE))
)
SELECT
sd.name AS [Database],
REPLACE(REPLACE(CONVERT(VARCHAR(100), CONVERT(MONEY, lb.backup_size / 1048576), 1),',',''''),'.00','') AS [backup size MB],
lb.backup_start_date AS [Last Full DB Backup Date],
lb.physical_device_name AS [Last Backup File Location],
lby.backup_start_date AS [Previous Full DB Backup Date],
lb.physical_device_name AS [Previous Backup File Location],
lb.[name] AS [last backup name],
lby.[name] AS [Previous last backup name]
FROM sys.databases AS sd
LEFT JOIN LastBackUp AS lb ON sd.name = lb.database_name AND lb.Position = 1
LEFT JOIN lastBkpYesterday lby ON sd.name=lby.database_name and lby.Position=1
ORDER BY [Database];

View File

@@ -101,6 +101,8 @@ TODO:
* Failure to send an event notification instance of type 'AUDIT_BACKUP_RESTORE_EVENT' on conversation handle '{C3061AAC-78A4-ED11-A2E2-0050568686ED}'. Error Code = '8429'. * Failure to send an event notification instance of type 'AUDIT_BACKUP_RESTORE_EVENT' on conversation handle '{C3061AAC-78A4-ED11-A2E2-0050568686ED}'. Error Code = '8429'.
log sql: log sql:
* Closed event notification conversation endpoint with handle '{C6061AAC-78A4-ED11-A2E2-0050568686ED}', due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8470</Code><Description>Remote service has been dropped.</Description></Error>'. * Closed event notification conversation endpoint with handle '{C6061AAC-78A4-ED11-A2E2-0050568686ED}', due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8470</Code><Description>Remote service has been dropped.</Description></Error>'.
la sys.transmission_queue est vide, donc les messages emblent avoir été délivrés néanmoins
Check des logs sql server avec erreurs depuis le 13.02.2023 20:00 Check des logs sql server avec erreurs depuis le 13.02.2023 20:00
@@ -116,4 +118,5 @@ TODO:
Logs des backups ok en pharmacies. Logs des backups ok en pharmacies.
Brocker Brocker
quelques poison message, mais rien qui ne semble problématique.
sys.transmission_queue est vide.