This script will show you what the old server name was and what the current server name is. Even though you rename the machine name through windows system advanced properties, theSQL server name stays what it was on original install date.
SELECT ServerProperty('machinename') as [machinename]
,ServerProperty('ServerName') as [ServerName]
,@@ServerName as [@@ServerName];
I recently needed to inject the name of the SQL server into a script that exported blob data to a file system. I used @@servername but to my surprise it returned the name of the server that the SQL server used to be. I cloned this a production server to do some testing and renamed the server.
EXEC sp_dropserver 'NETSQL3';
EXEC sp_addserver 'NET3', 'local';
This SQL command will rename the server variable value for @@servername.
Most space in Veeam should be in either one of two different tables. Based on where the space is located will dictate which method is used.
perfsamplelow – is more than 1 month out history, and can use a script to truncate
perfsampleMed – Is current history set by Gui. Don’t use script oil this but rather thank gui retention rules.
TO AVOID CONNECTION REFUSAL
NOTE: YOU NEED TO RUN SQL MANAGER UNDER THE Windows ACCOUNT that runs VeeamOne AS THAT IS THE ACCOUNT THAT RUNS THE SERVICE.
Shrink Veeam One DB Low Table
SQL Manager is installed on VEEAMONE. Use that to run scripts.
DECLARE @dt DATETIME
SET @dt = CONVERT(DATETIME, '2020-01-25 00:00:00.001' ,120)
WHILE EXISTS (SELECT * FROM [monitor].[perfsamplelow] WITH(NOLOCK) WHERE [timestamp] < @dt)
DELETE TOP (50000) FROM [monitor].[perfsamplelow] WHERE [timestamp] < @dt
DBCC shrinkfile (N'VeeamOne', 1)
Analyze table size SQL
select top 10 schema_name(tab.schema_id) + '.' + tab.name as [table],
cast(sum(spc.used_pages * 8)/1024.00 as numeric(36, 2)) as used_mb,
cast(sum(spc.total_pages * 8)/1024.00 as numeric(36, 2)) as allocated_mb
from sys.tables tab
join sys.indexes ind
on tab.object_id = ind.object_id
join sys.partitions part
on ind.object_id = part.object_id and ind.index_id = part.index_id
join sys.allocation_units spc
on part.partition_id = spc.container_id
group by schema_name(tab.schema_id) + '.' + tab.name
order by sum(spc.used_pages) desc;