Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
The Voice of the DBA
 

Tracking Table Sizes

Managing a production database can be a challenge for many reasons. However storage growth has been one I see often as causing issues. From full logs to filled disks, it seems that we can struggle with dynamic workloads where we have no control over who can add data to systems.

Many DBAs have some sort of alert set on data files or disks, but even with those alerts, an unexpected load or runaway query could still fill a disk. I know I've been called back into the office because some business person decided to load an unexpected amount of data. In fact, more than a few times someone thought their load didn't work for some reason and repeated loaded a large amount of data, filling a disk or log file.

Recently, I had a customer ask about tracking table sizes daily in their databases. They were looking to watch table growth. Another person dismissed this as not valuable, which was interesting to me. I've done this in the past, and I've found it valuable. No knowing the size every day, but having an idea of the growth factor. I didn't keep this data long, usually a week rolling older data off as I added more. That was enough for me to trend how quickly a table was growing.

This also allowed me to set an alert if there was unusual growth for a table, and often track down a potential issue quickly. Either I'd realize our workload changed and tables were growing faster, or I could debug a sudden growth issue down to some sort of data load. Often I could catch an issue before I received an alert (or phone call).

I wonder how many of you track table sizes and if you find it beneficial. Is this something that helps you better understand your system or is the total size of the database good enough.

Or maybe you have so much storage allocated you don't worry about space. Lucky you.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

 
  Featured Contents
SQLServerCentral Article

How to Download and Restore AdventureWorks 2019 Database

Noman072 from SQLServerCentral

Learn how to download and restore AdventureWork 2019 Database.

External Article

Exploring Scalar Solutions to Complex Data Math

Additional Articles from SimpleTalk

There are many functions and tools available to database professionals that can solve data math challenges, regardless of complexity.

Blog Post

From the SQL Server Central Blogs - T-SQL Tuesday #183: Improving Permission Management

Steve Jones - SSC Editor from The Voice of the DBA

This is my (late) answer to my own invitation for T-SQL Tuesday #183. I was very busy a few weeks ago when the invite when out (glad it was...

Blog Post

From the SQL Server Central Blogs - Enterprise Digital Exhaust

K. Brian Kelley from Databases – Infrastructure – Security

Digital exhaust, or data exhaust, is the information you generate as you interact digitally. We've typically thought of this in terms of tracking cookies and the like, but it...

Admin Azure SQL Solutions

Exam Ref DP-300 Administering Microsoft Azure SQL Solutions

Site Owners from SQLServerCentral

Directfrom Microsoft, this Exam Ref is the official study guide for the new MicrosoftDP-300 Administering Microsoft Azure SQL Solutions certification exam.

 

  Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

Counting Bits IV

What does this code return in SQL Server 2022+?
select bit_count(2.4) 
 

Think you know the answer? Click here, and find out if you are right.

 

 

  Yesterday's Question of the Day (by Steve Jones - SSC Editor)

The Character choice

What happens when I run this code in SQL Server 2022?

create table Names ( namestring varchar(20)) go insert Names select 'Steve' go select choose(namestring, 'steve', 'andy', 'brian') from Names

Answer: An error is returned

Explanation: The first parameter for CHOOSE is an index, which must be an integer, or a value that can be converted to an integer. Ref: CHOOSE - https://learn.microsoft.com/en-us/sql/t-sql/functions/logical-functions-choose-transact-sql?view=sql-server-ver16

Discuss this question and answer on the forums

 

 

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


