This commit is contained in:
2023-02-22 09:06:46 +01:00
parent 911e4e6720
commit 5874709908
22 changed files with 1081 additions and 314 deletions

View File

@@ -0,0 +1 @@
/*.xlsx

View File

@@ -0,0 +1,19 @@
SELECT qm.database_id,
qm.queue_id,
q.[name] AS queue_name,
qm.STATE,
qm.last_empty_rowset_time,
qm.last_activated_time,
qm.tasks_waiting
FROM sys.dm_broker_queue_monitors qm
JOIN sys.[service_queues] q
ON q.[object_id] = qm.[queue_id];
SELECT *
FROM sys.dm_os_performance_counters
WHERE object_name LIKE '%Broker Statistics%'
AND [counter_name] IN ( 'Corrupted Messages Total', 'Activation Errors Total', 'Dropped Messages Total',
'Enqueued Local Messages Total','Enqueued Transport Msgs Total', 'Forwarded Messages Total'
);

View File

@@ -0,0 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# SQL Server Management Studio Solution File, Format Version 18.00
VisualStudioVersion = 15.0.28307.421
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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Default|Default = Default|Default
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3AB8C2C0-6783-43CD-9F30-78F0966B486C}.Default|Default.ActiveCfg = Default
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F7E7AE51-7FDB-4972-A3D6-580431955D1B}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,40 @@
<?xml version="1.0"?>
<SqlWorkbenchSqlProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="OCTPDBA-496 - Validate ssl deactivation">
<Items>
<LogicalFolder Name="Connections" Type="2" Sorted="true">
<Items>
<ConnectionNode Name="hcimon:CENTRALINFRA\ua208700">
<Created>2023-02-17T10:07:59.2402706+01:00</Created>
<Type>SQL</Type>
<Server>hcimon</Server>
<UserName />
<Authentication>Windows Authentication</Authentication>
<InitialDB>master</InitialDB>
<LoginTimeout>30</LoginTimeout>
<ExecutionTimeout>0</ExecutionTimeout>
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
</ConnectionNode>
</Items>
</LogicalFolder>
<LogicalFolder Name="Queries" Type="0" Sorted="true">
<Items>
<FileNode Name="check sql server logs.sql">
<AssociatedConnectionMoniker />
<AssociatedConnSrvName />
<AssociatedConnUserName />
<FullPath>check sql server logs.sql</FullPath>
</FileNode>
<FileNode Name="last backups.sql">
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:hcimon:True</AssociatedConnectionMoniker>
<AssociatedConnSrvName>hcimon</AssociatedConnSrvName>
<AssociatedConnUserName />
<FullPath>last backups.sql</FullPath>
</FileNode>
</Items>
</LogicalFolder>
<LogicalFolder Name="Miscellaneous" Type="3" Sorted="true">
<Items />
</LogicalFolder>
</Items>
</SqlWorkbenchSqlProject>

View File

@@ -0,0 +1,42 @@
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

@@ -0,0 +1,49 @@
IF OBJECT_ID('tempdb..#errorLog')IS NOT NULL BEGIN;
DROP TABLE #errorLog;
END;
DECLARE @loop INT = 0;
CREATE TABLE #errorLog (
LogDate DATETIME NOT NULL
, src VARCHAR(20)
, ProcessInfo VARCHAR(64)
, [Text] VARCHAR(MAX)
);
WHILE @loop < 7
BEGIN
INSERT INTO [#errorLog] ([LogDate],
[ProcessInfo],
[Text])
EXEC [sys].[sp_readerrorlog]
@p1 = @loop -- specify the log number or use nothing for active error log
,@p2 = 1 --error log
;
UPDATE [#errorLog] SET [src] = 'db'
WHERE [src] IS NULL;
INSERT INTO [#errorLog] ([LogDate],
[ProcessInfo],
[Text])
EXEC [sys].[sp_readerrorlog]
@p1 = @loop -- specify the log number or use nothing for active error log
,@p2 = 2 --agent log
;
UPDATE [#errorLog] SET [src] = 'agent'
WHERE [src] IS NULL;
SET @loop = @loop + 1;
END
SELECT *
FROM #errorLog a
WHERE a.[LogDate] > '20230213 20:00:00'
--AND EXISTS (SELECT *
-- FROM #errorLog b
-- WHERE [Text] like 'Error:%'
-- AND a.LogDate = b.LogDate
-- AND a.ProcessInfo = b.ProcessInfo)
--AND a.[LogDate] > '20230213 20:00:00' --report that the ssl / tls was deactivated
--AND (a.[Text] like '%Error:%' OR [a].[Text] LIKE '%warning%')
ORDER BY [a].[LogDate], [a].[src] ASC
;

View File

@@ -0,0 +1,52 @@
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
OUTER APPLY(
SELECT bs.backup_start_date,
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
)la
WHERE bs.[type] = 'D'
AND la.[Position] = 1
AND bs.is_copy_only = 0
AND bs.backup_start_date < DATEADD(HOUR, -5, la.[backup_start_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

@@ -0,0 +1,119 @@
US: https://galenica.atlassian.net/browse/OCTPDBA-496
Scope
Central GCM N+1
ssunbqmsdb02.sunstore.ch\apssql
=> pas mal de choses dans log appl, mais pas relevantes
InsufficientMemoryException dans service '/MonitoringDataCentralWebService/MonitoringDataCentralWebService.svc'
arizona broker => Dongle Key not found (internal error : 3).
broker sql server => Event notification 'SQLWEP_8E2F34CC_4597_433C_8375_9F2E7BCA744E' in database 'master' dropped due to send time service broker errors. Check to ensure the conversation handle, service broker contract, and service specified in the event notification are active.
Pharmacy N+1
in 22.1 version
ama707aps.amavita.ch\apssql
=> ras log app
in 23.1 version
ama705aps.amavita.ch\apssql
POS N+1
in 22.1 version
wam707a02
=> win app log:
svc DNSyncService: Synchronization faild due to connection errors. Service will retry synchronization at 17.02.2023 15:42:51. Exception: Une connexion a été établie avec le serveur, mais une erreur s'est ensuite produite pendant le processus d'ouverture de session. (provider: SSL Provider, error: 0 - Le client et le serveur ne peuvent pas communiquer car ils ne possèdent aucun algorithme commun.)
Service COC.DOCUNIZE, emplacement C:\Program Files\COC AG\DOCUNIZE.2020
in 23.1 version
CAMA70533287T02
=> win app log comme sur wam707a02
Address Repository N+1
SSUNBQMSREF02\TAM000REF
==> permission denied rdp, pas pu vérifier les logs windows
Datamart N+1
SWDITST01\TGALKON
=> ras
TriaFACT N+1
SWTFQMS01\TGALTFAC
=> erreurs de repli, schémas je pense mais message tronqué
Replication-Replication Merge Subsystem: agent SWTFQMS01\TGALTFAC-olpDirectory-OlpDirectory_MergePub-SWTFQMS01\TGALTFAC-14 failed. The schema script ' if object_id(N'[dbo].[FK_UserProfileUser]') is null if object_id(N'[dbo].[User]') is not null exec('ALTER TABLE [dbo].[User] WITH CHECK ADD CONSTRAINT [FK_UserProfileUser] FOREIGN KEY([UserProfileId])
REFERENCES [dbo].[UserProfile] (
Gaia / triafin
SWGCMQMS01\TGALCTP
=> ras
J2I N+1
SWINDA01\APSTEST
=> pas mal d'erreurs dans le app log, mais pas forcément reliées:
Error in GetXML4InvoiceError : This barcode does not exists !
Error in GetXML4InvoiceError : This barcode is not for this user !
Error in GetXML4InvoiceError : Multiple scan is not authorized for the same barcode extraction !
Error calling the Web serviceTimeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
Pricing N+1
SWOPXQMS01\TGALOLPP01
=> ras
triascan
SWSCANTST01\TAMASCAN
=> ras
Les serveurs suivant n'ont pas été switchés, ils sont intouchés
PharmINDEX N+1 (pas de N+? selon la liste des instances. uniquement prod.)
DBA N+1 (seulement N+2 selon la liste des instances)
swdbasqltst01.centralinfra.net\apssql
Atlas N+1
swatldev01.centralinfra.net\TGALATLAS
TODO:
Check des logs windows:
central 888:
* SYNCHRO EXCEPTION
Program name : C:\Program Files (x86)\Triamun\APSSynchroExtract\bin\apsSynchroExtract.exe
Message : Error during database connection - Tried to connect to the database unsuccessfully 3 time(s) [DBNETLIB][ConnectionOpen (SECCreateCredentials()).]SSL Security error
* 2023-02-15 10:14:19,954 [6] FATAL Hci.ServiceManagerCore.PluginManager [(null)] - Plug-in 'LoyaltyCheckService' with schedule '0 0 19' failed to start.
System.InvalidOperationException: Cannot find the X.509 certificate using the following search criteria: StoreName 'My', StoreLocation 'LocalMachine', FindType 'FindByTemplateName', FindValue 'TriaPharmSslGalenica'.
* broker arizona pas à jour
test depuis le pc de Roland Berger ok, probablement un soucis native client ou oledb. voir avec RTC.
2 versions de "ole db" installées. "OLE DB provider" ko, "OLE DB driver" ok. J'ai demandé à Roland si il peut me dire quel provider est utilisé dans le broker, mais il n'a pas les sources
Il cherche a les trouver.
J'ai essayé de feinter en spécifiant le provider dans la config du broker après le host auxquel on se connecte, mais l'application fait une erreur comme quoi il y a
un autre provider enregistré.
Une solution si on n'a pas les sources serait de supprimer le check au broker dans apsSynchroExtract peut-être ?
SSUNBREFDE02
eventvwr:
* Event notification 'SQLWEP_4C0433FF_A1BF_4C23_9E97_09DAD1D3D1AE' in database 'master' dropped due to send time service broker errors. Check to ensure the conversation handle, service broker contract, and service specified in the event notification are active.
* 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:
* 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>'.
Check des logs sql server avec erreurs depuis le 13.02.2023 20:00
Ne montre rien de probant. Des erreurs de logins (pwd incorrect) sur les pos, des erreurs de replication
Check des jobs en erreur depuis le 13.02.2023 20:00
Des deadlock, des labels en erreur (traité ce matin) mais rien de probant
linked servers
tout semble ok.
Backups commvault
Logs des backups ok en pharmacies.
Brocker