{"id":1847,"date":"2015-08-13T11:40:03","date_gmt":"2015-08-13T14:40:03","guid":{"rendered":"http:\/\/www.dbarj.com.br\/?p=1847"},"modified":"2015-08-14T10:57:28","modified_gmt":"2015-08-14T13:57:28","slug":"opatch-auto-failing-cant-locate-switch-pm-in-inc","status":"publish","type":"post","link":"https:\/\/www.dbarj.com.br\/en\/2015\/08\/opatch-auto-failing-cant-locate-switch-pm-in-inc\/","title":{"rendered":"opatch auto failing &#8220;Can&#8217;t locate Switch.pm in @INC&#8221;"},"content":{"rendered":"<p>Those days, when trying to run &#8220;opatch auto&#8221; on a Enterprise Linux 7 server to automatically patch my\u00a0GI Home and all the Database Homes, I faced the following error:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@localhost 20834621]# opatch auto .\/20485808 -ocmrf \/tmp\/ocm.rsp\r\nCan't locate Switch.pm in @INC (@INC contains: \/usr\/local\/lib64\/perl5 \/usr\/local\/share\/perl5 \/usr\/lib64\/perl5\/vendor_perl \/usr\/share\/perl5\/vendor_perl \/usr\/lib64\/perl5 \/usr\/share\/perl5 .) at \/u01\/app\/11.2.4\/grid\/OPatch\/crs\/auto_patch.pl line 2730.\r\nBEGIN failed--compilation aborted at \/u01\/app\/11.2.4\/grid\/OPatch\/crs\/auto_patch.pl line 2730.<\/pre>\n<p>The problem was that Switch.pm lib was missing. Checking at MOS, I found the\u00a0Doc ID 1915430.1 (Opatch Auto fails with: Can&#8217;t locate Switch.pm) saying that i<span id=\"kmPgTpl:sd_r1:0:dv_rDoc:ot71\" class=\"kmContent\">n Perl 5.10 and above, <em>the Switch module has been is deprecated <\/em><\/span>and giving a workaround to\u00a0<span id=\"kmPgTpl:sd_r1:0:dv_rDoc:ot71\" class=\"kmContent\">download and install Switch.pm from <a href=\"http:\/\/www.cpan.org.\">www.cpan.org<\/a>\u00a0and then retry &#8220;opatch auto&#8221;.<\/span><\/p>\n<p>However, I did a much simpler thing that worked.<\/p>\n<p>First, I looked for this file in my sever:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@localhost ~]# find \/ -name Switch.pm\r\n\/u01\/app\/oracle\/product\/11.2.4\/dbhome_1\/perl\/lib\/5.10.0\/CGI\/Switch.pm\r\n\/u01\/app\/oracle\/product\/11.2.4\/dbhome_1\/perl\/lib\/5.10.0\/Switch.pm\r\n\/u01\/app\/11.2.4\/grid\/perl\/lib\/5.10.0\/CGI\/Switch.pm\r\n\/u01\/app\/11.2.4\/grid\/perl\/lib\/5.10.0\/Switch.pm<\/pre>\n<p>Finally, I copied one of them to my perl lib dir:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">[root@localhost ~]# cp -p $ORACLE_HOME\/perl\/lib\/5.10.0\/Switch.pm \/usr\/lib64\/perl5\/vendor_perl\/<\/pre>\n<p>When re executing &#8220;opatch auto&#8221;, everything worked like a charm.<\/p>\n<b>Have you enjoyed? Please leave a comment or give a \ud83d\udc4d!<\/b>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style2 like-1847 jlk' href='javascript:void(0)' data-task='like' data-post_id='1847' data-nonce='de4404f630' rel='nofollow'><img class='wti-pixel' src='https:\/\/www.dbarj.com.br\/wp-content\/plugins\/wti-like-post\/images\/pixel.gif' title='Like' \/><span class='lc-1847 lc'>+8<\/span><\/a><\/div><\/div> <div class='status-1847 status align-left'><\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Those days, when trying to run &#8220;opatch auto&#8221; on a Enterprise Linux 7 server to automatically patch my\u00a0GI Home and all the Database Homes, I faced the following error: [root@localhost 20834621]# opatch auto .\/20485808 -ocmrf \/tmp\/ocm.rsp Can&#8217;t locate Switch.pm in @INC (@INC contains: \/usr\/local\/lib64\/perl5 \/usr\/local\/share\/perl5 \/usr\/lib64\/perl5\/vendor_perl \/usr\/share\/perl5\/vendor_perl \/usr\/lib64\/perl5 \/usr\/share\/perl5 .) at \/u01\/app\/11.2.4\/grid\/OPatch\/crs\/auto_patch.pl line 2730. BEGIN &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/www.dbarj.com.br\/en\/2015\/08\/opatch-auto-failing-cant-locate-switch-pm-in-inc\/\">Continue reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-1847","post","type-post","status-publish","format-standard","hentry","category-database-en","item-wrap"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>opatch auto failing &quot;Can&#039;t locate Switch.pm in @INC&quot; - DBA - Rodrigo Jorge - Oracle Tips and Guides<\/title>\n<meta name=\"description\" content=\"How to resolve the problem of &quot;opatch auto&quot; failing with &quot;Can&#039;t locate Switch.pm in @INC&quot;.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbarj.com.br\/en\/2015\/08\/opatch-auto-failing-cant-locate-switch-pm-in-inc\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DBA RJ\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/2015\\\/08\\\/opatch-auto-failing-cant-locate-switch-pm-in-inc\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/2015\\\/08\\\/opatch-auto-failing-cant-locate-switch-pm-in-inc\\\/\"},\"author\":{\"name\":\"DBA RJ\",\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/#\\\/schema\\\/person\\\/28a44ca3a6633fe4156ad1ea209d40a9\"},\"headline\":\"opatch auto failing &#8220;Can&#8217;t locate Switch.pm in @INC&#8221;\",\"datePublished\":\"2015-08-13T14:40:03+00:00\",\"dateModified\":\"2015-08-14T13:57:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/2015\\\/08\\\/opatch-auto-failing-cant-locate-switch-pm-in-inc\\\/\"},\"wordCount\":140,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/#\\\/schema\\\/person\\\/28a44ca3a6633fe4156ad1ea209d40a9\"},\"articleSection\":[\"Oracle Database General\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/2015\\\/08\\\/opatch-auto-failing-cant-locate-switch-pm-in-inc\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/2015\\\/08\\\/opatch-auto-failing-cant-locate-switch-pm-in-inc\\\/\",\"url\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/2015\\\/08\\\/opatch-auto-failing-cant-locate-switch-pm-in-inc\\\/\",\"name\":\"opatch auto failing \\\"Can't locate Switch.pm in @INC\\\" - DBA - Rodrigo Jorge - Oracle Tips and Guides\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/#website\"},\"datePublished\":\"2015-08-13T14:40:03+00:00\",\"dateModified\":\"2015-08-14T13:57:28+00:00\",\"description\":\"How to resolve the problem of \\\"opatch auto\\\" failing with \\\"Can't locate Switch.pm in @INC\\\".\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/2015\\\/08\\\/opatch-auto-failing-cant-locate-switch-pm-in-inc\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/2015\\\/08\\\/opatch-auto-failing-cant-locate-switch-pm-in-inc\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/2015\\\/08\\\/opatch-auto-failing-cant-locate-switch-pm-in-inc\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"opatch auto failing \\\"Can't locate Switch.pm in @INC\\\"\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/\",\"name\":\"DBA - Rodrigo Jorge - Oracle Tips and Guides\",\"description\":\"Blog about Databases, Security and High Availability\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/#\\\/schema\\\/person\\\/28a44ca3a6633fe4156ad1ea209d40a9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/en\\\/#\\\/schema\\\/person\\\/28a44ca3a6633fe4156ad1ea209d40a9\",\"name\":\"DBA RJ\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/RodrigoJorgePOUG19.png\",\"url\":\"https:\\\/\\\/www.dbarj.com.br\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/RodrigoJorgePOUG19.png\",\"contentUrl\":\"https:\\\/\\\/www.dbarj.com.br\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/RodrigoJorgePOUG19.png\",\"width\":712,\"height\":712,\"caption\":\"DBA RJ\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.dbarj.com.br\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/RodrigoJorgePOUG19.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"opatch auto failing \"Can't locate Switch.pm in @INC\" - DBA - Rodrigo Jorge - Oracle Tips and Guides","description":"How to resolve the problem of \"opatch auto\" failing with \"Can't locate Switch.pm in @INC\".","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbarj.com.br\/en\/2015\/08\/opatch-auto-failing-cant-locate-switch-pm-in-inc\/","twitter_misc":{"Written by":"DBA RJ","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbarj.com.br\/en\/2015\/08\/opatch-auto-failing-cant-locate-switch-pm-in-inc\/#article","isPartOf":{"@id":"https:\/\/www.dbarj.com.br\/en\/2015\/08\/opatch-auto-failing-cant-locate-switch-pm-in-inc\/"},"author":{"name":"DBA RJ","@id":"https:\/\/www.dbarj.com.br\/en\/#\/schema\/person\/28a44ca3a6633fe4156ad1ea209d40a9"},"headline":"opatch auto failing &#8220;Can&#8217;t locate Switch.pm in @INC&#8221;","datePublished":"2015-08-13T14:40:03+00:00","dateModified":"2015-08-14T13:57:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbarj.com.br\/en\/2015\/08\/opatch-auto-failing-cant-locate-switch-pm-in-inc\/"},"wordCount":140,"commentCount":6,"publisher":{"@id":"https:\/\/www.dbarj.com.br\/en\/#\/schema\/person\/28a44ca3a6633fe4156ad1ea209d40a9"},"articleSection":["Oracle Database General"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbarj.com.br\/en\/2015\/08\/opatch-auto-failing-cant-locate-switch-pm-in-inc\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbarj.com.br\/en\/2015\/08\/opatch-auto-failing-cant-locate-switch-pm-in-inc\/","url":"https:\/\/www.dbarj.com.br\/en\/2015\/08\/opatch-auto-failing-cant-locate-switch-pm-in-inc\/","name":"opatch auto failing \"Can't locate Switch.pm in @INC\" - DBA - Rodrigo Jorge - Oracle Tips and Guides","isPartOf":{"@id":"https:\/\/www.dbarj.com.br\/en\/#website"},"datePublished":"2015-08-13T14:40:03+00:00","dateModified":"2015-08-14T13:57:28+00:00","description":"How to resolve the problem of \"opatch auto\" failing with \"Can't locate Switch.pm in @INC\".","breadcrumb":{"@id":"https:\/\/www.dbarj.com.br\/en\/2015\/08\/opatch-auto-failing-cant-locate-switch-pm-in-inc\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbarj.com.br\/en\/2015\/08\/opatch-auto-failing-cant-locate-switch-pm-in-inc\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbarj.com.br\/en\/2015\/08\/opatch-auto-failing-cant-locate-switch-pm-in-inc\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dbarj.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"opatch auto failing \"Can't locate Switch.pm in @INC\""}]},{"@type":"WebSite","@id":"https:\/\/www.dbarj.com.br\/en\/#website","url":"https:\/\/www.dbarj.com.br\/en\/","name":"DBA - Rodrigo Jorge - Oracle Tips and Guides","description":"Blog about Databases, Security and High Availability","publisher":{"@id":"https:\/\/www.dbarj.com.br\/en\/#\/schema\/person\/28a44ca3a6633fe4156ad1ea209d40a9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbarj.com.br\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.dbarj.com.br\/en\/#\/schema\/person\/28a44ca3a6633fe4156ad1ea209d40a9","name":"DBA RJ","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbarj.com.br\/wp-content\/uploads\/2019\/09\/RodrigoJorgePOUG19.png","url":"https:\/\/www.dbarj.com.br\/wp-content\/uploads\/2019\/09\/RodrigoJorgePOUG19.png","contentUrl":"https:\/\/www.dbarj.com.br\/wp-content\/uploads\/2019\/09\/RodrigoJorgePOUG19.png","width":712,"height":712,"caption":"DBA RJ"},"logo":{"@id":"https:\/\/www.dbarj.com.br\/wp-content\/uploads\/2019\/09\/RodrigoJorgePOUG19.png"}}]}},"_links":{"self":[{"href":"https:\/\/www.dbarj.com.br\/en\/wp-json\/wp\/v2\/posts\/1847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbarj.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbarj.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbarj.com.br\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbarj.com.br\/en\/wp-json\/wp\/v2\/comments?post=1847"}],"version-history":[{"count":0,"href":"https:\/\/www.dbarj.com.br\/en\/wp-json\/wp\/v2\/posts\/1847\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbarj.com.br\/en\/wp-json\/wp\/v2\/media?parent=1847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbarj.com.br\/en\/wp-json\/wp\/v2\/categories?post=1847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbarj.com.br\/en\/wp-json\/wp\/v2\/tags?post=1847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}