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

Ten Database Commandments

I love the Notorious B.I.G. His music isn't for everyone, but I enjoy it. This piece takes one of his songs (NSFW - Ten Crack Commandments) and applies the list to databases. Each item from the song is listed, along with the way it might be changed for database work. The list is from Ottertune, which is a service designed to help you optimize your use of AWS RDS and Aurora databases, with AI. If you believe their hype, their service will get better performance and lower costs for you.

In any case, with regard to databases, I suspect that the author is having some fun with the rules, and a few of them made me smile. They are cloud-related, but a few will apply to any environment.

The first one is about budgets, noting you should not disclose your budget, which is in general a good rule whenever you are buying something. Don't disclose information, and someone working for a vendor of tools, I think that most budget conversations aren't something technical people should worry about. Decide what value you get from some tool/service/process/etc. and if there are time savings. Then let someone else decide if the ROI is worth the cost.

Rule 2 is a stretch, but I do think that looking at new tools can be helpful. The caveat here is that many people, don't often learn enough about existing tools to understand if they will solve issues. There are a lot of things you can do with many tools, so don't just look for some magical new tool. Learn to use your tools well, and if you want to try a new one, keep in mind you will need to invest some time both learning about it and practicing some skills before you really know if it's helpful. The other thing to remember is every new tool increases the bar for new staff. Try to limit the number of tools you use to those you need.

Security is important and rule 3 is remembering not to give out more permissions than needed, especially to developers. I love this quote: "You don’t want randos at your organization logging in and running queries that they found on Stack Overflow."

A number of the other rules have to do with performance, which is certainly Ottertune's business, but these are good basic practices that I see organizations not following. Too often management wants to save money and technical people make decisions that compromise performance. Lots of people overload systems, and then they can't handle the workload well. I get that many CFOs and others want to see high CPU usage, which means they're using the resources they pay for, but databases can be very bursty with resource usage. At the same time, you don't want to over-provision resources because you are scared. Learn to find a balance that doesn't waste money, but handles your workload well.

Perhaps one of the best things about the cloud is that if we do make bad decisions, we can often provision more resources. It can take time to move to a new tier of service, so don't expect instance response up or down, but if you need to double the CPUs for month-end processing, you can likely plan for the time to scale up your database instance and then scale down again when all the work is complete.

It's a fun article, and if you're looking for some fun Notorious B.I.G.-related database content, grab a cup of coffee when you need a break and a smile.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

Sentiment Analysis with AI

Daniel Calbimonte from SQLServerCentral

Learn how to use Python and AI to perform a sentiment analysis on text.

External Article

“How do my peers do this?” The latest best practices for IT architects implementing a major business initiative

Additional Articles from Redgate

How do other architects solve the common problems they encounter when tasked with implementing a major new business initiative? We asked 9 of your fellow IT architects to tell us how they approach the most common challenges.

External Article

What are Warehouses in Microsoft Fabric?

Additional Articles from MSSQLTips.com

In this article, we look at using Microsoft Fabric to build a data warehouse and some things you should know about doing this.

Blog Post

From the SQL Server Central Blogs - Running a Command Line SQL Compare Comparison

Steve Jones - SSC Editor from The Voice of the DBA

Recently a customer was looking to automate some of their SQL Compare checks, but they wanted to do this in a dynamic way, since they needed to do this...

Blog Post

From the SQL Server Central Blogs - How to write efficient TSQL

Hemantgiri S. Goswami from SQL Server Citation - SQL Blog by Hemantgiri S. Goswami, SQL MVP

This is an article on How to write efficient TSQL. When it comes to composing T-SQL (Transact-SQL) code, there exist a multitude of vital considerations developers should bear in...

Pro SQL Server 2022 Wait Statistics: A Practical Guide to Analyzing Performance in SQL Server and Azure SQL Database

Site Owners from SQLServerCentral

Use this practical guide to analyze and troubleshoot SQL Server performance using wait statistics. You'll learn to identify precisely why your queries are running slowly. And you'll know how to measure the amount of time consumed by each bottleneck so you can focus attention on making the largest improvements first. This edition is updated to cover analysis of wait statistics current with SQL Server 2022. Whether you are new to wait statistics, or already familiar with them, this book provides a deeper understanding on how wait statistics are generated and what they mean for your SQL Server instance’s performance. 

 

 Question of the Day

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

 

Minimal Stats Creation

If I want to create statistics in a SQL Server 2022 database, what do I need to include in the CREATE STATISTICS command?

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)

Finding Server Roles

I want to query for server roles. I see a DMV for server_principals and server_role_members, but where are the server role names stored?

Answer: In master, in sys.server_principals

Explanation: Server roles are stored in server_principals alongside the logins. There is a type and type_description that separates logins and roles. Ref: sys.server_principals - https://learn.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-server-principals-transact-sql?view=sql-server-ver16&tabs=sql

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 2017 - Administration
Unable to shrink Data File in SQL Server (Taking too much time) - I am using : SQL Server 2017 Standard edition Windows Server 2016 (Standard) Database Size: 1.2TB Used space from the Primary Data File: 300GB Unused space in a Primary Data File : 874GB Recovery Model: Simple I am trying to shrink the Data file to 600GB by using a following Command: DBCC SHRINKFILE (N'TestDB' , 614400) […]
Administration - SQL Server 2014
Replication subscription says inactive - Hi All, I am new to replication, one of my replication subscription says inactive. I just got handover of existing server and it has 4 publications. One of it says inactive, not sure it is really use or not used. Any suggestion to check it is in use. How to fix etc.  
SQL 2012 - General
SQL Scripts automatically invoked - When detecting the processes in the SQL Server 2012, I found there was a SQL scrit executed automatically automatically many times, the following as attachment, do you know when the script will be executed and when it will be executed? thanks a lot!
SQL Server 2012 - T-SQL
Invalid column name Error - hi all, I'm trying to run this query to select from table (as html) to be used for sending an email but actually it keeps giving that only two columns doesn't exist while they are already there, what may be the cause of this error? Msg 207, Level 16, State 1, Line 16 Invalid column […]
SQL Server 2019 - Administration
Replication Question - Hi All, I am Replication, I have given one of existing server which has 4 publication and 2 are self replicating to the same server as different DB name  and 2 are going to other server. I would like to know, what are all the initial checks I need to do. What are all the […]
Log shipping restore - On log shipping secondary instance/database, is there an option when restoring database to exclude some most recent transaction log, I mean to restore to some point that is not use the newest  a couple of transaction logs for example. Thanks
does the manual backup break log shipping chain - I have set up log shipping on the server, but if I do a manual backup for other purpose outside of log shipping, will that break the log chain of  the log shipping and cause failure of restore or loss of data on the secondary database? Thanks
Log shipping time_since_last_backup - I am using SQL server 2019, I have a database setup transaction log shipping on Server A, and secondary on Server B. I have a need to setup another database to also use transaction log shipping, also primary db is on ServerA and secondary is on Server B. When I setup the Alert monitor instance […]
SQL Server 2019 - Development
how to reverse comma seprated values. - hi, i have coma separated vales in a table. what i want to reverse it like 'CLP,CAD,GBP' pls tell me how it can be done with out using xml in efficent way. Copy DECLARE @TBL AS TABLE (COLUMN1 NVARCHAR(100)) INSERT INTO @TBL SELECT 'AUD,BRL,GBP,CAD,CLP' SELECT COLUMN1 FROM @TBL
Reporting Services
Problems with Reporting Services - Execution account - Access db not working - Hi, Im trying to set upp a datasource against a Access db. I can access the database when selecting "As the user viewing the report" but not when selecting "Without any credentials". I have even tried setting up the execution account with my admin user but I get the same error message: "ERROR [HY000] [Microsoft][ODBC […]
Analysis Services
Product Hierarchy in a Matrix with 8+ measures on Values-- Perfomance - I'm not new to PowerBI, but I'm new to this problem. I'm working for a company that's creating a PowerBI solution on Azure for a retail company.  They have a proper star schema (Sales fact in the middle, and then these dimensions: Product (hierarchy, 8 levels), Date, Store Hierarchy. And then they have like 8 […]
SQL Server 2022 - Administration
FAIL_PAGE_ALLOCATION - Hello everybody, today one of our aoag crashed. Suddenly we were not able to connect via SSMS to the aoag listener, or to the actice primary node. We got this entry in the ERRORLOG, but I was not able to found something in the internet: spid143,Unknown,Failed allocate pages: FAIL_PAGE_ALLOCATION 16 (ERRORLOG from the sql server, […]
SQL Server 2022 - Development
Advanced SQL Query Optimization Assistance Needed - Hey guys, I'm having a real tough time optimizing a SQL query for my project. I've been working with SQL Server for years, but I've never encountered this issue before. The query is supposed to search for specific date ranges within a large dataset, but the search results are inconsistent, which is really unexpected and […]
Time allocation across blocks of time - I've been working on this problem for a few days now and cannot find a way to solve it. blockstart | blockend | next_blockstart | ADUserGuid | DispositionId | WorkflowId | StartDate | EndDate -------------------------|--------------------------|------------------------|--------------------------------------|---------------|------------|------------------------|------------------------ 2023-10-01 05:00:00.00 | 2023-10-01 05:14:59.000 | 2023-10-01 05:15:00.000| 123e4567-e89b-12d3-a456-426614174000 | 101 | 1001 | 2023-10-01 05:00:01.00 | 2023-10-01 05:14:58.000 2023-10-01 […]
How to Efficiently Find and Remove Duplicates in a Large SQL Database? - I have a large SQL database with millions of records, and I've identified duplicate entries. What's the most efficient way to find and remove these duplicates without compromising database performance or data integrity? Are there any best practices or SQL queries that can help in this situation?" This question addresses a common database maintenance task […]
 

 

RSS FeedTwitter

This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. 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.
webmaster@sqlservercentral.com

 

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