Solve SQL Server Resource Database Crash


Based on Microsoft Documentation <The Resource database is a read-only database that contains all the system objects that are included with SQL Server. SQL Server system objects, such as sys.objects, are physically persisted in the Resource database, but they logically appear in the sys schema of every database. The Resource database does not contain user data or user metadata>

In this article, I will explain below 5 points:

  • information you need to know it about resource Database
  • List of Errors You can See it when mssqlsystemresource Corrupted or lost
  • Methods for troubleshooting these errors
  • Other Solutions to repair ‘mssqlsystemresource’ Database
  • How to take a backup from mssqlsystemresource Using SQL Server T-SQL
Continue reading “Solve SQL Server Resource Database Crash”

Moving Database Files on SQL Server Always On


I think all of us know how to move files for SQL Server databases from disk to another disk but today I will explain how we can do it on SQL Server always on to reduce the downtime and taking new backup to return the database to always-on again. Let us start on the technical steps.

  • Preparations Steps
  • Check the current DB Files locations
  • Check Always on Health Status
  • Disable all backup jobs on Primary and secondary servers
  • Suspend the data movement on Secondary server
  • Remove Database from Primary server
  • Update DB files by new disk location on secondary server
  • Stop SQL Server instance on Secondary server
  • Move (CUT) DB Files from old location to new Location (Past)
  • Start the SQL Server instance again
  • Verify the DB File Location Using T-SQL on the post
  • Join the DB to availability group from Primary server
  • Check SQL Server always on Health Status Using T-SQL on the post
  • Enable the SQL Server Jobs\
  • Failover the SQL Server for Primary (X) to Secondary Server (Y) and do the same steps on (X)

Let’s Start The Technical Demo

Continue reading “Moving Database Files on SQL Server Always On”

How to hide SQL databases from users using SSMS


I know the First question you will ask it  “Why we need to hidden it IF the user doesn’t have access on it and he can’t do any operation on this DB 🤔” Simple answer “Business needs & Business Case & Management Request” Whatever the answer but this is the request from management So let us see How we can do it using two solutions.

First Solution hide the DB using Permissions

Before starting on the solution, I need to highlight important point “to implement this solution the user will take ownership of the DB” and this will break the security role. To hide the DB, we need two steps after it the user when he will log in to SQL Server management studio, he will see only this database:

  • Deny or remove the permission of View on databases from the Public User on the instance level.

At this time no one will able to see any databases on the SQL Server management studio except the admins only this means you should grant this permission for specific users that you need them to view all databases “It is just view Permission, accessing the DB is another permission”.

  • Change the DB Authorization by the user name you need him to view this DB only or you can do this step on two or three or more databases at this time this user when he login to SQL Server Management studio he will view these databases only the other databases will be hidden.

Technical deployment scripts

Continue reading “How to hide SQL databases from users using SSMS”

How to create a SQL Database in Azure


How to create a SQL Database in Azure

(A Step by step procedure)

I am writing this blog and explaining how to create a database in Azure. As we know that Azure is a cloud computing service provided by Microsoft and is becoming popular in the world. As a DBA we need to know how to work in a cloud computing environment and therefore for the ease I providing a step by step solution for creating a database in Azure.

sql-database-windows-azure

Explanation:

First of all we need to login to Azure portal and need to check for SQL Database options as it will be on the left hand side as given in picture below.

SQL Database Options

As soon as we click on SQL database option, a new windows will open up as given in picture below:

pic 1

Here we can see in this picture that there is no database available. Now we have to create a new database and for that we need to click on Add button on the top as shown in picture.

As we click on add button so it will display a new windows which requires the information to fill in to create a database.

pic 2

pic 3

Here we need to provide the information as database name, subscription, resource group (if existing then use that and no need to create a new resource group for each database), another option here elastic pool which is already discussed in my previous blog , go through if not read

