Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

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

Teradata Perl Migration

Updated on 2023-03-17 GMT+08:00

Overview

This section describes how to migrate Teradata Perl files.

Run the runDSC.sh or runDSC.bat command and set --application-lang to perl to migrate Teradata BTEQ or SQL_LANG scripts in Perl files to Perl-compatible GaussDB(DWS). After migrating Perl files, you can verify the migration by comparing the output file with its input file using a comparison tool.

The procedure of migrating Perl files is as follows:

  1. Perform the operations in Prerequisites.
  2. Create an input folder and copy the Perl files to be migrated to the folder. For example, create a /migrationfiles/perlfiles folder.
  3. Execute DSC to migrate Perl scripts and set db-bteq-tag-name to BTEQ or db-tdsql-tag-name to SQL_LANG.
    1. The DSC extracts the BTEQ or SQL_LANG scripts from the Perl files.
      1. BTEQ is the tag name, which contains a set of BTEQ scripts. This tag name is configurable using the db-bteq-tag-name configuration parameter in perl-migration.properties file.
      2. SQL_LANG is another tag name, which contains Teradata SQL statements. This is also configurable using the db-tdsql-tag-name configuration parameter.
    2. The DSC invokes the Teradata SQL to migrate the extracted SQL scripts. For details about Teradata SQL migration, see Teradata Syntax Migration.
    3. Perl files are embedded in the migrated scripts.
  4. DSC creates the migrated files in the specified output folder. If no output folder is specified, DSC creates an output folder named converted in the input folder, for example, /migrationfiles/perlfiles/converted.
    NOTE:
    • Perl variables containing SQL statements can also be migrated to SQL by setting the migrate-variables parameter.
    • For perl v 5.10.0 and later are compatible.

Teradata Perl Migration

To migrate Perl files, execute DSC with --source-db Teradata and --application-lang Perl parameter values. DSC supports the migration of BTEQ and SQL_LANG scripts. You can specify the scripts to be migrated by setting db-bteq-tag-name or db-tdsql-tag-name.

Run the following commands to set the source database, input and output folder paths, log paths, and application language.

Linux:

./runDSC.sh 
--source-db|-S Teradata
[--application-lang|-A Perl]
[--input-folder|-I <input-script-path>]
[--output-folder|-O <output-script-path>] 
[--conversion-type|-M <Bulk or BLogic>]
[--log-folder|-L <log-path>]

Windows:

runDSC.bat
--source-db|-S Teradata
[--application-lang|-A Perl]
[--input-folder|-I <input-script-path>]
[--output-folder|-O <output-script-path>] 
[--conversion-type|-M <Bulk or BLogic>]
[--log-folder|-L <log-path>]
For example:
./runDSC.sh --input-folder /opt/DSC/DSC/input/teradata_perl/ --output-folder /opt/DSC/DSC/output/ --source-db teradata --conversion-type Bulk --application-lang PERL

During the execution of DSC, the migration summary, including the progress and completion status, is displayed on the console.

********************** Schema Conversion Started *************************  
DSC process start time : Mon Jan 20 17:24:49 IST 2020  
Statement count progress 100% completed [FILE(1/1)]    
Schema Conversion Progress 100% completed  
**************************************************************************   
Total number of files in input folder : 1  
**************************************************************************  
Log file path :....../DSC/DSC/log/dsc.log  
DSC process end time : Mon Jan 20 17:24:49 IST 2020  
DSC total process time : 0 seconds 
 ********************* Schema Conversion Completed ************************

For details about the parameters for Teradata Perl migration, see Teradata Perl Configuration.

For details about CLI parameters, see Database Schema Conversion.

NOTE:
  • DSC formats the input files and saves them in the output folder. You can compare the formatted input files with the output files.
  • Ensure that there are no spaces in the input path. If there is a space, DSC throws an error. For details, see Troubleshooting.
  • For details about logs, see Log Reference.
  • If the output folder contains subfolders or files, DSC deletes the subfolders and files or overwrites them based on parameter settings in the application.properties configuration file in the config folder before the migration. Deleted or overwritten subfolders and files cannot be restored by DSC.
  • Process start time indicates the migration start time and Process end time indicates the migration end time. Process total time indicates the total migration duration, in milliseconds. In addition, the total number of migrated files, total number of processors, number of used processors, log file path, and error log file path are also displayed on the console.
  • Set --add-timing-on to true in the perl-migration.properties file to add a custom script to calculate statement execution time.

    Example:

    Input
    1
    2
    3
    4
    $V_SQL2 = "SELECT T1.userTypeInd FROM T07_EBM_CAMP T1  WHERE T1.Camp_List_Id = '$abc'";
    $STH = $dbh->prepare($V_SQL2);
    $sth->execute();
    @rows = $sth->fetchrow();
    
    Output
    $V_SQL2 = "SELECT T1.userTypeInd FROM T07_EBM_CAMP T1  WHERE T1.Camp_List_Id = '$abc'";
    $STH = $dbh->prepare($V_SQL2);
    use Time::HiRes qw/gettimeofday/;
    my $start = [Time::HiRes::gettimeofday()];
    $sth->execute();
    my $elapsed = Time::HiRes::tv_interval($start);
    $elapsed = $elapsed * 1000;
    printf("Time: %.3f ms\n", $elapsed);
    @rows = $sth->fetchrow();
  • GROUP and OTHERS must not have write permission for the files or folders specified by--input-folder. That is, the privilege for the folder specified by --input-folder must not be higher than 755. For security purposes, DSC will not be executed if the input files or folders have the write permission.
  • If migration tasks are executed concurrently, the input folder must be unique for each task.

Best Practices

To optimize the migration, you are advised to follow the standard practices:

  • BTEQ scripts must be in the following format:
    print BTEQ <<ENDOFINPUT;
    TRUNCATE TABLE employee;
    ENDOFINPUT
    close(BTEQ);
  • SQL_LANG scripts must be in the following format:
    1
    2
    3
    my $sSQL=<<SQL_LANG;
    TRUNCATE TABLE employee;
    SQL_LANG
    
  • Comment must not contain the following information:
    • print BTEQ <<ENDOFINPUT
    • ENDOFINPUT
    • close(BTEQ)
    • my $sSQL=<<SQL_LANG
    • SQL_LANG

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback