Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Resource Database Expand / Collapse
Author
Message
Posted Wednesday, May 30, 2012 9:23 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 4:44 PM
Points: 5,589, Visits: 24,962
Comments posted to this topic are about the item Resource Database

If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
Post #1308731
Posted Wednesday, May 30, 2012 9:36 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, August 18, 2014 6:23 AM
Points: 1,413, Visits: 1,821
It is my understanding that the service packs/upgrades have the potential to modify all databases on the SQL Server instance, therefore, simply replacing the resource database to rollback an SP/update is not enough.

The reasoning behind this is that if we take a backup of a database on let's say SQL Server 2008 SP1, we cannot restore it in SQL Server 2008 RTM.

Please correct me if wrong.


Thanks & Regards,
Nakul Vachhrajani.
http://beyondrelational.com/modules/2/blogs/77/nakuls-blog.aspx
Be courteous. Drive responsibly.

Follow me on
Twitter: @sqltwins
Google Plus: +Nakul
Post #1308732
Posted Thursday, May 31, 2012 1:27 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 4:11 PM
Points: 5,969, Visits: 8,228
Good question! One minor nag (isn't there always one?) - I don't like the wording "System objects such as sys.objects are physically persisted in the Resource database" (and yes, I know that similar wording is used in BOL). This suggests to me that the result of "select * from sys.objects" is persisted (as the same term is used in documentation about indexed views, aka persisted views - where that is exactly what happens).

Reality is that metadata about user objects (which is what you see when you query sys.objects) is stored in hidden tables in user databases; sys.objects is not a system table but a system VIEW, and the source code of that views (the query on the hidden actual system tables) is what's stored in the resource database.



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1308773
Posted Thursday, May 31, 2012 1:31 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 4:11 PM
Points: 5,969, Visits: 8,228
Nakul Vachhrajani (5/30/2012)
It is my understanding that the service packs/upgrades have the potential to modify all databases on the SQL Server instance, therefore, simply replacing the resource database to rollback an SP/update is not enough.

The reasoning behind this is that if we take a backup of a database on let's say SQL Server 2008 SP1, we cannot restore it in SQL Server 2008 RTM.

Please correct me if wrong.

I'm not sure if I understand the question. Service pack upgrades (and downgrades in the case you roll back an upgrade) always apply to the entire instance, and affect all databases on the instance. As far as I know, data and log files are never modified as part of a service pack install.
If what you say is true (backkups on SP1 can't be loaded on RTM), then the reason is that the code that is executed when you perform a backup or restore statement has been changed as part of the service pack. This code lives partly in the sql server executables (sqlservr.exe and a whole bunch of DLLs), and partly in the defintions of system objects in resourcedb. The latter part is mostly the code for system stored procedures and system views.

Does this address your question?



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1308774
Posted Thursday, May 31, 2012 1:37 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, August 18, 2014 6:23 AM
Points: 1,413, Visits: 1,821
Hugo Kornelis (5/31/2012)
Nakul Vachhrajani (5/30/2012)
It is my understanding that the service packs/upgrades have the potential to modify all databases on the SQL Server instance, therefore, simply replacing the resource database to rollback an SP/update is not enough.

The reasoning behind this is that if we take a backup of a database on let's say SQL Server 2008 SP1, we cannot restore it in SQL Server 2008 RTM.

Please correct me if wrong.

I'm not sure if I understand the question. Service pack upgrades (and downgrades in the case you roll back an upgrade) always apply to the entire instance, and affect all databases on the instance. As far as I know, data and log files are never modified as part of a service pack install.
If what you say is true (backkups on SP1 can't be loaded on RTM), then the reason is that the code that is executed when you perform a backup or restore statement has been changed as part of the service pack. This code lives partly in the sql server executables (sqlservr.exe and a whole bunch of DLLs), and partly in the defintions of system objects in resourcedb. The latter part is mostly the code for system stored procedures and system views.

Does this address your question?



Thank-you, Hugo. It does address my question completely.

Once again, thank-you (as always!)


Thanks & Regards,
Nakul Vachhrajani.
http://beyondrelational.com/modules/2/blogs/77/nakuls-blog.aspx
Be courteous. Drive responsibly.

Follow me on
Twitter: @sqltwins
Google Plus: +Nakul
Post #1308778
Posted Thursday, May 31, 2012 2:32 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 3:03 AM
Points: 3,913, Visits: 5,090
Good question, thanks, Ron.

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1308799
Posted Thursday, May 31, 2012 2:42 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 3:41 AM
Points: 1,101, Visits: 1,360
Nice question.. Thanks for submitting...

Thanks
Post #1308805
Posted Thursday, May 31, 2012 4:01 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, August 21, 2014 3:52 PM
Points: 5,988, Visits: 12,923
I think we should clarify that you should not remove a service pack simply by replacing the resource database with a previous version of it. I'm sure there is more to it than that and service packs should be backed out using add\remove programs.

I'm not saying the question suggested that but it seems possible people might infer it.


---------------------------------------------------------------------

Post #1308840
Posted Thursday, May 31, 2012 4:14 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 4:11 PM
Points: 5,969, Visits: 8,228
george sibbald (5/31/2012)
I think we should clarify that you should not remove a service pack simply by replacing the resource database with a previous version of it. I'm sure there is more to it than that and service packs should be backed out using add\remove programs.

I'm not saying the question suggested that but it seems possible people might infer it.

A very good addition!
A service pack involves changes to the actual executables (sqlservr.exe, DDLs, etc) and corresponding changed to system objects. The install/uninstall program of a service pack will stop the SQL Server service, replace the executables, replace the resource database, and then restart the service. In older (pre-SQL 2005) versions of SQL Server, the installer/uninstaller of a service pack would also replace executables, but replacing the system objects would be done in a much more elaborate way (by running scripts that alter all the affected procedures, views, etc). Simply replacing a database was not possible, since the definitions of system objects then lived in the master database, which also holds the metadata of user databases, plus all logins and other server-level objects.



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1308851
Posted Thursday, May 31, 2012 4:19 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, August 18, 2014 6:23 AM
Points: 1,413, Visits: 1,821
Hugo Kornelis (5/31/2012)
george sibbald (5/31/2012)
I think we should clarify that you should not remove a service pack simply by replacing the resource database with a previous version of it. I'm sure there is more to it than that and service packs should be backed out using add\remove programs.

I'm not saying the question suggested that but it seems possible people might infer it.

A very good addition!
A service pack involves changes to the actual executables (sqlservr.exe, DDLs, etc) and corresponding changed to system objects. The install/uninstall program of a service pack will stop the SQL Server service, replace the executables, replace the resource database, and then restart the service. In older (pre-SQL 2005) versions of SQL Server, the installer/uninstaller of a service pack would also replace executables, but replacing the system objects would be done in a much more elaborate way (by running scripts that alter all the affected procedures, views, etc). Simply replacing a database was not possible, since the definitions of system objects then lived in the master database, which also holds the metadata of user databases, plus all logins and other server-level objects.


In fact, that's what threw me off a bit. Then Hugo kindly reminded me of the fact that a SP = code + system object change, which resolved the confusion.


Thanks & Regards,
Nakul Vachhrajani.
http://beyondrelational.com/modules/2/blogs/77/nakuls-blog.aspx
Be courteous. Drive responsibly.

Follow me on
Twitter: @sqltwins
Google Plus: +Nakul
Post #1308855
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse