El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Configuring Oracle CDC (LogMiner)

Updated on 2022-12-05 GMT+08:00

Overview

Change Data Capture (CDC) enables ROMA Connect to synchronize data sources in real time and synchronously delete data tables.

ROMA Connect supports two CDC modes: XStream and LogMiner. This section describes how to enable the CDC function in LogMine mode for the Oracle database. In addition, the CDC configuration varies according to the Oracle database type (CDB or non-CDB).

Prerequisites

  • If the Oracle database is deployed in primary/secondary mode, the secondary Oracle database is not used.
  • Fields of the binary type, such as BINARY, VARBINARY, TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB, cannot be collected.
  • If a table contains fields of the SDO_GEOMETRY type, the Oracle database does not generate redo logs when data changes. Therefore, composite tasks cannot be used for data collection.

Configuration When the Oracle Database Is Not a CDB Database

It is recommended that the database administrator configure the CDC function.

  1. Enable log archiving.
    1. Run the following command to connect to the database as user sys:

      In practice, you can connect to the database in multiple modes. The following uses the command line mode as an example.

      sqlplus /nolog
      CONNECT sys/password@host:port AS SYSDBA;

      Among them:

      • password indicates the password of user sys of the database. You can obtain the password from the database administrator.
      • host indicates the IP address of the server where the database instance is located. Set this parameter based on site requirements.
      • port indicates the port used by the database instance. Set this parameter based on site requirements.
    2. Run the following command to check whether the log archiving function is enabled:
      archive log list;
      • If the message "Database log mode: No Archive Mode" is displayed, log archiving is disabled. Go to the next step.
      • If the message "Database log mode: No Archive Mode" is displayed, log archiving is enabled. Go to 1.f.
    3. Run the following command to set archive log parameters:
      alter system set db_recovery_file_dest_size = 100G;
      alter system set db_recovery_file_dest = '/opt/oracle/oradata/recovery_area' scope=spfile;

      Among them:

      • 100G indicates the size of the log file storage space. Set this parameter based on site requirements.
      • /opt/oracle/oradata/recovery_area indicates the log storage path. Set this parameter based on site requirements. Ensure that the path has been created in advance.
    4. Run the following command to enable log archiving function:
      NOTICE:
      • Enabling the log archiving function requires database restart, which will interrupt services. Exercise caution when performing this operation.
      • Archived logs occupy a large amount of disk space. If the disk space is full, services are affected. Therefore, you need to periodically delete expired archive logs.
      shutdown immediate;
      startup mount;
      alter database archivelog;
      alter database open;
    5. Run the following command to check whether the log archiving function is enabled:
      archive log list;

      If the message "Database log mode: Archive Mode" is displayed, log archiving is enabled.

    6. Run the following command to exit the database:
      exit;
  2. Install the LogMiner tool.
    1. Run the following command to connect to the database instance as user sys:
      sqlplus sys/password@host:port/SID as sysdba

      Among them:

      • password indicates the password of user sys of the database. You can obtain the password from the database administrator.
      • host indicates the IP address of the server where the database instance is located. Set this parameter based on site requirements.
      • port indicates the port used by the database instance. Set this parameter based on site requirements.
      • SID indicates the name of the instance where the data to be synchronized is located. Set this parameter based on site requirements.
    2. Run the following command to check whether LogMiner is installed successfully:
      desc DBMS_LOGMNR
      desc DBMS_LOGMNR_D
      • If no information is displayed, LogMiner is not installed. Go to the next step.
      • If information is displayed, LogMiner has been installed. Go to 3.
    3. Run the following commands to install LogMiner:
      @$ORACLE_HOME/rdbms/admin/dbmslm.sql
      @$ORACLE_HOME/rdbms/admin/dbmslmd.sql
  3. Create a LogMiner user and grant permissions to the user.
    1. Run the following commands to create a LogMiner user role and configure permissions for the role:
      create role roma_logminer_privs;
      grant create session,
       execute_catalog_role,
       select any transaction,
      flashback any table,
      select any table,
      lock any table,
       select any dictionary to roma_logminer_privs;
      grant select on SYSTEM.LOGMNR_COL$ to roma_logminer_privs;
      grant select on SYSTEM.LOGMNR_OBJ$ to roma_logminer_privs;
      grant select on SYSTEM.LOGMNR_USER$ to roma_logminer_privs;
      grant select on SYSTEM.LOGMNR_UID$ to roma_logminer_privs;
      grant select on V_$DATABASE to roma_logminer_privs;
      grant select_catalog_role to roma_logminer_privs;
      grant LOGMINING to roma_logminer_privs;

      Among them:

      • roma_logminer_privs indicates the role name of the LogMiner user. Set this parameter based on site requirements.
      • grant LOGMINING to roma_logminer_privs; can be added only if the Oracle version is 12c. Otherwise, delete this row.
    2. Run the following command to create user LogMiner:
      create user roma_logminer identified by password default tablespace users;
      grant roma_logminer_privs to roma_logminer;
      alter user roma_logminer quota unlimited on users;

      Among them:

      • roma_logminer indicates the name of the LogMiner user. Set this parameter based on site requirements.
      • password indicates the password of the LogMiner user. Set it based on site requirements.
      • roma_logminer_privs indicates the role of the LogMiner user, which is created in 3.a.
    3. Run the following command to modify log record parameters:
      alter database add supplemental log data (all) columns;
    4. Run the following command to disconnect the database:
      exit;

Configuration When the Oracle Database Is a CDB Database

It is recommended that the database administrator configure the CDC function.

  1. Enable log archiving.
    1. Run the following command to connect to the database as user sys:

      In practice, you can connect to the database in multiple modes. The following uses the command line mode as an example.

      sqlplus /nolog
      CONNECT sys/password@host:port AS SYSDBA;

      Among them:

      • password indicates the password of user sys of the database. You can obtain the password from the database administrator.
      • host indicates the IP address of the server where the database instance is located. Set this parameter based on site requirements.
      • port indicates the port used by the database instance. Set this parameter based on site requirements.
    2. Run the following command to check whether the log archiving function is enabled:
      archive log list;
      • If the message "Database log mode: No Archive Mode" is displayed, log archiving is disabled. Go to the next step.
      • If the message "Database log mode: No Archive Mode" is displayed, log archiving is enabled. Go to 1.f.
    3. Run the following command to set archive log parameters:
      alter system set db_recovery_file_dest_size = 100G;
      alter system set db_recovery_file_dest = '/opt/oracle/oradata/recovery_area' scope=spfile;

      Among them:

      • 100G indicates the size of the log file storage space. Set this parameter based on site requirements.
      • /opt/oracle/oradata/recovery_area indicates the log storage path. Set this parameter based on site requirements. Ensure that the path has been created in advance.
    4. Run the following command to enable log archiving function:
      NOTICE:
      • Enabling the log archiving function requires database restart, which will interrupt services. Exercise caution when performing this operation.
      • Archived logs occupy a large amount of disk space. If the disk space is full, services are affected. Therefore, you need to periodically delete expired archive logs.
      shutdown immediate;
      startup mount;
      alter database archivelog;
      alter database open;
    5. Run the following command to check whether the log archiving function is enabled:
      archive log list;

      If the message "Database log mode: Archive Mode" is displayed, log archiving is enabled.

    6. Run the following command to disconnect the database:
      exit;
  2. Install the LogMiner tool.
    1. Run the following command to connect to the database instance as user sys:
      sqlplus sys/password@host:port/SID as sysdba

      Among them:

      • password indicates the password of user sys of the database. You can obtain the password from the database administrator.
      • host indicates the IP address of the server where the database instance is located. Set this parameter based on site requirements.
      • port indicates the port used by the database instance. Set this parameter based on site requirements.
      • SID indicates the name of the instance where the data to be synchronized is located. Set this parameter based on site requirements.
    2. Run the following command to check whether LogMiner is installed successfully:
      desc DBMS_LOGMNR
      desc DBMS_LOGMNR_D
      • If no information is displayed, LogMiner is not installed. Go to the next step.
      • If information is displayed, LogMiner has been installed. Go to 3.
    3. Run the following commands to install LogMiner:
      @$ORACLE_HOME/rdbms/admin/dbmslm.sql
      @$ORACLE_HOME/rdbms/admin/dbmslmd.sql
  3. Create a LogMiner user and grant permissions to the user.
    1. Run the following commands to create a LogMiner user role and configure permissions for the role:
      create role c##roma_logminer_privs container=all;
      grant create session,
       execute_catalog_role,
       select any transaction,
      flashback any table,
      select any table,
      lock any table,
      logmining,
      set container,
       select any dictionary to c##roma_logminer_privs container=all;
      grant select on SYSTEM.LOGMNR_COL$ to c##roma_logminer_privs container=all;
      grant select on SYSTEM.LOGMNR_OBJ$ to c##roma_logminer_privs container=all;
      grant select on SYSTEM.LOGMNR_USER$ to c##roma_logminer_privs container=all;
      grant select on SYSTEM.LOGMNR_UID$ to c##roma_logminer_privs container=all;
      grant select on V_$DATABASE to c##roma_logminer_privs container=all;
      grant select_catalog_role to c##roma_logminer_privs container=all;

      c##roma_logminer_privs indicates the role name of the LogMiner user. Set this parameter based on site requirements.

    2. Run the following command to create user LogMiner:
      create user c##roma_logminer identified by password default tablespace users container=all;
      grant c##roma_logminer_privs to c##roma_logminer container=all;
      alter user c##roma_logminer quota unlimited on users container=all;

      Among them:

      • c##roma_logminer indicates the name of the LogMiner user. Set this parameter based on site requirements.
      • password indicates the password of the LogMiner user. Set it based on site requirements.
      • c##roma_logminer_privs indicates the role of the LogMiner user, which is created in 3.a.
    3. Run the following command to modify log record parameters:
      alter database add supplemental log data (all) columns;
    4. Run the following command to disconnect the database:
      exit;

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback