Posts

Showing posts from January, 2021

SQL Server services are not starting or not coming online

Image
 SQL Server services are not coming online and throwing below error in the eventvwr. So we need to bring it online with single-user mode. Error: => SQL services were not coming up as it was failing with the below errors for all the System databases: FCB::Open failed:  Could not open file d:\dbs\sh\sprel\0822_164025\ cmd\33\obj\x64retail\sql\ mkmastr\databases\mkmastr. proj\MSDBData.mdf for file number 1.  OS error: 3(The system cannot find the path specified.). 2020-12-22 19:37:05.47 spid15s     Starting up database 'mssqlsystemresource'. 2020-12-22 19:37:05.47 spid7s      Error: 5120, Severity: 16, State: 101. 2020-12-22 19:37:05.47 spid7s      Unable to open the physical file "d:\dbs\sh\sprel\0822_164025\ cmd\33\obj\x64retail\sql\ mkmastr\databases\mkmastr. proj\MSDBData.mdf". Operating system error 3: "3(The system cannot find the path specified.)". 2020-12-22 19:37:05.47 spid7s      Error: 17207, Severity: 16, ...

How to check whether your installed SQL Server instance is CORE or CAL

One day we got a mail from client asking us to upgrade existing SQL Server instance to new version and edition. At the same he also asked me the existing SQL Server instance license type is it a CORE or CAL. I have gone through the a couple of SQL Server commands like  SELECT @@version and SELECT SERVERPROPERTY('LicenceType') but the results shown as NULL. Later i checked with one of my old friends and he suggested me to check that in the below path. And i found it in the below path. You can see multiple .txt files here but take old folder and you could see a file name like  SQL_ENGINE_CORE_INST_CPU64_1. If you open this file you could see a product name as second line  below C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20140708_110252 Product: \\Racnu337bn08\ddrive$\x64\setup\ sql_engine_core_inst_msi \ sql_engine_core_inst.msi

database files movement from one drive to another drive in sql server

1 ) Capture the .mdf and ldf file names of that particular datbase to which you want to move SELECT * FROM sys.master_files 2 ) Ensure that you have latest .BAK file available for rollback plan 3 ) Take that particular database alone into OFFLINE ALTER DATABASE database_name SET OFFLINE 4 ) Move the files to new location 5 ) Run the below command make changes at system catlogue level USE master GO ALTER DATABASE AdventureWorks2012 MODIFY FILE( NAME = AdventureWorks2012_Log, FILENAME = 'C:\NewLoc\AdventureWorks2012_Log.ldf' ); GO ALTER DATABASE AdventureWorks2012 MODIFY FILE ( NAME = AdventureWorks2012_Data, FILENAME = 'C:\NewLoc\AdventureWorks2012_data.mdf' ); 6 ) Bring the database ONLINE ALTER DATABASE database_name SET ONLINE 7 )Once the database came online run the below commmand to chek whether the new path appearing at catlogue level SELECT name, physical_name AS...