Fix Corruption Due to Table Partition Error in SQL Server 2005

Microsoft SQL Server is one of the best and full-featured relational database management system. It provides various features like database partitioning in SQL server. But sometimes the user has to face various issues like Corruption due to table partition error in SQL Server 2005. So in this article, we are going to discuss the reason for this problem. Before proceeding further let us discuss database partitioning in SQL Server.

Database table partitioning in SQL Server is a process where large tables are divided into smaller multiple parts. It has many benefits, such as the user can speed up loading and Archiving data. It helps to reduce the overall response time for particular so that users can perform SQL operations easily.

The user can use DBCC CHECKTABLE Command to check the consistency of the tables, In case if the need arises to restore the data then the user can use the last database backup. In case if the user has don’t have the backup available then the user can take the help of SQL Recovery Software.

To understand, the situation let us consider with the help of an example, Suppose you have two partition tables named with Table A and Table B both the table having the same columns and the partitioned against the similar column. The user-created the clustered index on table B and drop It. After that, the user imported the data to table B with the help of the BULK INSERT command along with the TABLOCK option. This can cause corruption to the data, and the user will get an error with ID 8984 or 8988.

Reason Behind This Problem

The user will get this error because of the mismatch of the metadata of the two tables. When the SQL database user drops the clustered index of the table, the entire metadata gets changed. And when the switch the partitioned between the table, the entire information gets mismatched and the user has to face data corruption issues.

The user can try the DBCC CHECKTABLE Command with repair options to correct the data corruption issues. If there is any issue then the user has to delete the damaged table, in case of no backups, or corrupted backups then the user can try the SQL Recovery to recover damaged MDF files.

SQL Recovery software is one of the best tool to recover corrupted MDF file, this is a standalone utility which can easily repair the damaged SQL database. It helps to recover functions, tables, views, stored procedures, etc. After recovering the data the user can easily export to SQL Server.

Final Words

In this article, we have discussed Corruption due to table partition error in SQL Server 2005. Also, we have guided the best possible ways to resolve the problem. The user can try the DBCC CHECKTABLE command but in case if you are still facing the problem then the user can take the help of the automated solution.

Top 3 Methods to Reset SQL Sa Password Without Any Trouble

“Hello all. I am writing this post because I am in big trouble. I recently joined an organization and unfortunately, I forgot the password of SQL database. Not a great situation for a new employee, so can you help me out? Can anyone tell me how do I reset SQL sa password? I will be really grateful if you could suggest any easy solution.”

Are you also suffering from a similar problem as mentioned in the query? Do you also want to know how to reset SQL sa password ? Then this is the right blog for you. Read on.

SQL Server database administrators often find themselves in an awkward position when they forget or lose the database password. This problem can happen to anyone at any given time. If you find yourself in the same situation, do not worry. This post will elaborately discuss various methods that can be implemented to fix this problem.

3 Quick Methods to Reset SQL sa Password

If you have lost your SQL database password, do not jump into the decision of reinstalling the SQL Server. Keep patience and read the solutions stated in this section. Here we will learn two different methods to reset SQL SA password for SQL database.

Method 1: Use Management Studio to Reset SQL SA Password

If you have lost the SA password, you can easily reset it using the management studio. After that, you will regain the access to SA account by Windows Authentication mode.

  • Login to SQL Server. For this, use Windows Authentication.
  • Navigate to Object Explorer to expand Security folder. Now, expand Logins folder and right-click on SA account. From the options, click on Properties.
  • When Properties window opens, add new password and confirm it. Click on OK to set this as your new SA password.

Method 2: Use SQL Script to Reset SQL SA Password
In case you reset SQL database password, users can also try using SQL scripts to add a new password to the database.

  • First of all, you have to launch SQL Server Management Studio.
  • Open a new query in it.
  • Enter the scripts mentioned below for execution:
    GO
    ALTER LOGIN [sa] WITH DEFAULT_DATABASE=[master]
    GO
    USE [master]
    GO
    ALTER LOGIN [sa] WITH PASSWORD=N'NewPassword' MUST_CHANGE
    GO

Note: Here, NewPassword will be the password you want to use for your SA account in place of the lost password.

Method 3: Use SQL Password Recovery Tool

If you find these above-mentioned methods complex, or if you are not willing to perform those processes, we have a better option for you. Presenting SysTools SQL sa Password Reset Tool. This affordable yet effective tool will help you set a new password for SQL database whose password you have lost.

It is really simple to get back the access to your SA account using this utility. Launch the tool and add the MDF file in it. All of its users will get displayed on the screen. You will the password value of SA account is Unknown. Select SA and click on Reset Password. Add a new password and confirm it. Now you are all set to access the SA account using this password.

Attention: We strongly recommend having the backup of MDF file before proceeding with this method.

Conclusion

Forgetting the SQL database SA account password can cause immense trouble for the admins and many people in real life do suffer from this problem. That is why we see a lot of people asking the same question in forums, how to reset SQL database password. For them, we have described three simple solutions to change their password. If the manual methods are not working or seems lengthy, users can go for the tool mentioned here. This software is one of the most popular software

Recover Deleted Data From SQL Server Table by Transaction Logs

The task of creating tables, storing data in records look quite easy to SQL Server users. But if the data is being deleted by mistake or because of some other hardware or software issues, then the situation becomes complex. Recovery of deleted data is not a child’s play. So, considering this issue we have come up with this write-up which will help you to know various methods to answer your query how to recover deleted data from SQL server table by transaction logs? Let’s begin with a detailed discussion on the same.

Techniques to Rely On For Recovering The Deleted Data From Server:

1. Manual Method: – Using LSNs (Log Sequence Numbers), but it works only if the time of deletion is known to the user.
2. Automated Solution: – Simple yet secure and reliable solution for recovering deleted data from the server by using SysTools SQL MDF Database Recovery.

Know-How to Recover Deleted Data From SQL Server Table by Transaction Logs

Deleted Records’ Recovery Using SQL Server LSN:- In SQL Server transaction logs, the LSN(Log Sequence Number) is nothing but unique identifiers assigned to each record. Here we can restore the deleted rows of SQL tables if the time when the record was deleted is known.

User has to be ensured that the Full Recovery Model or Logged Recovery Model were created when the data was actually deleted for starting the recovery process. This is the prerequisite for the successful recovery of the deleted records.

The steps are described below to recover the deleted data from SQL Server 2016, 2015, 2014, 2012, 2008 and 2005.

Step 1: Fire the following query to know the total number of records in a table where from th record is being deleted.

Select * From Table_Name
Step 2: Next, run the procedure to take log back using the below-mentioned query:
USE NameOfTheDatabase
GO
BACKUP LOG (NameOfTheDatabase)
TO DISK = N’D:\ NameOfTheDatabase\RDDTrLog.trn’
WITH NOFORMAT, NOINIT,
NAME = N’NameOfTheDatabase-Transaction Log Backup’,
SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
Step 3: Information has to be collected from the SQL Server table about the deleted records for data recovery. This query will retrieve Transaction ID of the deleted records.
USE NameOfTheDatabase
GO
Select [Current LSN] LSN], [Transaction ID], Operation, Context, AllocUnitName
FROM
fn_dblog(NULL, NULL)
WHERE Operation = ‘LOP_DELETE_ROWS’

Step 4: Execute the query given below to know at what time exactly the records get deleted.
USE NameOfTheDatabase
GO
SELECT
[Current LSN], Operation, [Transaction ID], [Begin Time], [Transaction Name], [Transaction SID]
FROM
fn_dblog(NULL, NULL)
WHERE
[Transaction ID] = ‘000:000001f3′
AND
[Operation] = ‘LOP_BEGIN_XACT’

