Db2

Db2

Where DBAs and data experts come together to stop operating and start innovating. Connect, share, and shape the AI era with us.


#Data

 View Only
  • 1.  Read CLOBs from degradated node with Db2 LUW 11.5.8 db in ReadOnly mode

    Posted Thu February 05, 2026 10:28 AM

    Hello,

    After a HADR failure, we are attempting to recover the data at one customer. Unfortunately, only the standby database is accessible (thanks to DB2_HADR_ROS). We found a limitation in reading CLOBs and BLOBs from standby DBs.

    SQL1773N, Reason Code 3, which states:

    An attempt was made to execute a query against a read-enabled HADR standby database and there is one of the following problems with the query:

    • The query attempted to use a data types which cannot be used in queries against a read-enabled HADR standby database.
    • The query attempted to use a LOB or XML value that is not stored as inline data in the database table.

    The user action is:

    Change the query so that it does not use any data types that cannot be read on an HADR standby database, and does not query for XML and LOB values that are not inline.

    Have you ever been in this situation? Is it possible to solve it somehow and export data from this column, or are these data lost?

    Thank you

    Regards



    ------------------------------
    Ondřej
    ------------------------------


  • 2.  RE: Read CLOBs from degradated node with Db2 LUW 11.5.8 db in ReadOnly mode

    Posted Thu February 05, 2026 10:55 AM

    Since you are saying that only standby database is accessible - it depends on how the LOBS were defined: with HADR when LOBs are either INLINEd LOBs or LOGGED LOBs the data is carried over to the standby.
    If your LOBs were INLINEd or LOGGED - then you can access data on what used to be standby database by stopping HADR, stopping Db2 and starting Db2 - thus becoming stand-alone database.



    ------------------------------
    Jan Nelken
    Db2 (LUW) DBA
    Open for work
    Katowice or Krakow
    +48 783 109 863
    ------------------------------



  • 3.  RE: Read CLOBs from degradated node with Db2 LUW 11.5.8 db in ReadOnly mode

    Posted Thu February 05, 2026 12:52 PM
    Promote Standby to Primary (Takeover):
    • If the original primary is lost, you can perform an HADR takeover to make the standby the new primary.
    • Once promoted, all LOBs/BLOBs/XML are fully accessible.
    • This is the standard recovery path after a primary failure.





  • 4.  RE: Read CLOBs from degradated node with Db2 LUW 11.5.8 db in ReadOnly mode

    Posted Thu February 05, 2026 04:06 PM

    Can you perform takeover on standby when primary is lost and is not accessible?



    ------------------------------
    Jan Nelken
    Db2 (LUW) DBA
    Open for work
    Katowice or Krakow
    +48 783 109 863
    ------------------------------



  • 5.  RE: Read CLOBs from degradated node with Db2 LUW 11.5.8 db in ReadOnly mode

    Posted Thu February 05, 2026 01:02 PM
    The original primary to be Restored from the last backup  and roll forward logs.This ensures you can access all data types, including LOBs.





  • 6.  RE: Read CLOBs from degradated node with Db2 LUW 11.5.8 db in ReadOnly mode

    Posted Thu February 05, 2026 03:26 PM
    Edited by Mark Barinstein Thu February 05, 2026 03:30 PM

    Hello Ondřej,

    It's a known reads on standby restriction.

    XML and large object (LOB) data must be inline to be successfully queried.

    Reads on standby restrictions


    So, you need to takeover this database to accesses these column values.


    ------------------------------
    Mark Barinstein
    ------------------------------



  • 7.  RE: Read CLOBs from degradated node with Db2 LUW 11.5.8 db in ReadOnly mode

    Posted Fri February 06, 2026 02:47 AM

    Thank you all for your answers.



    ------------------------------
    Ondřej
    ------------------------------