https://mirzahusain.wordpress.com/2018/08/06/sql-database-as-a-service-in-azure/

As this is a test database which I have created so not using elastic pool and simple creating a standalone single database in Azure. Rest settings pricing and collation we need to set here as per our requirements or choose default.

One more thing which is important that is location we need to choose as I have chosen East US , you may choose as per your company requirement and policies, for the test purpose you may choose any location and just try and hit.

pic 4

Check and fill all the option carefully as shown in the above picture and then hit the create button.

The deployment will start to create the database. I have created here the database named as “MirzaDB”. You would be getting the alert in the alert section as soon as deployment succeeded.

pic 5

Now database has been created and we can explore it by checking its size and other details as below in different pictures.

pic 6

Looking forward your likes & comments!

Mirza Husain

 

 

How to Fix Microsoft SQL Server Error 926 Instantly


Microsoft SQL server is the most popular database management system. It provides flexibility to the database administrator for managing the database. But, sometimes it creates numerous errors in different stages while working with the SQL server database. SQL database suspect error 926 is one of them, which creates hurdles in SQL transaction. Sometimes, it also vanish the smooth working of SQL server as it makes database inaccessible for the user.

Hence, this article will tell you the best solution on how to fix Microsoft SQL Server error 926. Before going towards the solution, let us discuss the symptoms and reasons behind SQL Server error 926.

SQL Server Error 926 – Find Out Reasons

  • The SQL database might be marked as suspected
  • When malware defect occurs in the hardware of the machine<
  • If corruption found in the header part of the system file
  • Sudden shut down of the server application also leads the error

How to Fix Microsoft SQL Server Error 926

You can resolve SQL database suspect error 926 with help of any of the solution discussed below:

Solution # 1: Resolve SQL Error 926 Using Server Management Studio

  1. Launch the SQL Server Management Studio on your computer system.
  2. After that, go to the Object Explorer >> Server Instance >> Stop option.
  3. Now, minimize the management studio & open the Control Panel on the system.
  4. After that, change the view screen to Large icon & click on the Administrative Tools.
  5. In this step, select the Services option to proceed further.
  6. Here, search for the SQL Server (MSSQLSERVER), right-click on it & choose Stop option.
  7. Close the control panel window & launch My Computer or Computer on Windows. In the computer, go to the location where SQL data has been saved.
  8. Select MSDBDATA and MSDBlog files and move them to another location.
  9. Now, go to the location where you had moved the file in the previous step and copy them.
  10. In this step, restore the management studio window & go to the Object Explorer section. Now, right-click on the Server Instance & choose Start option.
  11. Finally, click on the Refresh button of the Management studio in order to update the changes.

Limitations of the Manual Approach

The above discussed manual method involves a lot of brainstorming effort and it is a time consuming process.To fix SQL Server error 926, there is a long and complex command to be executed. There might be the possibility that you might make mistake during command execution. It also takes a lot of time to remove the error Microsoft SQL error 926 and to recover the SQL server database. Moreover, the manual procedure is completely unsuitable for the non-technical or less experienced users because this process contains the totally technical term. Thus, to replace the manual approach, an effortless approach is described which overcomes all such consequences of the manuals.

Solution # 2: Fix Microsoft SQL Server Error 926

To overcome all such drawbacks, users are suggested to take help from a third-party solution named as SQL MDF Repair Tool. The tool repairs corrupt MDF / NDF SQL server database file of SQL Server version 2017 & all below version. The software gives you two different options for exporting. One can export recovered database in SQL server database and as .sql script. Moreover, by using this Professional software, Microsoft SQL Server error 926 can be easily fixed without any hassle.

Final Words

In this article, we have discussed about SQL server error 926 and different methods to fix this error. The manual approach is available to fix SQL error 926 Suspect but it has many consequences. Hence, in order to perform a simple, easy and effortless recovery procedure, users can use SQL recovery tool. It is the easiest approach to remove SQL Database suspect error 926