Ongoing LSN you will be able to find now query.
Step 5: Restore process has to be run to restore the deleted data from the SQL Server Table.
Recover Deleted D USE NameOfTheDatabase
GO
RESTORE DATABASE NameOfTheDatabase _COPY FROM
DISK = ‘D:\ NameOfTheDatabase \RDDFull.bak’
WITH
MOVE ‘NameOfTheDatabase’ TO ‘D:\RecoverDB\ NameOfTheDatabase.mdf’,
MOVE ‘NameOfTheDatabase _log’ TO ‘D:\RecoverDB\ NameOfTheDatabase_log.ldf’,
REPLACE, NORECOVERY;
GO
Step 6: Now is the time to verify if deleted records are recovered or not.

Efficient Way to Recover Deleted Records From SQL Server 2017 / 2016 / 2014

If you failed to recover deleted data from SQL server table by transaction logs then you can take the help SQL Database Recovery software. This software provides you the option to recover deleted records from SQL server table. Also by using this software, the user can preview accidentally deleted SQL tables records in red color. The user can easily recover database objects such as tables, functions, stored procedure. Moreover, This application is compatible with SQL server 2017 and its below version.

download

Follow The Steps to Recover Deleted Records From SQL Server Table

1. Download and Install the software on your machine.
2. Click on Add file button and add the MDF file in the software.
3. Now choose the Scan option and select the SQL server version.
4. Check the option preview deleted SQL database records in red color.
5. Preview the SQL server database items. The software will preview the deleted SQL table records in red color.
6. And click on Export button to Export the SQL database.
7. Now in database authentication choose the server name and the authentication mode.
8. Now choose the destination database
9. Check the Database items you want to export.
10. Choose the option from with only schema and schema and data.
11. Mark the option Export deleted records and finally click on Export button.

Final Words

In this article, we have discussed how to recover deleted data from the SQL server table by transaction logs. The manual solution is quite lengthy and difficult to perform. It requires strong technical knowledge. So it is better to take the help of SQL database recovery tool to recover deleted records easily.

Best Practice in Rebuilding Index in SQL Server

For every Database admin, ensuring the smooth performance of the SQL Server is a headache. They need to perform various tasks and tricks for a productive and fast SQL database. One such common task is to keep the Index fragmentation in check. While this is a challenge for the DBAs, Index Fragmentation can be controlled by reorganizing and rebuilding.

Rebuilding Index in SQL Server is the method often used when the fragmentation level goes higher. If you want to improve the performance of SQL database, you have to rebuild the index. But the question is when and how to perform this task. This write-up will focus on the best practices in rebuilding index of SQL Server. We will also discuss when is the right time to conduct this task easily.

Rebuilding Index in SQL Database – Know Why and When to Perform?

It is known to the SQL Server users that database performance gets significantly hampered if the SQL database becomes full of fragmented indexes. As Index Fragmentation keeps increasing along with the database usage, admins should be careful about the fragmentation rate. Depending on the database size, DBAs should fix a schedule when the index fragmentation will be checked using “sys.dm_db_index_physical_stats” command. When this command is run, users can learn about the percentage of index fragmentation in SQL database.

If the percentage is as low as 10%, no additional action is needed. If the level is between 10%- 30%, you have to rebuild the index to enhance its performance. Only when it crosses the 30% bar, the question of rebuilding index in SQL Server comes to the scene. However, some SQL Server experts recommend performing Index rebuilding only when the fragmentation rate reaches 80% or 90%. Since rebuilding index is a resource-consuming task, database admins should consider how much the fragmentation affects the database performance before rebuilding the index.

Best Practices in Rebuilding Index in SQL Server

If you are interested in rebuilding indexes, it is better to follow certain basic rules, known as the best practices in Index rebuilding. For example, if you are using any SQL Server edition other than the Enterprise Edition, then this task should be done offline. Since the feature of Online Index Rebuilding got introduced in SQL Server 2005 Enterprise Edition, any earlier version users need to perform it offline. With Online index rebuilding, the index never goes offline and table also remains available for use during the process.

In case of SQL Enterprise Editions that support online index rebuild, the online process takes more time than offline rebuilding. That is why, offline index rebuilding is highly recommended if the company can afford downtime. To minimize the downtime, it should be done when minimum people are using the database or it should be done along with scheduled maintenance tasks. Therefore, nighttime is perfect to schedule index rebuilding. It is also suggested to conduct this task at least once a week. If you do not have any maintenance window for your database, you can try doing Online rebuilding.

Rebuilding Index in SQL Server consumes a lot of resources. So performing it too regularly will create inconvenience to the database with scarce resources. Database admins should consider their database capacity and resources before scheduling the index rebuilding.

Note:  Get to know How to Deal with Index Corruption in SQL Server

Concluding Thoughts

Index fragmentation is a common situation in all SQL databases. The productivity of the SQL Server depends on the level of Index fragmentation. Only a controlled Index fragmentation rate is desirable for smooth functioning of SQL Server. Among many approaches that keep the fragmentation level in control, rebuilding Index is a popular one.
In this process, logical index fragmentation is removed, statistics get updated and database page space is emptied. Therefore, users should include this in their maintenance scheduling window. They can also learn about the best practices in rebuilding index in SQL Server from this post. Also, consider the situation of your own SQL database to customize the rebuilding process.

SysTools SQL Transaction Log Reader 5.0 : Know What is New

The SQL Transaction Log reader is a standalone utility, which helps to view SQL server transaction log files without any difficulty. It is capable enough to preview LDF activity, including Transaction, Time, Name, Query and Table Name.

Moreover, it allows a user to fetch and display all records from the live database. This application offers an option to filter and export as SQL database, as SQL script or CSV file format. It supports to analyze one or more NDF data files without losing a single bit of data. Also, it is compatible with all latest Windows versions, including Windows 10 and its below versions.

SQL Transaction Log reader Tool: Demo vs Licensed

The SQL Log viewer is available in two different versions i.e., Demo and Licensed Version. Let us have a look:

  • Demo Version: The demo version of the software is freely available for download and supports to preview of SQL Server Transactions (INSERT, UPDATE, DELETE), preview Login users that has made changes on database tables, transaction Query, Time. But, doesn’t allow to export Transaction details for recovery purpose.
  • Licensed Version: The licensed version of SQL Transaction Log reader tool permit users to preview all the records within the database. Moreover, it can open and read the complete log activity in SQL server database. Also, it allow you to export all tables data along with deleted records direct in SQL Server Database or SQL Server Compatible script or CSV format.

The Demo version of this SQL Log Recovery available for download in SysTools Group Official Website

Preview SQL Logs

What is New Added in SQL Log Reader Tool to Explore LDF

  1. Allows to View Multiple LDF Files: SQL LDF File Viewer permits you to open and read multiple transaction log files activity in single go. For this, you just need to add parent .ldf file of your database, if you are scanning with offline option. The software will scan and preview transaction activities of all other .ldf database files of that database.
  2. Analyze Same record Update
    Multiple Times and then Delete: SQL log file reader allow you to preview the transactional activity of same record (Updated multiple times and then Delete). This will allow users to track all the database changes for a specific record.
  3. Auto Fetch SQL Server Name: While scanning the transaction logs of a specific database with Online DB option,The SQL transaction log reader tool will allow you to click on drop-down button to auto fetch the Server Name. In case, the software doesn’t shows the desired Server Name, then you can enter it manually.

Existing Features of SQL Log Viewer

  1. Preview All Transaction Records: SQL Server log file viewer scans and load all available tables transactional activities, present in SQL database and creates a preview. It will help to view SQL transaction log file with fields such as Transaction, transaction time, Table name and query. Users can view all records with Login Name Authentication for Insert, Delete, Update etc.
  2. Option to Sort LDF File Elements: The sorting option is available within SQL Log viewer to re-arrange the order of the listed items. Moreover, users can sort each element according to their properties such as transaction, transaction name, transaction time, table name, and query.
  3. Scan with Online or Offline Options: The SQL log file viewer offers two different scanning options to read transactional activities of your database. The Online option asks for SQL Server information like: Server Name, Authentication Type. In Offline option, the software will allow you to browse .ldf file along with its associated .mdf file and preview the transaction log activities.
  4. Export Selective Tables: While moving the SQL LDF file queries, you can check or uncheck all tables for saving only selected data. If you want to restore SQL Log file data from the desired table, then, select and export the desired tables direct to SQL Server Database or SQL Server compatible script or CSV format.

