initial commit
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
|
||||
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-359 - CommVault log backup frequency", "OCTPDBA-359 - CommVault log backup frequency.ssmssqlproj", "{B7D2025A-A374-467C-A4FA-C449E6B095EE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Default|Default = Default|Default
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B7D2025A-A374-467C-A4FA-C449E6B095EE}.Default|Default.ActiveCfg = Default
|
||||
{E88413B5-F896-4F4F-949E-7D4C1D41FD44}.Default|Default.ActiveCfg = Default
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {762276EF-25EE-45B8-B8FA-487705F4CAA0}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0"?>
|
||||
<SqlWorkbenchSqlProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="OCTPDBA-359 - CommVault log backup frequency">
|
||||
<Items>
|
||||
<LogicalFolder Name="Connections" Type="2" Sorted="true">
|
||||
<Items>
|
||||
<ConnectionNode Name="ama293aps.amavita.ch\apssql:CENTRALINFRA\ua208700">
|
||||
<Created>2022-10-31T16:27:08.1953456+01:00</Created>
|
||||
<Type>SQL</Type>
|
||||
<Server>ama293aps.amavita.ch\apssql</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>
|
||||
<ConnectionNode Name="sun008aps.sunstore.ch\apssql:CENTRALINFRA\ua208700">
|
||||
<Created>2022-10-31T09:33:53.6641248+01:00</Created>
|
||||
<Type>SQL</Type>
|
||||
<Server>sun008aps.sunstore.ch\apssql</Server>
|
||||
<UserName />
|
||||
<Authentication>Windows Authentication</Authentication>
|
||||
<InitialDB>ActivePos_read</InitialDB>
|
||||
<LoginTimeout>30</LoginTimeout>
|
||||
<ExecutionTimeout>0</ExecutionTimeout>
|
||||
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
|
||||
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
|
||||
</ConnectionNode>
|
||||
<ConnectionNode Name="sun211aps.sunstore.ch\apssql:CENTRALINFRA\ua208700">
|
||||
<Created>2022-10-31T16:26:06.3401914+01:00</Created>
|
||||
<Type>SQL</Type>
|
||||
<Server>sun211aps.sunstore.ch\apssql</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>
|
||||
</LogicalFolder>
|
||||
<LogicalFolder Name="Queries" Type="0" Sorted="true">
|
||||
<Items>
|
||||
<FileNode Name="check bkp frequency.sql">
|
||||
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:ama293aps.amavita.ch\apssql:True</AssociatedConnectionMoniker>
|
||||
<AssociatedConnSrvName>ama293aps.amavita.ch\apssql</AssociatedConnSrvName>
|
||||
<AssociatedConnUserName />
|
||||
<FullPath>check bkp frequency.sql</FullPath>
|
||||
</FileNode>
|
||||
</Items>
|
||||
</LogicalFolder>
|
||||
<LogicalFolder Name="Miscellaneous" Type="3" Sorted="true">
|
||||
<Items />
|
||||
</LogicalFolder>
|
||||
</Items>
|
||||
</SqlWorkbenchSqlProject>
|
||||
BIN
OCTPDBA-359 - CommVault log backup frequency/adr repo.xlsx
Normal file
BIN
OCTPDBA-359 - CommVault log backup frequency/adr repo.xlsx
Normal file
Binary file not shown.
BIN
OCTPDBA-359 - CommVault log backup frequency/centrales.xlsx
Normal file
BIN
OCTPDBA-359 - CommVault log backup frequency/centrales.xlsx
Normal file
Binary file not shown.
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
Server: ssunb008vm01.sunstore.ch
|
||||
Format: GCM
|
||||
Business: TPPHAR
|
||||
type: DEVE
|
||||
Version: 23.1.10015.00066
|
||||
|
||||
31.10.2022, TSC
|
||||
*/
|
||||
SET XACT_ABORT ON;
|
||||
SET NOCOUNT ON;
|
||||
|
||||
IF OBJECT_ID('tempdb..#bkps') IS NOT NULL
|
||||
BEGIN
|
||||
DROP TABLE #bkps;
|
||||
END;
|
||||
|
||||
SELECT DISTINCT
|
||||
CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS SERVER,
|
||||
bs.[database_name],
|
||||
bs.backup_start_date,
|
||||
bs.backup_finish_date,
|
||||
bs.backup_size,
|
||||
bs.[name] AS backupset_name,
|
||||
bs.[description],
|
||||
CASE
|
||||
WHEN bs.TYPE = 'D' THEN 'Full'
|
||||
WHEN bs.TYPE = 'I' THEN 'Differential'
|
||||
WHEN bs.TYPE = 'L' THEN 'Log'
|
||||
WHEN bs.TYPE = 'F' THEN 'File or filegroup'
|
||||
WHEN bs.TYPE = 'G' THEN 'Differential file'
|
||||
WHEN bs.TYPE = 'P' THEN 'Partial'
|
||||
WHEN bs.TYPE = 'Q' THEN 'Differential partial'
|
||||
ELSE 'Unknown' END AS backup_type
|
||||
,ROW_NUMBER()OVER(PARTITION BY bs.[database_name], bs.TYPE ORDER BY bs.backup_start_date) AS rid
|
||||
INTO #bkps
|
||||
FROM msdb.[dbo].backupset bs
|
||||
WHERE (CONVERT(DATETIME, bs.backup_start_date, 102) >= DATEADD(DAY, -7, CURRENT_TIMESTAMP))
|
||||
AND bs.[name] LIKE '%commvault%'
|
||||
AND bs.[database_name] NOT IN ('model','msdb','master','tempdb','HCITools')
|
||||
/*AND (
|
||||
bs.database_name LIKE 'arizona%'
|
||||
OR bs.database_name LIKE 'activepos%'
|
||||
)
|
||||
*/
|
||||
;
|
||||
|
||||
WITH chkFull AS (
|
||||
SELECT b.SERVER
|
||||
,b.[database_name]
|
||||
,b.backup_start_date
|
||||
,b.backup_finish_date
|
||||
,b.backup_size
|
||||
,b.backupset_name
|
||||
,b.[description]
|
||||
,b.backup_type
|
||||
,b.rid
|
||||
,hiera = 1
|
||||
,CAST(NULL AS INT) AS delta_min
|
||||
FROM #bkps b
|
||||
WHERE b.rid = 1
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT b.SERVER
|
||||
,b.[database_name]
|
||||
,b.backup_start_date
|
||||
,b.backup_finish_date
|
||||
,b.backup_size
|
||||
,b.backupset_name
|
||||
,b.[description]
|
||||
,b.backup_type
|
||||
,b.rid
|
||||
,p.hiera + 1 AS hiera
|
||||
,DATEDIFF(MINUTE, p.backup_start_date, b.backup_start_date) AS delta_min
|
||||
FROM chkFull p
|
||||
INNER JOIN #bkps b
|
||||
ON b.[database_name] = p.[database_name]
|
||||
AND b.backup_type = p.backup_type
|
||||
AND b.rid = p.rid + 1
|
||||
)
|
||||
|
||||
SELECT
|
||||
f.[database_name]
|
||||
, f.backup_type
|
||||
, SUM(CAST(CAST(f.delta_min AS NUMERIC(12,2)) / 60 AS NUMERIC(12,2))) / COUNT(1) AS mean_delta_hour
|
||||
FROM chkFull f
|
||||
WHERE 1=1
|
||||
GROUP BY f.[database_name], f.backup_type
|
||||
OPTION(MAXRECURSION 5000);
|
||||
|
||||
|
||||
SELECT *
|
||||
FROM #bkps b
|
||||
WHERE b.backup_type = 'log'
|
||||
AND b.[database_name]='arizona'
|
||||
ORDER BY b.[database_name] ASC, b.rid ASC
|
||||
;
|
||||
BIN
OCTPDBA-359 - CommVault log backup frequency/datamart.xlsx
Normal file
BIN
OCTPDBA-359 - CommVault log backup frequency/datamart.xlsx
Normal file
Binary file not shown.
BIN
OCTPDBA-359 - CommVault log backup frequency/gaia.xlsx
Normal file
BIN
OCTPDBA-359 - CommVault log backup frequency/gaia.xlsx
Normal file
Binary file not shown.
BIN
OCTPDBA-359 - CommVault log backup frequency/j2i.xlsx
Normal file
BIN
OCTPDBA-359 - CommVault log backup frequency/j2i.xlsx
Normal file
Binary file not shown.
BIN
OCTPDBA-359 - CommVault log backup frequency/monitoring.xlsx
Normal file
BIN
OCTPDBA-359 - CommVault log backup frequency/monitoring.xlsx
Normal file
Binary file not shown.
BIN
OCTPDBA-359 - CommVault log backup frequency/pharmacies.xlsx
Normal file
BIN
OCTPDBA-359 - CommVault log backup frequency/pharmacies.xlsx
Normal file
Binary file not shown.
BIN
OCTPDBA-359 - CommVault log backup frequency/pharmindex.xlsx
Normal file
BIN
OCTPDBA-359 - CommVault log backup frequency/pharmindex.xlsx
Normal file
Binary file not shown.
BIN
OCTPDBA-359 - CommVault log backup frequency/pricing.xlsx
Normal file
BIN
OCTPDBA-359 - CommVault log backup frequency/pricing.xlsx
Normal file
Binary file not shown.
BIN
OCTPDBA-359 - CommVault log backup frequency/triafact.xlsx
Normal file
BIN
OCTPDBA-359 - CommVault log backup frequency/triafact.xlsx
Normal file
Binary file not shown.
BIN
OCTPDBA-359 - CommVault log backup frequency/triascan.xlsx
Normal file
BIN
OCTPDBA-359 - CommVault log backup frequency/triascan.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user