{"id":286,"date":"2020-01-24T12:39:28","date_gmt":"2020-01-24T11:39:28","guid":{"rendered":"http:\/\/anjo.pt\/wp\/keyword-oracle\/?p=286"},"modified":"2020-01-24T12:41:25","modified_gmt":"2020-01-24T11:41:25","slug":"tales-of-oracle-19c-upgrade-ora-24964-alter-session-set-container-error","status":"publish","type":"post","link":"https:\/\/anjo.pt\/keyword-oracle\/2020\/01\/24\/tales-of-oracle-19c-upgrade-ora-24964-alter-session-set-container-error\/","title":{"rendered":"Tales of Oracle 19c upgrade &#8211; ORA-24964: ALTER SESSION SET CONTAINER error"},"content":{"rendered":"\n<p>At my client we have a nice automation tool that can run scripts on several DBs based on their group on Enterprise Manager. <\/p>\n\n\n\n<p>Last week I&#8217;ve migrated+upgraded OEM repository from 12.2 to 19c, using Refreshable PDB to copy the PDB from a 12.2 CDB to a 19c CDB + running dbupgrade script on the PDB (<strong>p_oem_t<\/strong> below). Everything worked nice.<\/p>\n\n\n\n<p>My colleague yesterday tells me the automation tool is not working, giving &#8220;ORA-0942 Table or view does exist error&#8221; for a query on the OEM repository. This means to me, it can connect to the new repository, as the old one is shutdown. But where can the problem be?<\/p>\n\n\n\n<p>I look at the code, find the query, run it on SQL Developer and all if fine, no errors.<\/p>\n\n\n\n<p>This until I activate the debug modus of the automation tool and I see that it connects to the CDB as SYSDBA and then changes container to the right PDB. Just above the ORA-0942 error, there was a <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ORA-24964: ALTER SESSION SET CONTAINER error<\/pre>\n\n\n\n<p>Looking around I could find this Metalink note:<\/p>\n\n\n\n<p><a href=\"https:\/\/support.oracle.com\/epmos\/faces\/DocContentDisplay?id=2494623.1\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"ORA-24964 - Alter Session To      12.2 PDB From 12.1 Client (Doc ID 2494623.1) (opens in a new tab)\">ORA-24964 &#8211; Alter Session To      12.2 PDB From 12.1 Client (Doc ID 2494623.1)<\/a><\/p>\n\n\n\n<p>The keyword on the &#8220;Symptoms&#8221; is &#8220;Upgraded DB&#8221;. The code description states:<\/p>\n\n\n\n<p><strong>Cause:<\/strong>&nbsp;An attempt to switch to a PDB with different settings such as character set, time zone or time zone file version on an Oracle 12c Release 1 (12.1) or earlier client failed. (see <a rel=\"noreferrer noopener\" aria-label=\"Docs (opens in a new tab)\" href=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/oracle-database\/19\/errmg\/ORA-24280.html#GUID-7B2814DB-F946-4EB1-80B5-219B256E90C0\" target=\"_blank\">Docs<\/a>)<\/p>\n\n\n\n<p>In fact, our automation tool uses an old 11.2 client. To test it, I&#8217;ve created on the same 19c CDB also new fresh PDB (PDB01) and tried to connect remotely:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">oracle@l-master $ sqlplus sys@\\\"l-oem19c_t\/c_oem_t\\\" as sysdba\n\n SQL*Plus: Release 11.2.0.4.0 Production on Thu Jan 23 17:06:27 2020\n Enter password:\n &nbsp;\n Connected to:\n Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production\n &nbsp;\n SQL&gt; select pdb_name from dba_pdbs;\n PDB_NAME\n ------------------------------\n PDB$SEED\n P_OEM_T \n PDB01\n &nbsp;\n SQL&gt; alter session set container=PDB01;\n Session altered.\n &nbsp;\n SQL&gt;&nbsp; alter session set container=CDB$ROOT;\n Session altered.\n &nbsp;\n SQL&gt; alter session set container=P_OEM_T;\n ERROR:\n ORA-24964: ALTER SESSION SET CONTAINER error <\/pre>\n\n\n\n<p>When I tried the same but using a 19c client, it works without problem:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">oracle@l-master-19c $ sqlplus sys@\\\"l-oem19c_t\/c_oem_t\\\" as sysdba\n &nbsp;\n SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jan 23 17:08:55 2020\n Version 19.3.0.0.0\n &nbsp;\n Copyright (c) 1982, 2019, Oracle.&nbsp; All rights reserved.\n &nbsp;Enter password:\n &nbsp;\n Connected to:\n Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production\n Version 19.4.0.0.0\n &nbsp;\n SQL&gt; select pdb_name from dba_pdbs;\n &nbsp;\n PDB_NAME\n ---------------------------------\n PDB$SEED\n P_OEM_T\n PDB01\n &nbsp;\n SQL&gt; alter session set container=PDB01;\n Session altered.\n &nbsp;\n SQL&gt;&nbsp; alter session set container=CDB$ROOT;\n Session altered.\n &nbsp;\n SQL&gt; alter session set container=P_OEM_T;\n Session altered.<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>At my client we have a nice automation tool that can run scripts on several DBs based on their group on Enterprise Manager. Last week I&#8217;ve migrated+upgraded OEM repository from 12.2 to 19c, using Refreshable PDB to copy the PDB from a 12.2 CDB to a 19c CDB + running dbupgrade script on the PDB [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39],"tags":[],"class_list":{"0":"post-286","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-oracle-19c","7":"czr-hentry"},"_links":{"self":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/comments?post=286"}],"version-history":[{"count":3,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/286\/revisions"}],"predecessor-version":[{"id":289,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/286\/revisions\/289"}],"wp:attachment":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/media?parent=286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/categories?post=286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/tags?post=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}