@@ -330,124 +330,7 @@ you should also revoke `LOCK` on all tables:
330330REVOKE LOCK ANY TABLE FROM c# #dbzuser container=all;
331331```
332332
333- ### 6. Support for Oracle XMLTYPE columns (optional)
334-
335- If your Oracle database contains tables with columns of type
336- [ ` XMLTYPE ` ] ( https://docs.oracle.com/en/database/oracle/oracle-database/21/arpls/XMLTYPE.html ) ,
337- you must configure additional libraries for Debezium Server to process these columns correctly.
338-
339- #### Create a custom Debezium Server image
340-
341- To support ` XMLTYPE ` columns, you must create a custom [ Docker] ( https://www.docker.com/ ) image
342- that includes the required Oracle XML libraries.
343-
344- 1 . Download the required libraries from Maven Central:
345-
346- ``` bash
347- mkdir xml
348- cd xml
349- wget https://repo.maven.apache.org/maven2/com/oracle/database/xml/xdb/19.27.0.0/xdb-19.27.0.0.jar
350- wget https://repo.maven.apache.org/maven2/com/oracle/database/xml/xmlparserv2/19.27.0.0/xmlparserv2-19.27.0.0.jar
351- mv xdb-19.27.0.0.jar xdb.jar
352- mv xmlparserv2-19.27.0.0.jar xmlparserv2.jar
353- ```
354-
355- 2 . Create a ` Dockerfile ` in the same directory:
356-
357- ``` dockerfile
358- FROM quay.io/debezium/server:3.0.8.Final
359-
360- USER root
361-
362- COPY xdb.jar /debezium/lib
363- COPY xmlparserv2.jar /debezium/lib
364- ```
365-
366- 3 . Build the custom image:
367-
368- ``` bash
369- cd ..
370- docker build -t dbz-xml xml
371- docker tag dbz-xml quay.io/debezium/server:3.0.8.Final
372- docker image save quay.io/debezium/server:3.0.8.Final -o dbz3.0.8-xml-linux-amd.tar
373- ```
374-
375- 4 . Add the image to your K3s image repository:
376-
377- ``` bash
378- sudo k3s ctr images import dbz3.0.8-xml-linux-amd.tar all
379- ```
380-
381- #### Configure RDI for XMLTYPE support
382-
383- In your RDI configuration file, set the ` lob.enabled ` property to ` true ` in the
384- ` advanced.source ` section:
385-
386- ``` yaml
387- sources :
388- oracle :
389- type : cdc
390- logging :
391- level : info
392- connection :
393- type : oracle
394- host : oracle
395- port : 1521
396- user : ${SOURCE_DB_USERNAME}
397- password : ${SOURCE_DB_PASSWORD}
398- database : ORCLCDB
399- advanced :
400- source :
401- database.pdb.name : ORCLPDB1
402- lob.enabled : true
403- ` ` `
404-
405- #### Test XMLTYPE support
406-
407- You can create a test table to verify that ` XMLTYPE` columns work correctly
408- (using the
409- [`CHINOOK`](https://github.com/Redislabs-Solution-Architects/rdi-quickstart-postgres/tree/main)
410- schema as an example) :
411-
412- ` ` ` sql
413- CREATE TABLE tab1 (
414- xmlid INT NOT NULL,
415- col1 SYS.XMLTYPE,
416- CONSTRAINT PK_tab1 PRIMARY KEY (xmlid)
417- );
418-
419- DECLARE
420- v_xml SYS.XMLTYPE;
421- v_doc CLOB;
422- BEGIN
423- -- XMLTYPE created from a CLOB
424- v_doc := '<?xml version="1.0"?>' || Chr(10) || ' <TABLE_NAME>MY_TABLE</TABLE_NAME>';
425- v_xml := SYS.XMLTYPE.createXML(v_doc);
426-
427- INSERT INTO tab1 (xmlid, col1) VALUES (1, v_xml);
428-
429- -- XMLTYPE created from a query
430- SELECT SYS_XMLGEN(table_name)
431- INTO v_xml
432- FROM user_tables
433- WHERE rownum = 1;
434-
435- INSERT INTO tab1 (xmlid, col1) VALUES (2, v_xml);
436-
437- COMMIT;
438- END;
439- /
440-
441- ALTER TABLE CHINOOK.TAB1 ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;
442- ` ` `
443-
444- After you run an initial
445- [snapshot]({{< relref "/integrate/redis-data-integration/data-pipelines/#pipeline-lifecycle" >}}),
446- the XML data appears in your Redis target database :
447-
448- {{< image filename="/images/rdi/ingest/xmltype-example.webp" >}}
449-
450- # ## 7. Configuration is complete
333+ ### 6. Configuration is complete
451334
452335Once you have followed the steps above, your Oracle database is ready
453336for Debezium to use.
@@ -665,59 +548,55 @@ END;
665548
666549### 4. Add a custom Docker image for the Debezium server
667550
668- Debezium requires
669- [Oracle Instant Client](https://www.oracle.com/database/technologies/instant-client.html)
670- to connect to the database with Xstream. Use the commands shown below to set this up for
671- the Debezium Server container image (`debezium/server:3.0.8.Final` for RDI GA v1.8.0 and
672- later).
551+ To support XStream connector, you must create a custom [ Docker] ( https://www.docker.com/ ) image that includes the required Instant Client package libraries for Linux x64 from the Oracle website.
673552
674- On the Docker machine, download the Instant Client package for Linux x64 from the Oracle website
553+ 1 . On the Docker machine, download the Instant Client package for Linux x64 from the Oracle website
675554
676- ` ` ` bash
677- wget https://download.oracle.com/otn_software/linux/instantclient/2380000/instantclient-basic-linux.x64-23.8.0.25.04.zip
678- ` ` `
555+ ``` bash
556+ wget https://download.oracle.com/otn_software/linux/instantclient/2380000/instantclient-basic-linux.x64-23.8.0.25.04.zip
557+ ```
679558
680- Then, unzip it to the `./dbz-ora` directory :
559+ 1. Unzip it to the ` ./dbz-ora` directory:
681560
682- ` ` ` bash
683- unzip instantclient-basic-linux.x64-23.8.0.25.04.zip -d ./dbz-ora
684- ` ` `
561+ ` ` ` bash
562+ unzip instantclient-basic-linux.x64-23.8.0.25.04.zip -d ./dbz-ora
563+ ` ` `
685564
686- Create a `Dockerfile` in the `./dbz-ora` directory with the following contents :
565+ 1. Create a ` Dockerfile` in the ` ./dbz-ora` directory with the following contents:
687566
688- ` ` ` docker
689- FROM debezium/server:3.0.8.Final
567+ ` ` ` docker
568+ FROM debezium/server:3.0.8.Final
690569
691- USER root
570+ USER root
692571
693- RUN microdnf -y install libaio \
694- && microdnf clean all \
695- && mkdir -p /opt/oracle/instant_client \
696- && rm -f /debezium/lib/ojdbc11*.jar
572+ RUN microdnf -y install libaio \
573+ && microdnf clean all \
574+ && mkdir -p /opt/oracle/instant_client \
575+ && rm -f /debezium/lib/ojdbc11* .jar
697576
698- COPY instantclient_23_8/* /opt/oracle/instant_client
577+ COPY instantclient_23_8/* /opt/oracle/instant_client
699578
700- USER jboss
579+ USER jboss
701580
702- COPY instantclient_23_8/xstreams.jar /debezium/lib
703- COPY instantclient_23_8/ojdbc11.jar /debezium/lib
581+ COPY instantclient_23_8/xstreams.jar /debezium/lib
582+ COPY instantclient_23_8/ojdbc11.jar /debezium/lib
704583
705- ENV LD_LIBRARY_PATH=/opt/oracle/instant_client
706- ` ` `
584+ ENV LD_LIBRARY_PATH=/opt/oracle/instant_client
585+ ` ` `
707586
708- Create the custom image :
587+ 1. Create the custom image:
709588
710- ` ` ` bash
711- docker build -t dbz-ora dbz-ora
712- ` ` `
589+ ` ` ` bash
590+ docker build -t dbz-ora dbz-ora
591+ ` ` `
713592
714- Then, add the image to the K3s image registry using the following commands :
593+ 1. Add the image to the K3s image registry using the following commands:
715594
716- ` ` ` bash
717- docker tag dbz-ora quay.io/debezium/server:3.0.8.Final
718- docker image save quay.io/debezium/server:3.0.8.Final -o dbz3.0.8-xstream-linux-amd.tar
719- sudo k3s ctr images import dbz3.0.8-xstream-linux-amd.tar all
720- ` ` `
595+ ` ` ` bash
596+ docker tag dbz-ora quay.io/debezium/server:3.0.8.Final
597+ docker image save quay.io/debezium/server:3.0.8.Final -o dbz3.0.8-xstream-linux-amd.tar
598+ sudo k3s ctr images import dbz3.0.8-xstream-linux-amd.tar all
599+ ` ` `
721600
722601# ## 5. Enable the Oracle configuration in RDI
723602
@@ -752,3 +631,120 @@ for a full list of properties you can use in the `advanced.source` subsection.
752631
753632After you have followed the steps above, your Oracle database is ready
754633for Debezium to use.
634+
635+ # # Support for Oracle XMLTYPE columns (optional)
636+
637+ If your Oracle database contains tables with columns of type
638+ [` XMLTYPE` ](https://docs.oracle.com/en/database/oracle/oracle-database/21/arpls/XMLTYPE.html),
639+ you must configure additional libraries for Debezium Server to process these columns correctly.
640+
641+ # ## Create a custom Debezium Server image
642+
643+ To support ` XMLTYPE` columns, you must create a custom [Docker](https://www.docker.com/) image
644+ that includes the required Oracle XML libraries.
645+
646+ 1. Download the required libraries from Maven Central:
647+
648+ ` ` ` bash
649+ mkdir xml
650+ cd xml
651+ wget https://repo.maven.apache.org/maven2/com/oracle/database/xml/xdb/19.27.0.0/xdb-19.27.0.0.jar
652+ wget https://repo.maven.apache.org/maven2/com/oracle/database/xml/xmlparserv2/19.27.0.0/xmlparserv2-19.27.0.0.jar
653+ mv xdb-19.27.0.0.jar xdb.jar
654+ mv xmlparserv2-19.27.0.0.jar xmlparserv2.jar
655+ ` ` `
656+
657+ 2. Create a ` Dockerfile` in the same directory:
658+
659+ ` ` ` dockerfile
660+ FROM quay.io/debezium/server:3.0.8.Final
661+
662+ USER root
663+
664+ COPY xdb.jar /debezium/lib
665+ COPY xmlparserv2.jar /debezium/lib
666+ ` ` `
667+
668+ 3. Build the custom image:
669+
670+ ` ` ` bash
671+ cd ..
672+ docker build -t dbz-xml xml
673+ docker tag dbz-xml quay.io/debezium/server:3.0.8.Final
674+ docker image save quay.io/debezium/server:3.0.8.Final -o dbz3.0.8-xml-linux-amd.tar
675+ ` ` `
676+
677+ 4. Add the image to your K3s image repository:
678+
679+ ` ` ` bash
680+ sudo k3s ctr images import dbz3.0.8-xml-linux-amd.tar all
681+ ` ` `
682+
683+ # ## Configure RDI for XMLTYPE support
684+
685+ In your RDI configuration file, set the ` lob.enabled` property to ` true` in the
686+ ` advanced.source` section:
687+
688+ ` ` ` yaml
689+ sources:
690+ oracle:
691+ type: cdc
692+ logging:
693+ level: info
694+ connection:
695+ type: oracle
696+ host: oracle
697+ port: 1521
698+ user: ${SOURCE_DB_USERNAME}
699+ password: ${SOURCE_DB_PASSWORD}
700+ database: ORCLCDB
701+ advanced:
702+ source:
703+ database.pdb.name: ORCLPDB1
704+ lob.enabled: true
705+ ` ` `
706+
707+ # ## Test XMLTYPE support
708+
709+ You can create a test table to verify that ` XMLTYPE` columns work correctly
710+ (using the
711+ [` CHINOOK` ](https://github.com/Redislabs-Solution-Architects/rdi-quickstart-postgres/tree/main)
712+ schema as an example):
713+
714+ ` ` ` sql
715+ CREATE TABLE tab1 (
716+ xmlid INT NOT NULL,
717+ col1 SYS.XMLTYPE,
718+ CONSTRAINT PK_tab1 PRIMARY KEY (xmlid)
719+ );
720+
721+ DECLARE
722+ v_xml SYS.XMLTYPE;
723+ v_doc CLOB;
724+ BEGIN
725+ -- XMLTYPE created from a CLOB
726+ v_doc := ' <?xml version="1.0"?>' || Chr(10) || ' <TABLE_NAME>MY_TABLE</TABLE_NAME>' ;
727+ v_xml := SYS.XMLTYPE.createXML(v_doc);
728+
729+ INSERT INTO tab1 (xmlid, col1) VALUES (1, v_xml);
730+
731+ -- XMLTYPE created from a query
732+ SELECT SYS_XMLGEN(table_name)
733+ INTO v_xml
734+ FROM user_tables
735+ WHERE rownum = 1;
736+
737+ INSERT INTO tab1 (xmlid, col1) VALUES (2, v_xml);
738+
739+ COMMIT;
740+ END;
741+ /
742+
743+ ALTER TABLE CHINOOK.TAB1 ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;
744+ ` ` `
745+
746+ After you run an initial
747+ [snapshot]({{< relref " /integrate/redis-data-integration/data-pipelines/#pipeline-lifecycle" > }}),
748+ the XML data appears in your Redis target database:
749+
750+ {{< image filename=" /images/rdi/ingest/xmltype-example.webp" > }}
0 commit comments