{"id":79,"date":"2010-10-15T19:19:34","date_gmt":"2010-10-16T01:19:34","guid":{"rendered":"http:\/\/www.mcneelytech.com\/blog1\/?p=79"},"modified":"2024-06-18T12:58:08","modified_gmt":"2024-06-18T17:58:08","slug":"11g-database-upgrade-how-it-went-example-upgrade-2","status":"publish","type":"post","link":"http:\/\/www.mcneelytech.com\/blog1\/?p=79","title":{"rendered":"11g database upgrade \u2013 how it went \u2013 example upgrade #2"},"content":{"rendered":"<p>The second Oracle upgrade I\u2019ll tell you about was another export\/import upgrade between 10.2 and 11.1.0.7.<\/p>\n<p>The installation, empty 11g database build, and 10g export\/11g import went fine on the test tier.&nbsp; The application testing of the upgraded 11g test database performed by the client also went fine \u2013 the client was satisfied with the performance.&nbsp; The run times of the key jobs that were tested bore a strong resemblance to those of the current 10g test database.&nbsp; Too strong, it turned out.<\/p>\n<p>The installation, empty 11g database build, and 10g export\/11g import on the production tier also went fine.&nbsp; The client ran a few quick reports to be sure they could connect to the new database, and all seemed well.<\/p>\n<p>Then things went wrong.&nbsp; A job that had taken one or two minutes on 10g was still running nine hours later on the upgraded database.&nbsp; A couple of other jobs were also running much longer than before.&nbsp; Other jobs were running faster than on 10g.&nbsp; How could the results on the production tier be so different from the test tier?&nbsp; We\u2019d even imported production data onto the test tier, to increase our possibility of creating a more similar environment.&nbsp; Importing data isn\u2019t perfect \u2013 a physical clone is better, but at least we had the same number of rows, same indexes, etc.<\/p>\n<p>At that point, the person who did the application testing then realized that, when he did the 11g testing, he had accidentally been pointed at the test 10g database.&nbsp; <em>We were now running production on an untested version.<\/em> The client made the decision to wait and see if we could fix the problems and remain on 11g instead of retreating, although retreating would have been fairly painless, since we didn\u2019t harm the 10g database in the upgrade process, and the data in the database only changed weekly.&nbsp; (This easy retreat is one of the better features of an export\/import upgrade.)<\/p>\n<p>We tried standing on the nine-hour query\u2019s throat by trying to force it to use the same execution plan as the 10g database, by hinting it, and then trying a stored plan.&nbsp; Both yielded new, but still long-running, execution plans.&nbsp; This was a complex query, which made things harder for us, since we were on a tight timeline.&nbsp; We tried setting optimizer_features_enabled to 10.2.0.2 (the source version), 10.2.0.3, and 10.2.0.4 (just in case those ran better) at the database level.&nbsp; All three settings were great for the nine-hour query but disastrous for some other queries.&nbsp; We tried restoring segment statistics from the 10g database, to see if that would help.&nbsp; It did help some queries, but harmed others.<\/p>\n<p>Time was short, so the solution we settled on was to hint the nine-hour query and a couple of other queries to use optimizer_features_enabled=10.2.0.4 (this is an instruction to the query act like it\u2019s running on a 10.2.0.4 database); to leave the default 11g optimizer_features_enabled set at the database-wide level (this is an instruction to all queries on the database to act like they\u2019re running on an 11.1.0.7 database unless otherwise instructed); and to leave the 11g-level segment statistics in place.&nbsp; This returned the queries to the 10g level of performance or better.<\/p>\n<p>The client was satisfied with this, as their goal wasn\u2019t to improve performance; it was to get onto a version of Oracle that will be supported longer than 10gR2.&nbsp; (It would have been interesting to dig further into this issue, but the client was ready to move on to the next project on the list.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The second Oracle upgrade I\u2019ll tell you about was another export\/import upgrade between 10.2 and 11.1.0.7.<\/p>\n<p>The installation, empty 11g database build, and 10g export\/11g import went fine on the test tier.&nbsp; The application testing of the upgraded 11g test database performed by the client also went fine \u2013 the client was satisfied with the [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"http:\/\/www.mcneelytech.com\/blog1\/index.php?rest_route=\/wp\/v2\/posts\/79"}],"collection":[{"href":"http:\/\/www.mcneelytech.com\/blog1\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.mcneelytech.com\/blog1\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.mcneelytech.com\/blog1\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.mcneelytech.com\/blog1\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=79"}],"version-history":[{"count":2,"href":"http:\/\/www.mcneelytech.com\/blog1\/index.php?rest_route=\/wp\/v2\/posts\/79\/revisions"}],"predecessor-version":[{"id":267,"href":"http:\/\/www.mcneelytech.com\/blog1\/index.php?rest_route=\/wp\/v2\/posts\/79\/revisions\/267"}],"wp:attachment":[{"href":"http:\/\/www.mcneelytech.com\/blog1\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=79"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.mcneelytech.com\/blog1\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=79"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.mcneelytech.com\/blog1\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=79"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}