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
Situation Awareness
Managed Threat Detection
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
On this page
Help Center/ DataArts Studio/ FAQs/ DataArts Migration (Real-Time Jobs)/ How Do I Grant the Log Archiving, Query, and Parsing Permissions of an Oracle Data Source?

How Do I Grant the Log Archiving, Query, and Parsing Permissions of an Oracle Data Source?

Updated on 2025-01-20 GMT+08:00

Symptom

The default permissions of the Oracle data source are insufficient for executing real-time processing migration jobs.

Possible Cause

  • The log archiving function must be enabled for the Oracle database. It is recommended that archived logs be retained for at least three days.
  • The permissions for querying Oracle tables or parsing logs are missing.

Solution

  1. Enable log archiving.
    1. Log in to the Oracle database as user sysdba.
    2. Run the SQL command ARCHIVE LOG LIST to query the archiving status of the current database. The following information indicates that log archiving is disabled:
      Database log mode No Archive Mode #Log archiving is disabled.
      Automatic archival Disabled
      Archive destination USE_DB_RECOVERY_FILE_DEST 
      Oldest online log sequence 1 
      Current log sequence 2
    3. Run the SQL command SHUTDOWN IMMEDIATE to shut down the database.
    4. Run the SQL command STARTUP MOUNT to start the database in MOUNT state.
    5. Run the SQL command ALTER DATABASE ARCHIVELOG to enable archiving mode.
    6. Run the SQL command ARCHIVE LOG LIST to query the archiving status. The following information indicates that log archiving is enabled:
      Databaselogmode Archive Mode #Log archiving is enabled.
      Automatic archival Enabled 
      Archive destination USE_DB_RECOVERY_FILE_DEST 
      Oldest online log sequence 1
      Next log sequence to archive 2
      Currentlogsequence 2
    7. Run the SQL command ALTER DATABASE OPEN to start the database.
  2. Enable supplementary logs for the Oracle database and tables to be migrated.
    1. Run the following SQL statement to enable supplemental logs for the database:
      ALTER DATABASE ADD SUPPLEMENTAL LOG DATA; 
    2. Enable supplemental logs for the tables to be synchronized in real time.
      ALTER TABLE "schema_name"."table_name" ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

      After the setting is successful, run the following SQL statement. If ALL_COLUMN_LOGGING is returned, supplemental logs are enabled for the tables:

      SELECT 'KEY', LOG_GROUP_TYPE FROM ALL_LOG_GROUPS WHERE OWNER = 'schema_name' AND TABLE_NAME = 'table_name';
      "KEY" LOG_GROUP_TYPE
      KEY ALL_COLUMN_LOGGING
  3. Grant required permissions to the Oracle user.
    • Reference commands for granting permissions to Oracle 19 users:
      sqlplus sys/password@//localhost:1521/ORCLCDB as sysdba
      CREATE USER mgrationuser IDENTIFIED BY mgrationuserPWD DEFAULT TABLESPACE logminer_tbs QUOTA UNLIMITED ON logminer_tbs CONTAINER=ALL;
      GRANT CREATE SESSION TO mgrationuser CONTAINER=ALL;
      GRANT SET CONTAINER TO mgrationuser CONTAINER=ALL;
      GRANT SELECT ON V_$DATABASE to mgrationuser CONTAINER=ALL;
      GRANT FLASHBACK ANY TABLE TO mrationuser CONTAINER=ALL;
      GRANT SELECT ANY TABLE TO mgrationuser CONTAINER=ALL;
      GRANT SELECT_CATALOG_ROLE TO mgrationuser CONTAINER=ALL;
      GRANT EXECUTE_CATALOG_ROLE TO mgrationuser CONTAINER=ALL;
      GRANT SELECT ANY TRANSACTION TO mgrationuser CONTAINER=ALL;
      GRANT LOGMINING TO mgrationuser CONTAINER=ALL;
      GRANT CREATE TABLE TO mgrationuser CONTAINER=ALL;
      -- Don't need to execute this statement, If you set 'scan.incremental.snapshot.enabled=true' (default).
      GRANT LOCK ANY TABLE TO mgrationuser CONTAINER=ALL;
      GRANT CREATE SEQUENCE TO mgrationuser CONTAINER=ALL;
      GRANT EXECUTE ON DBMS_LOGMNR TO mgrationuser CONTAINER=ALL;
      GRANT EXECUTE ON DBMS_LOGMNR_D TO mgrationuser CONTAINER=ALL;
      GRANT SELECT ON V_$LOG TO mgrationuser CONTAINER=ALL;
      GRANT SELECT ON V_$LOG_HISTORY TO mgrationuser CONTAINER=ALL;
      GRANT SELECT ON V_$LOGMNR_LOGS TO mgrationuser CONTAINER=ALL;
      GRANT SELECT ON V_$LOGMNR_CONTENTS TO mgrationuser CONTAINER=ALL;
      GRANT SELECT ON V_$LOGMNR_PARAMETERS TO mgrationuser CONTAINER=ALL;
      GRANT SELECT ON V_$LOGFILE TO mgrationuser CONTAINER=ALL;
      GRANT SELECT ON V_$ARCHIVED_LOG TO mgrationuser CONTAINER=ALL;
      GRANT SELECT ON V_$ARCHIVE_DEST_STATUS TO mgrationuser CONTAINER=ALL;
      exit;
    • Reference commands for granting permissions to Oracle 11g users:
      sqlplus sys/password@host:port/SID AS SYSDBA;
        CREATE USER mgrationuser IDENTIFIED BY mgrationuserPDW DEFAULT TABLESPACE LOGMINER_TBS QUOTA UNLIMITED ON LOGMINER_TBS;
        GRANT CREATE SESSION TO mgrationuser;
        GRANT SELECT ON V_$DATABASE to mgrationuser;
        GRANT FLASHBACK ANY TABLE TO mgrationuser;
        GRANT SELECT ANY TABLE TO mgrationuser;
        GRANT SELECT_CATALOG_ROLE TO mgrationuser;
        GRANT EXECUTE_CATALOG_ROLE TO mgrationuser;
        GRANT SELECT ANY TRANSACTION TO mgrationuser;
        GRANT CREATE TABLE TO mgrationuser;
        GRANT LOCK ANY TABLE TO mgrationuser;
        GRANT ALTER ANY TABLE TO mgrationuser;
        GRANT CREATE SEQUENCE TO mgrationuser;
        GRANT EXECUTE ON DBMS_LOGMNR TO mgrationuser;
        GRANT EXECUTE ON DBMS_LOGMNR_D TO mgrationuser;
        GRANT SELECT ON V_$LOG TO mgrationuser;
        GRANT SELECT ON V_$LOG_HISTORY TO mgrationuser;
        GRANT SELECT ON V_$LOGMNR_LOGS TO mgrationuser;
        GRANT SELECT ON V_$LOGMNR_CONTENTS TO mgrationuser;
        GRANT SELECT ON V_$LOGMNR_PARAMETERS TO mgrationuser;
        GRANT SELECT ON V_$LOGFILE TO mgrationuser;
        GRANT SELECT ON V_$ARCHIVED_LOG TO mgrationuser;
        GRANT SELECT ON V_$ARCHIVE_DEST_STATUS TO mgrationuser;
        exit

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback