• Latest
Five Tips for SQL DBAs to Work Efficiently

Five Tips for SQL DBAs to Work Efficiently

December 17, 2021
Ubisoft’s Riders Republic Gets A Community Update

Ubisoft’s Riders Republic Gets A Community Update

May 23, 2022
Apparently We’re Getting More Info On The Final Fantasy IX Show This Week

Apparently We’re Getting More Info On The Final Fantasy IX Show This Week

May 23, 2022
GameStop launches NFT wallet for storing burst bubbles

GameStop launches NFT wallet for storing burst bubbles

May 23, 2022
Honor Magic4 Pro review – GSMArena.com tests

Honor Magic4 Pro review – GSMArena.com tests

May 23, 2022
Summer of Gaming 2022 Schedule: How to Watch and What to Expect

Summer of Gaming 2022 Schedule: How to Watch and What to Expect

May 23, 2022
Huawei confirms that its partnership with Leica has ended

Huawei confirms that its partnership with Leica has ended

May 23, 2022
One Piece Odyssey: Upcoming JRPG Shows Turn-Based Combat and 2 New Characters

One Piece Odyssey: Upcoming JRPG Shows Turn-Based Combat and 2 New Characters

May 23, 2022
How Many GPUs Should Your Deep Learning Workstation Have?

How Many GPUs Should Your Deep Learning Workstation Have?

May 23, 2022
Apple VP Dr. Sumbul Desai talks Apple Watch data health benefits in CBS interview

Apple VP Dr. Sumbul Desai talks Apple Watch data health benefits in CBS interview

May 23, 2022
Poll: Which Dormant Capcom Franchise Would You Like To See Return?

Poll: Which Dormant Capcom Franchise Would You Like To See Return?

May 23, 2022
Elden Ring Is Currently One of the Best-Reviewed Games in Modern History

Elden Ring Mod Pits Every Demigod Against Each Other in a Battle Royale

May 23, 2022
MacBook Pro delayed to August for new orders

MacBook Pro delayed to August for new orders

May 23, 2022
Advertise with us
Monday, May 23, 2022
Bookmarks
  • Login
  • Register
GetUpdated
  • Home
  • Game Updates
    • Mobile Gaming
    • Playstation News
    • Xbox News
    • Switch News
    • MMORPG
    • Game News
    • IGN
    • Retro Gaming
  • Tech News
    • Apple Updates
    • Jailbreak News
    • Mobile News
  • Software Development
  • Photography
  • Contact
    • Advertise With Us
    • About
No Result
View All Result
GetUpdated
No Result
View All Result
GetUpdated
No Result
View All Result
ADVERTISEMENT

Five Tips for SQL DBAs to Work Efficiently

December 17, 2021
in Software Development
Reading Time:5 mins read
0 0
0
Share on FacebookShare on WhatsAppShare on Twitter


Working efficiently in a production environment where even a minor change can have a profound impact on performance, there are some tips you can follow to ensure the best possible database performance. In this article, we will discuss five tips to make the job of an SQL Server DBA easier in a production environment.

1. Use the Maintenance Cleanup Task Utility To Delete Old Backups

While backups are an important part of an effective recovery plan, frequent backups can cause issues if the available storage space is limited. In such a situation, deleting old backups can help clear the storage space. The Maintenance Cleanup Task feature (in SQL Server 2005 and later versions) available in the Maintenance Plan Wizard can help remove obsolete database backup files.

Using Maintenance Cleanup Task, you can remove backup of all types (i.e., Full, Differential, and Transaction Log) from the given location. However, you can only delete one type of file in each Maintenance Cleanup Task. In other words, you cannot remove transaction log files (.trn) and full or differential backup files (.bak) in a single task. You need to create two tasks to purge the files.

To delete the old SQL backup files created using Maintenance Cleanup Task, do the following:

  • Expand Management in SQL Server Management Studio (SSMS).
  • Right-click on Maintenance Plans and select New Maintenance Plan. Specify a name for the plan like “DeleteOldBackups” and click OK.
  • On the Maintenance Plan Designer window, drag and drop Maintenance Cleanup Task from the Toolbox.
  • On the “Maintenance Cleanup Task” window, select backup files, and specify the backup folder and file extension of the file type you want to delete. For instance, specify “trn” if you need to purge transaction log backups and “bak” to delete the full database backup. Finally, select the time after which you want to delete the backup files.
  • Now the DeleteOldBackups task will get listed under Maintenance Plans. Right-click on it and click Execute. When you open your backup folder, you can see that the backup files older than two weeks have been deleted.

Deleting old SQL backup files created using Maintenance Cleanup Task

Note: You may also create a new job schedule to run the maintenance plan of deleting old backup files weekly.

For more information about Maintenance Cleanup Task, see Microsoft’s guide.

2. Change the Maintenance Plan Owner to SA

When a maintenance plan is created in SQL Server, a user logged into the server is the plan’s owner. If the owner’s account is locked or removed, the maintenance plan for scheduled jobs (like backup, etc.) will fail. By changing the owner of the maintenance plan to another account (besides your domain account), you will ensure that the jobs will run, even if your account is locked or deleted. However, you may need to manually change the job owner when changes are made to a job or maintenance plan. To resolve this, set the maintenance plan owner to SA.

Before changing the maintenance plan owner, it is important to find the current maintenance plan and its owner. For this, execute the following T-SQL query:

Use MSDB

GO

SELECT *FROM dbo.sysdbmaintenanceplans

Now run the below code to set the maintenance plan owner to “sa”. In our case, we will replace “Login_name” with the owner name returned using the above query.

Use MSDB

GO

UPDATE msdb.dbo.sysssispackages

 SET OWNERSID = SUSER_SID('sa')

WHERE NAME = 'Login_name'

3. Run DBCC CHECKDB for Large Databases Using Different Strategies

Checking database integrity using a basic DBCC CHECKDB command for large databases can take a longer time to complete. To run the CHECKDB command in significantly less time, try using a different strategy to run the command against databases of a large size. 

Essentially, to prevent DBCC CHECKDB from exceeding the allocated maintenance period, implement solutions discussed in the blog by Paul S. Randal: “CHECKDB From Every Angle: Consistency Checking Options for a VLDB”. The blog discusses using a backup to restore the SQL database on another server and running DBCC CHECKDB against that server, as one solution. Also, you can reduce the time to run DBCC CHECKDB by using the PHYSICAL_ONLY option.

4. Query Multiple Servers Simultaneously 

It is not easy to query thousands of SQL Servers individually in a production environment. But by creating a local server group or a Central Management Server and one or more registered servers, you can execute queries against multiple servers simultaneously. To do so, in SQL Server Management Studio (SSMS), go to Registered Servers, right-click a server group (i.e., Local Server Groups or Central Management Server), and select New Query.

In the query editor window, execute the below query:

USE master  

GO  

SELECT * FROM sysdatabases;  

GO    

5. Use a Professional Solution for Business Continuity

The primary responsibility of a production DBA is to keep the SQL Server running smoothly and ensure data availability. However, a disaster can happen when you least expect it and hamper business continuity. You may have invested in a disaster recovery (DR) solution to deal with such unplanned events.

While DR is an important component of a business continuity plan, per Nationwide’s study: a majority of small-business owners (68 percent) don’t have a written DR plan. If a DR plan doesn’t exist, a third-party solution such as a SQL recovery tool can help in extracting data from a database damaged due to hardware failure, ransomware attack, software bug, etc.

Wrapping Up

This article discussed the top five tips to make the job of a SQL Server production DBA easier. These tips included deleting old backups to free up storage space and changing maintenance plan owner to “sa” to ensure that jobs (like backup or restore) will continue running. It also explained the tips on running DBCC CHECKDB against large databases and querying multiple servers simultaneously. Lastly, it discussed how using a third-party SQL Recovery Tool can come in handy when everything else fails to bring the database online.  



Source link

ShareSendTweet
Previous Post

Big in size, comfort, and versatility

Next Post

Fortnite Winterfest 2021: Spider-Man: No Way Home Outfits And All the Rest Of This Year’s Goodies

Related Posts

How Many GPUs Should Your Deep Learning Workstation Have?

May 23, 2022
0
0
How Many GPUs Should Your Deep Learning Workstation Have?
Software Development

Choosing the Right Number of GPUs for a Deep Learning Workstation If you build or upgrade your deep learning workstation,...

Read more

Data Management Platform: Definition, Use Cases, Benefits

May 23, 2022
0
0
Data Management Platform: Definition, Use Cases, Benefits
Software Development

Modern DPMs can process billions of different events in a short period. The mere thought seems unrealistic, as such operations...

Read more
Next Post
Fortnite Winterfest 2021: Spider-Man: No Way Home Outfits And All the Rest Of This Year’s Goodies

Fortnite Winterfest 2021: Spider-Man: No Way Home Outfits And All the Rest Of This Year's Goodies

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

© 2021 GetUpdated – MW.

  • About
  • Advertise
  • Privacy & Policy
  • Terms & Conditions
  • Contact

No Result
View All Result
  • Home
  • Game Updates
    • Mobile Gaming
    • Playstation News
    • Xbox News
    • Switch News
    • MMORPG
    • Game News
    • IGN
    • Retro Gaming
  • Tech News
    • Apple Updates
    • Jailbreak News
    • Mobile News
  • Software Development
  • Photography
  • Contact
    • Advertise With Us
    • About

Welcome Back!

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?