You are on page 1of 3
Resource Database common Questions vysanil November 2, 2012 rr While working with customers, | get quite a few questions on Resource database. Hence | thought about answering some of them in this blog. ‘Some of the questions that | get: * Can access it through management studio? ‘+ Should | backup my Resource database along with the other system database backups? ‘+ Can change the Resource database path? Should |? + Can the size of Resource database increase over a period a time and with increased usage of the instance? ‘+ How to determine the Resource Database version or the last updated date? * How to restore the Resource database? ‘* What should I do if my Resource database gets corrupted? ‘+ When does it get updated? ‘+ How to detach Resource database? ‘+ How to move Resource database? Discussion in this blog Applies to: SQL 2008, SQL 2008 R2 and SQL 2012 (Note: SQL 2005 Resource database implementation is not included in this discussion; there are a few implementation differences in SQL 2005). Introduction to Resource Database: Before | start answering the questions, let me provide some background information on Resource database SQL Server has 4 visible system databases i. master, model, tempdb and msdb and it also contains a fifth, “hidden database Resource Database that you will never see using any of the normal SQL commands that list all your databases. Itis a read-only database that contains 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. Also Resource database makes upgrading to a new version of SQL Server an easier and faster procedure. In earlier versions of SQL Server, upgrading required dropping and creating system objects. Because the Resource database file contains all system objects, an upgrade is now accomplished simply by copying the single Resource database file to the local server. Database Id: 32767 ‘Actual Name: This database is referred to as the resource database, but its actual name is “mssqlsystemresource’, Physical File names and path: mssqisystemresource maf and mssqlsystemresourceldf Located in: :\Program Files\Microsoft SQL Server\MSSQL11.\MSSQL\Binn\ Questions on Resource Databas: Can L access it through management studio? In the object explorer you would not be able to see the Resource db. Kemet 34328 7 ES 1B .\sei2012 (SOL Serves 11.0.2100 -| 2B mose SQ ons 2 mad 2 temp © ( Oatabace Sorbets age ogee So now shutdown your SQL server instance and start the SQl instance in a single user mode: Now connect using your management studio and play around with the Resource Database as much as you like ) Should I backup my Resource database along with the other system database backups? No. If fact you cannot do a SQL server backup of the Resource database. Treat your resource database as if it were a binary file and not a database file. You can do a manual file copy of the mssqlsystemresource:mdf file, However if for some reason the Resource database has been corrupted or is unusable or unavailable then using the Repair option in the SQL setup would be the preferred method to repair the SQL server installation. If for some reason you still end up having to restore @ backup of mssqlsystemresource.madf file then make sure that you reapply any subsequent service pack/hotfix updates Can I change the Resource database path? Should I? No. Can the size of Resource database increase over a period a time with increased usage of the instance? ‘As the Resource database does not contain user data or user metadata its size should not increase with usage of the instance. It would remain constant however it can change with upgrades and service pack installs. How to determine the Resource Database version or the last updated date? SELECT SERVERPROPERTY('ResourceVersion’) ResourceDatabaseVersion, SERVERPROPERTY(‘ResourceLastUpdateDateTime’) ResourceDatabaseLastupdatedate; How to restore the Resource database? Using the Repair option in the SQL. setup would be the preferred method to repair the SQL server installation if Resource database is unavailable. Only other way to restore Resource database is to manually restore a backup of mssqlsystemresource.maf file. However if you do this then make sure that you reapply any subsequent service pack/hotfix updates What should | do if my Resource database gets corrupted? Refer to the answer for “How to restore Resource database” question. When does it get updated? During service pack installs and upgrades. How to detach Resource database? Cannot do a SQL detach/attach, You can do a manual file copy of the mssqlsystemresourcemdf file, How to move Resource database? Starting SQL 2008 Resource Database cannot be moved

You might also like