Technical Description of SQL Server LDF Reader Tool

Processor Intel® Pentium® 1 GHz processor (x86, x64) or equivalent
Support RAM Around 2GB (gigabyte) of RAM
Hard Disk Storage Space Minimum 100 MB space for installation
Operating System Windows 10 & all below editions

Final Verdict

After considering the overall functionality of the software, we can summarize that SQL Transaction Log Reader is a reliable tool that allows a user to read and view multiple .ldf files. The software is capable enough to view SQL transaction log with fields such as Transaction, transaction time, Table name and query. Regardless, we can say that the SQL log Viewer is a robust software due to its great features.

How to Fix Corruption Related Issues in SQL Server Database

SQL database is a popular and useful relational database, but it is not free from technical flaws. SQL users often face various corruption related issues in SQL Server database. These issues occur due to the damage or corruption in the database of SQL Server. As these are common issues, SQL users must have clear concept regarding these issues. We will be discussing some major corruption related issues of SQL database and their symptoms. Users will also learn the remedial methods of these issues from this post. Let’s begin our discussion with the SQL Server errors and their symptoms.

Issues Related to SQL Server Corruption

Due to damaged or corrupt SQL Server database, users have to encounter different issues. We will discuss three major issues here.

SQL Fatal Error 823:

This error is caused by database corruption or some discrepancies of file system. It indicates that underlying hardware or driver situated n the path of I/O request is having some problem. This problem will generate some error messages that will display these information:

  • Operating system’s error code and error description
  • The file name that was executed against I/O operation
  • If I/O operation request is written or read

SQL Error 5172

This error is caused by unhealthy MDF files. It occurs due to the mismatched header file information, so accessing data becomes really tough. In such cases, recovering damaged SQL database is very important. Here are the major causes of error 5172:

  • Sudden shutdown of system
  • Hardware malfunctioning
  • Improper shut down of SQL Server
  • Virus or Malware attack

3. SQL Error 8946: If a particular assigned page does not contain valid page header, error 8946 can appear. If the header gets damaged, the entire page faces corruption. This results in data loss and inaccessible file. Power failure, hardware problems, virus attack, etc. are responsible for this particular error.

How to Resolve Corruption Related Issues in SQL Server Database

If you are facing one of the above corruption based issues in your SQL database, it means the database has been corrupt or damaged. The only way to resolve these issues is to free the SQL database from all types of corruption. To repair the corrupt database of SQL Server, users can adopt any of the two different methods. One is called manual method and another is called one-stop method.

Method 1: Manually Fix SQL Database Corruption

If users want to fix their corrupt SQL database manually, they can try these different methods. First of all, they can restore updated backup of SQL Server. They can also try database console commands to repair database. DBCC Repair commands that can fix minor corruption of SQL database.

Limitations of Manual Technique

These manual methods have got some limitations too. The biggest limitation is that none of these methods guarantee to recover SQL Server database. Moreover, all these methods take a lot of time to perform. Users need to be technically expert to execute these steps. Inexperienced people needs to be careful about their database, when performing these methods. Also, major corruptions cannot be fixed by these methods.

Method 2: Fix Corrupt SQL Server Database using Sure-Shot Solution

It is clear from above discussion that manual methods cannot fix damaged database for sure. To repair corrupt database, users have to apply the one-stop solution. Using third-party tools is called sure-shot solution as they can fix all types of database corruption. SysTools SQL Database Repair is such a tool that can remove both major and minor SQL Server database corruption. It can fix corruption of SQL Server 2016 & all previous versions. This program is also capable of recovering data from MDF files affected by Wallet Ransomware.

Conclusion

If you are facing any of these corruption related issues in SQL Server database, be sure that SQL Server has been damaged. Users need to fix the SQL Server in order to get rid of these issues. we have mentioned some methods to make your SQL database corruption free. Users can try manual methods, but there is no guarantee that the damaged database will be fixed for sure. One can also try the third party tool to recover corrupted database. It can easily fix the damage of SQL Server and all related issues will get solved.

Best Solutions to Repair Suspect Database in MS SQL Server

To repair Suspect database error in MS SQL 2005, 2008, 2012, 2014, 2016 and 2017 read this article to recover SQL Server database from Suspect mode.

What is Suspect Database Error?

Microsoft SQL Server serves as a storehouse for data that is needed for different software applications on a single system or across a network. Sometimes a user may face a situation where a database in the SQL Server instance currently under running state is marked as Suspect. This condition will lead to a failure in creating a connection with the database. Such a database which is tagged as Suspect can be accessed by removing the causes for this problem. The forthcoming article will discuss the causes for this problem to occur and the possible solutions to repair suspect database from SQL Server 2005, 2008, & 2012.

The error message shown to user is somewhat similar to the one given below

Starting up database ‘abc_d’.
Error: 9003, Severity: 17, State: 5.

The log scan number (189623:15:2) passed to log scan in database ‘abc_d’ is not valid.

The above-mentioned error shows that there is some corruption of the log file(.ldf) and does not adhere to the data file(.mdf). Other error messages can also be shown depending upon the cause due to which the database has been categorized as Suspect.

User queries help in getting a better idea about the problem and to recover SQL database.

“I am currently using SQL Server 2008 edition on my Windows 7 system and there are many applications of mine that are dependant on it. Recently I have been facing difficulties in connecting my applications to some of my Databases and they are being shown as Suspect. Kindly guide me to recover SQL database from Suspect mode.”

SQL Server Database Shown as Suspect: Possible Reasons

There are a number of reasons why SQL Server marks a particular Database as Suspect.
Some of these reasons are mentioned as follows

  • Corruption present in the SQL Server Database
  • Insufficient space available to SQL server to repair suspect database during startup.
  • The files of Database are in use by OS or other Backup software
  • Sudden SQL Server Shutdown, Hardware or Power Failure

There exist a number of techniques for solving the issue of Suspect SQL database and broadly they can be classified as Manual and Automated. The upcoming section will try and explain a Manual technique for achieving this goal.

Quick Tip: If you want to skip the tedious & complex manual approach then it is highly advised to use an automatic tool such as SQL Recovery to efficiently recover SQL database from Suspect mode

Repair Suspect Database Manually

Implement the steps given below to recover Suspect SQL Server Database and to access important data.

1. Bring Database in Emergency Mode using the following code

USE master
GO

ALTER DATABASE abc_d SET EMERGENCY
GO

2. Execute DBCC CHECKDB command.
This will scan and check the physical and logical integrity of objects present in the marked database

DBCC CHECKDB (abc_d )
GO

3. Bring the Database in Single Mode using the below-mentioned query

ALTER DATABASE abc_d SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO

4. After the Database is in Single Mode, execute the following code to repair suspect database

DBCC CHECKDB (abc_d, REPAIR_ALLOW_DATA_LOSS)
GO

5. Lastly, restore Multiple access to the database by executing the query

ALTER DATABASE abc_d SET MULTI_USER
GO

Repair Suspect Database by Manual Method: Shortcomings

  • Manual solution consumes a lot of the users’ time for SQL server suspect database repair
  • High risk of losing data forever during manual approach to recover SQL database from suspect mode
  • A Large number of queries to recover SQL database make it complex for non-technical users.
Conclusion

The Suspect database problem is a common issue faced by users of SQL Server database and it has various causes. There is a set of TSQL commands to overcome this error but it poses many issues during implementation. It is better to use automated tools designed specifically for this purpose to repair suspect database.