简体   繁体   English

从 Oracle 11 迁移到 19c

[英]Migrating from Oracle 11 to 19c

We are migrating from Oracle 11.2 to 19c.我们正在从 Oracle 11.2 迁移到 19c。 When DB objects were moved, few packages were invalid.当数据库对象被移动时,很少有包是无效的。 All those packages involves updating a table (say tableA) which has clob data.所有这些包都涉及更新具有 clob 数据的表(比如 tableA)。 And tableA is locked using "select..for update some_column nowait"并且 tableA 使用“select..for update some_column nowait”锁定

cursor c1 is  select * 
  from table A,
      XMLTable(....)
   where A.id=1
   FOR UPDATE of A.ind NOWAIT

The error states "ORA-01786 for update of this query expression is not allowed"错误状态“不允许更新此查询表达式的 ORA-01786”

I read oracle forums and talked to the DBA.我阅读了 oracle 论坛并与 DBA 进行了交谈。 Solution suggested is to write a select for update which does not involve JSON data" (Documentation id 2507724.1, Patch 28822515)建议的解决方案是编写一个 select 进行更新,该更新不涉及 JSON 数据”(文档 ID 2507724.1,补丁 28822515)

It nearly impossible to rewrite the package.几乎不可能重写 package。 Can someone help me understand how to know if this patch has know bugs or if there is any other patch to overcome this?有人可以帮助我了解如何知道这个补丁是否有已知的错误,或者是否有任何其他补丁可以克服这个问题?

It isn't entirely clear that the error you are seeing is from the same change that affected JSON data, but it seems likely that it could apply to XML data too.目前尚不清楚您看到的错误是否来自影响 JSON 数据的相同更改,但它似乎也可能适用于 XML 数据。

If so it wouldn't be a bug, as the change the MoS document you referred to says was introduced in patch 28822515 was apparently fixing a bug for it not throwing ORA-01786 in this sort of scenario.如果是这样,那将不是一个错误,因为您提到的 MoS 文档所说的更改是在补丁 28822515 中引入的,显然是在修复一个错误,因为它不会在这种情况下抛出 ORA-01786。 (That patch is the January 2019 CPU for versions before 19c; again the document says that was back-porting a change in 19c to earlier versions.) (该补丁是 19c 之前版本的 2019 年 1 月 CPU;该文件再次表示,这是将 19c 中的更改向后移植到早期版本。)

A more complete example like:一个更完整的例子,如:

declare
  cursor c1 is
    select * 
    from A,
        XMLTable('/x/y/z' passing A.xml columns z number path '.')
     where A.id=1
     FOR UPDATE of A.ind NOWAIT;
begin
  for r1 in c1 loop
    dbms_output.put_line(r1.id || ': ' || r1.z);
  end loop;
end;
/

works as expected in 11gR2 (11.2.0.2) and in relatively unpatched 18c (18.4) , but errors in 21c (21.3) - which is essentially an evolved version of 19c. 在 11gR2 (11.2.0.2)相对未打补丁的 18c (18.4) 中按预期工作,但在 21c (21.3) 中出现错误 - 这本质上是 19c 的演进版本。

Avoid the error seems to be fairly straightforward - you need to separate the cursor that locks the table for update from the XMLTable call, which with this example at least you can easily do with nested cursors:避免错误似乎相当简单 - 您需要将锁定表以进行更新的 cursor 与 XMLTable 调用分开,至少在此示例中您可以轻松地使用嵌套游标:

declare
  cursor c1 is
    select * 
    from A
     where A.id=1
     FOR UPDATE of A.ind NOWAIT;
  cursor c2(xml xmltype) is
    select *
    from XMLTable('/x/y/z' passing c2.xml columns z number path '.');
begin
  for r1 in c1 loop
    for r2 in c2(r1.xml) loop
      dbms_output.put_line(r1.id || ': ' || r2.z);
    end loop;
  end loop;
end;
/

which is shown working in the three db<>fiddles linked to above.这显示在上面链接的三个 db<>fiddles 中工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 Oracle Database 11g 迁移到 AWS RDS Oracle 19c 失败 - Migration from Oracle Database 11g to AWS RDS Oracle 19c Failures 从 oracle 11g 迁移到 19c 后出现错误 - error after migration from oracle 11g to 19c Oracle 数据库从 11g 升级到 19c 后如何在 Django 中连接 - How to connect in Django after Oracle Database upgrade from 11g to 19c 如何使用 Datapump 将模式从 oracle 11g(linux) 导出到 windows(19c) - How to export schemas from oracle 11g(linux) to windows(19c) using Datapump 我们如何将 Forms 应用程序从 Oracle11g r2 数据库升级到 Oracle 19c 数据库? - How can we upgrade Forms application from Oracle11g r2 database to Oracle 19c database? 从 sqlplus 连接到 Oracle 19C 云 - Connect to Oracle 19C Cloud from sqlplus Select json 值来自 Oracle 19c 表中的数组 - Select json values from array in Oracle 19c table Oracle DB - 从 19c 客户端连接 11gR2 DB - ORA-12650:没有通用加密或数据完整性算法 - Oracle DB - Connecting 11gR2 DB from 19c Client - ORA-12650 : No Common Encryption or data integrity algorithm 为什么将 Oracle DB 从 11g 升级到 19c 后 OracleConnection.Open() 的实例会抛出错误? - Why the Instance of OracleConnection.Open() throws an error after upgrading the Oracle DB from 11g to 19c? 在 Windows 7 上安装 Oracle 19c 服务器 - Installing Oracle 19c server on Windows 7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM