Rebuilding Log when SQL Server Services were not properly closed and log file is deleted. We have a database that is in a “Recovery Pending State”. We can see “AdventureWorks2012” is in Recovery Pending state. We can check the logs
The need to rebuild Master database comes when it is corrupted and we are not able to start SQL Server Service and getting error like this: 2016-01-01 21:21:20.19 spid5s Starting up database ‘master’. 2016-01-01 21:21:20.23 spid5s Error: 5172, Severity:
Find out the location of Tempdb Data and Log file.
SELECT name,physical_name FROM sys.master_files WHERE database_id = 2
We cannot move the tempdb by detach and attach method or backup and restore method. We can move the Tempdb by Alter Database method.
Alter database tempdb
( name = tempdev, Filename = 'C:\Move Tempdb here\tempdb.mdf')
Alter Database tempdb
(name = templog, Filename = 'C:\Move Tempdb here\templog.ldf')
Restart SQL Server
To attach a database for which we have only the .mdf file and not .ldf file of the database. The methods will work only when the database has been detached properly. Method 1 1. We only have a .mdf file
Open the SQL Server configuration manager. We are moving the master database of Default Instance. Right click on the SQL Server service and open properties. Go to “Startup Parameters”. In the startup parameters ‘-dC:\Program Files….’ is the directory of the
When a database is in SUSPECT state that means SQL Server knows that the database is Inconsistent. The best thing to do when you have a SUSPECT database is Restore a FULL backup. But if you are not having Backups
Log shipping creates jobs for Backup, Copy and restore. We need to create folders for the Backup and Copy. Backup folder should be on the network and SQL Server Agent service accounts of both primary and secondary server should have
Trace Flags are used to switch On/Off a specific characteristic in SQL Server. A trace can be either set for global scope or session scope depending upon your choice and requirement. A Trace flag enabled on the sessional scope will remain