SQL Server 2016 - Administration
KB5046856 fails to install - Hello experts, The following SQL update is failing to install on some of our SQL Servers with the following error. Is anyone else seeing this? I've tried Googling the error but have not found a specific fix for this issue. Thanks for any help. -- webrunner Update: Installation Failure: Windows failed to install the following […]
Perfomance in views - Hello, I want to ask you about the following case that I live with a company in my country. They have a SQL server licensed with SQL enterprice ver 2016, where in the same instance about 25 databases coexist and in particular the main one and heart of all the systems, the Erp base. There […]
Development - SQL Server 2014
Different number of records returned from SSMS and C# ExecuteReader - I am using the EXACT same query in SQL Server Management Studio (2014) as I am in my C# program, but I get different results. How is this possible? SELECT tblWTHistory.Date, tblWTHistory.EstCompDate, tblOperator.BadgeID, tblOperator.OperatorName, tblWTHistory.WONum, tblWTHistory.WOType, tblWTHistory.PartNum, tblWTHistory.CellReceivedQty, tblWTHistory.OpNum, tblWorkCenter.WorkCenterName, tblWorkType.WorkTypeName, tblWTHistory.WorkQty, tblWTStatus.StatusName, tblWTHistory.ReasonID, tblWTReasons.ReasonName, tblWTHistory.Rework, tblWTHistory.OpComment FROM tblWTHistory INNER JOIN tblWTReasons ON tblWTHistory.ReasonID = […]
SQL Server 2019 - Administration
Column Encryption/Exporting Windows Certificate - So random question about Windows Certificates -- I administer and develop a SQL Server DB App -- Back End is on an Azure Server/Front End is MS Access, about 35 End Users. We employ column encryption on a handful of fields, and re encrypt every 3 months or so.  When this encryption is done by […]
SQL Server 2019 - Development
where to find information about xE sqlserver.databases_bulk_copy_throughput - where to find information about xE sqlserver.databases_bulk_copy_throughput ? I'm searching for de description of all attributes ( e.g. "count" - is it number of B/KB/MB/GB or number of rows ? )
bulk load fails to for SAS when using the ms ODBC Driver 18 for SQL Server - bulk load fails to for SAS when using the ms ODBC Driver 18 for SQL Server. Aparently SAS has this documented, and the solution is to revert to v11 SAS Problem Note 69064 Are there any alternatives besides downgrading to v11 ?
Unique Count of IDs per 3 month period - I have an Appointments table with the fields MemberID and DateOfConsultation. Each member may have more than 1 consultation, with the same or different dates. I want to get a rolling 3 month period, where for the latest month, I get the data relevant to all the consultations that happened in that month and the […]
Unable to delete records from table - Hi, Im unable to delete records from a table.Im a little surprised as have not witnessed this. The SQL server runs on MSSQL 2019 RTM. I use the below queries. select top (5) * from Journal where createddatetime<'2006-01-01' -- To figure out the records below year 2006 Fetched the 5 top queries Delete from Journal […]
SSDT
SSIS Foreach From Variable Enumerator Multiple Variables - Currently I have a working script task which reads a directory to find filename(s) that match a certain regex. The ArrayList object is passed to a Foreach Loop which uses a Foreach From Variable Enumerator and a single variable index = 0 to BULK INSERT into a table. I am trying to add additional functionality […]
SQL Server 2022 - Administration
DBCC Clone Database Failing on SQL 2022 - When running clone sql is changing one specific table to History table and its failing. Please suggest if there is any bug  
Upgrading from SQL Server 2016 to 2022 - When we upgraded from SQL Server 2008 R2 to 2016 (Enterprise Edition) many years back, research found that it was advisable for us to run a number of steps due to changes in the cardinality estimation process, and to cater for any other changes due to databases being upgraded to the latest compatibility level: Run […]
Backup taking too much time - Hi Experts, One of my Large database having about 4TB in size is taking almost 3 days to complete the backup . To reduce the backup I stripped the same to 4 different cluster drives and still its taking the same time. The data stored is all documents and it uses filestream. Below are the […]
Keeping QUERIES for Using Again and Adding DB to Git/Github and VS Code - While I know that it will speed my learning to type queries as I need them, sometimes I have put other people's queries to good use, queries that I lack the skills to create but will likely use in the future.  Alas, I find no way to store and retrieve queries making them very accessable.  No […]
Found a Tool Very Helpful for Beginner - I struggled with remembering the conventions I'd chosen when creating column names and data types.  Likewise I struggle - continually - with relationships and keeping track of Foreign Key assignments.  While I have not fully resolved the last issue, I stumbled upon a query that will list all the data elements in a database along […]
SQL Server 2022 - Development
After an Oracle migration, write out a function into a View SELECT statement - This is the function oracle.xxxfloat BEGIN IF @first IS NULL OR @second IS NULL RETURN NULL IF @first < @second RETURN @first RETURN @second END Here is the select statement getting column2, where I need to write the function 'oracle.xxxfloat' inline as part of the select so I can phaze out the above function. In […]
 

 

RSS FeedTwitter

This email has been sent to [email protected]. To be removed from this list, please click here. If you have any problems leaving the list, please contact the [email protected]. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
[email protected]

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -